2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/amazon-instance/project.rb', line 2
def self.load(name, environment, config_dir)
config = nil
filename = config_dir+'projects/'+name+'.yml'
if File.exist?(filename)
File.open(filename) do |content|
config_environments = YAML::load(content)
if !config_environments[environment].nil?
config = config_environments[environment]
else
raise 'Invalid environment name: '+environment
end
end
else
raise 'File: '+name+'.yml does not exist'
end
config
end
|