Class: Duty::ConfigLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/duty/config_loader.rb

Constant Summary collapse

DUTY_CONFIG_FILENAME =
'.duty.yml'

Instance Method Summary collapse

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