Class: Configuration
- Inherits:
-
Object
- Object
- Configuration
- Defined in:
- lib/configuration.rb
Instance Attribute Summary collapse
-
#app_base ⇒ Object
Returns the value of attribute app_base.
-
#log_file ⇒ Object
Returns the value of attribute log_file.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#runner ⇒ Object
Returns the value of attribute runner.
Class Method Summary collapse
Instance Method Summary collapse
- #app_base_path(*args) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 |
# File 'lib/configuration.rb', line 14 def initialize @log_file = $stderr @app_base = '/srv' @logger = Logger.new(log_file) @runner = Runner.new(logger) end |
Instance Attribute Details
#app_base ⇒ Object
Returns the value of attribute app_base.
23 24 25 |
# File 'lib/configuration.rb', line 23 def app_base @app_base end |
#log_file ⇒ Object
Returns the value of attribute log_file.
22 23 24 |
# File 'lib/configuration.rb', line 22 def log_file @log_file end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
25 26 27 |
# File 'lib/configuration.rb', line 25 def logger @logger end |
#runner ⇒ Object
Returns the value of attribute runner.
24 25 26 |
# File 'lib/configuration.rb', line 24 def runner @runner end |
Class Method Details
.current ⇒ Object
7 |
# File 'lib/configuration.rb', line 7 def current; @current ||= new; end |
.method_missing(sym, *args, &block) ⇒ Object
8 9 10 11 |
# File 'lib/configuration.rb', line 8 def method_missing(sym, *args, &block) return current.send(sym, *args, &block) if current.respond_to?(sym) super end |
.reset ⇒ Object
6 |
# File 'lib/configuration.rb', line 6 def reset; @current = nil; end |
Instance Method Details
#app_base_path(*args) ⇒ Object
32 33 34 |
# File 'lib/configuration.rb', line 32 def app_base_path *args Pathname.new File.join(@app_base, *args) end |