Class: Duty::ConfigLoader
- Inherits:
-
Object
- Object
- Duty::ConfigLoader
- Defined in:
- lib/duty/config_loader.rb
Constant Summary collapse
- DUTY_CONFIG_FILENAME =
'.duty.yml'
Instance Method Summary collapse
-
#initialize(root_directory = nil) ⇒ ConfigLoader
constructor
A new instance of ConfigLoader.
- #load(base_dir) ⇒ Object
Constructor Details
#initialize(root_directory = nil) ⇒ ConfigLoader
Returns a new instance of ConfigLoader.
8 9 10 |
# File 'lib/duty/config_loader.rb', line 8 def initialize(root_directory = nil) @root_directory = root_directory end |
Instance Method Details
#load(base_dir) ⇒ Object
12 13 14 15 |
# File 'lib/duty/config_loader.rb', line 12 def load(base_dir) return default_config unless path = find_closest_config_file(base_dir) load_config_file(path) end |