Class: DeployConfig
- Inherits:
-
Object
- Object
- DeployConfig
- Defined in:
- lib/heroploy/config/deploy_config.rb
Instance Attribute Summary collapse
-
#environments ⇒ Object
Returns the value of attribute environments.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#environments ⇒ Object
Returns the value of attribute environments.
4 5 6 |
# File 'lib/heroploy/config/deploy_config.rb', line 4 def environments @environments end |
Class Method Details
.load ⇒ Object
21 22 23 |
# File 'lib/heroploy/config/deploy_config.rb', line 21 def self.load DeployConfig.parse(YAML::load(File.open('config/heroploy.yml'))) end |
.parse(attrs) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/heroploy/config/deploy_config.rb', line 10 def self.parse(attrs) config = DeployConfig.new config.environments = [] attrs['environments'].each do |name, attrs| config.environments << EnvConfig.parse(name, attrs) end config end |
Instance Method Details
#[](env_name) ⇒ Object
6 7 8 |
# File 'lib/heroploy/config/deploy_config.rb', line 6 def [](env_name) environments.select{ |env_config| env_config.name == env_name}.first end |