15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/fog/bin/linode.rb', line 15
def [](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :compute
Fog::Compute.new(:provider => 'Linode')
when :dns
Fog::DNS.new(:provider => 'Linode')
when :linode
location = caller.first
warning = "[yellow][WARN] Linode[:linode] is deprecated, use Linode[:compute] instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
Fog::Compute.new(:provider => 'Linode')
else
raise ArgumentError, "Unrecognized service: #{service}"
end
end
@@connections[service]
end
|