Class: Profigure

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

Class Method Summary collapse

Class Method Details

.load(configs_dir, environment = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/profigure/profigure.rb', line 3

def load(configs_dir, environment=nil)
  hash = file_contents("defaults", configs_dir)
  if environment
    yaml_result = file_contents(environment, configs_dir)
    merged_with_reference = load_referenced_config_from configs_dir, yaml_result
    hash.recursive_merge! merged_with_reference
  end
  hash["environment"] = environment
  MoStash.new hash
end