Class: Retter::Config

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/retter/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Config

Returns a new instance of Config.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/retter/config.rb', line 20

def initialize(env)
  @env             = env
  @after_callbacks = {}
  @attributes      = {}

  detect_retter_home
  environments_required

  load_defaults
  load_retterfile
rescue EnvError => e
  $stderr.puts e.message, Command.usage

  exit 1
end

Instance Method Details

#after_callback(name, sym = nil, &block) ⇒ Object Also known as: after



36
37
38
39
40
41
42
# File 'lib/retter/config.rb', line 36

def after_callback(name, sym = nil, &block)
  if callback = sym || block
    @after_callbacks[name] = callback
  else
    @after_callbacks[name]
  end
end