Class: Retter::Config
- Inherits:
-
Object
- Object
- Retter::Config
- Extended by:
- Forwardable
- Defined in:
- lib/retter/config.rb
Instance Attribute Summary collapse
-
#retter_home ⇒ Object
readonly
Returns the value of attribute retter_home.
Instance Method Summary collapse
- #after_callback(name, sym = nil, &block) ⇒ Object (also: #after)
-
#initialize(env) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(env) ⇒ Config
Returns a new instance of Config.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/retter/config.rb', line 18 def initialize(env) @env = env @after_callbacks = {} @attributes = {} detect_retter_home environments_required @retter_home = Pathname.new(@env['RETTER_HOME']) load_defaults load_retterfile_if_exists rescue EnvError => e $stderr.puts e. say Command.usage, :green exit 1 end |
Instance Attribute Details
#retter_home ⇒ Object (readonly)
Returns the value of attribute retter_home.
16 17 18 |
# File 'lib/retter/config.rb', line 16 def retter_home @retter_home end |
Instance Method Details
#after_callback(name, sym = nil, &block) ⇒ Object Also known as: after
37 38 39 40 41 42 43 |
# File 'lib/retter/config.rb', line 37 def after_callback(name, sym = nil, &block) if callback = sym || block @after_callbacks[name] = callback else @after_callbacks[name] end end |