Module: Typus::Configuration

Defined in:
lib/typus/configuration.rb

Constant Summary collapse

@@config =
{}
@@roles =
Hash.new({})

Class Method Summary collapse

Class Method Details

.models!Object

Read configuration from config/typus/*.yml.



7
8
9
10
11
12
13
14
15
# File 'lib/typus/configuration.rb', line 7

def self.models!
  @@config = {}

  Typus.model_configuration_files.each do |file|
    if data = YAML::load(ERB.new(File.read(file)).result)
      @@config.merge!(data)
    end
  end
end

.roles!Object

Read roles from files config/typus/*_roles.yml.



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/typus/configuration.rb', line 21

def self.roles!
  @@roles = Hash.new({})

  Typus.role_configuration_files.each do |file|
    if data = YAML::load(ERB.new(File.read(file)).result)
      data.compact.each do |key, value|
        @@roles[key] = @@roles[key].merge(value)
      end
    end
  end
end