1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

merge bin files.

This commit is contained in:
Nat Welch 2012-12-04 12:15:53 -08:00
parent c1268ea500
commit a4f87c2317
2 changed files with 9 additions and 36 deletions

View file

@ -1,36 +0,0 @@
class Google < Fog::Bin
class << self
def class_for(key)
case key
when :compute
Fog::Compute::Google
else
raise ArgumentError, "Unrecognized service: #{key}"
end
end
def [](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :compute
Fog::Logger.warning("Google[:compute] is not recommended, use
Compute[:google] for portability")
Fog::Compute.new(:provider => 'Google')
else
raise ArgumentError, "Unrecognized service: #{key.inspect}"
end
end
@@connections[service]
end
def account
@@connections[:compute].account
end
def services
Fog::Google.services
end
end
end

View file

@ -3,6 +3,8 @@ class Google < Fog::Bin
def class_for(key)
case key
when :compute
Fog::Compute::Google
when :storage
Fog::Storage::Google
else
@ -16,6 +18,9 @@ class Google < Fog::Bin
when :storage
Fog::Logger.warning("Google[:storage] is not recommended, use Storage[:google] for portability")
Fog::Storage.new(:provider => 'Google')
when :compute
Fog::Logger.warning("Google[:compute] is not recommended, use Compute[:google] for portability")
Fog::Compute.new(:provider => 'Google')
else
raise ArgumentError, "Unrecognized service: #{key.inspect}"
end
@ -23,6 +28,10 @@ class Google < Fog::Bin
@@connections[service]
end
def account
@@connections[:compute].account
end
def services
Fog::Google.services
end