class Boxen::Hook

Attributes

checkout[R]
config[R]
puppet[R]
result[R]

Public Class Methods

all() click to toggle source
# File lib/boxen/hook.rb, line 18
def self.all
  @hooks || []
end
new(config, checkout, puppet, result) click to toggle source
# File lib/boxen/hook.rb, line 22
def initialize(config, checkout, puppet, result)
  @config   = config
  @checkout = checkout
  @puppet   = puppet
  @result   = result
end
register(hook) click to toggle source
# File lib/boxen/hook.rb, line 10
def self.register(hook)
  @hooks << hook
end
unregister(hook) click to toggle source
# File lib/boxen/hook.rb, line 14
def self.unregister(hook)
  @hooks.delete hook
end

Public Instance Methods

enabled?() click to toggle source
# File lib/boxen/hook.rb, line 29
def enabled?
  required_vars = Array(required_environment_variables)
  required_vars.any? && required_vars.all? do |var|
    ENV[var] && !ENV[var].empty?
  end
end
perform?() click to toggle source
# File lib/boxen/hook.rb, line 36
def perform?
  false
end
run() click to toggle source
# File lib/boxen/hook.rb, line 40
def run
  call if perform?
end