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