23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/fog/aws/bin.rb', line 23
def [](service)
@@connections ||= Hash.new do |hash, key|
klazz = class_for(key)
hash[key] = case key
when :ec2
location = caller.first
warning = "[yellow][WARN] AWS[:ec2] is deprecated, use AWS[:compute] instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
klazz.new
when :eu_storage
klazz.new(:region => 'eu-west-1')
when :s3
location = caller.first
warning = "[yellow][WARN] AWS[:s3] is deprecated, use AWS[:storage] instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
klazz.new
else
klazz.new
end
end
@@connections[service]
end
|