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

fixes tests due to class name collision.

This commit is contained in:
Nat Welch 2012-12-26 16:52:53 -08:00
parent a993169469
commit 8e34fdf788
2 changed files with 27 additions and 6 deletions

View file

@ -59,11 +59,11 @@ end
require 'fog/bin/atmos'
require 'fog/bin/aws'
require 'fog/bin/bare_metal_cloud'
require 'fog/bin/bluebox'
require 'fog/bin/brightbox'
require 'fog/bin/google'
require 'fog/bin/cloudstack'
require 'fog/bin/clodo'
require 'fog/bin/cloudstack'
require 'fog/bin/dnsimple'
require 'fog/bin/dnsmadeeasy'
require 'fog/bin/dynect'
@ -77,18 +77,17 @@ require 'fog/bin/joyent'
require 'fog/bin/libvirt'
require 'fog/bin/linode'
require 'fog/bin/local'
require 'fog/bin/bare_metal_cloud'
require 'fog/bin/ninefold'
require 'fog/bin/rackspace'
require 'fog/bin/openstack'
require 'fog/bin/ovirt'
require 'fog/bin/rackspace'
require 'fog/bin/serverlove'
require 'fog/bin/stormondemand'
require 'fog/bin/terremark'
require 'fog/bin/vcloud'
require 'fog/bin/virtual_box'
require 'fog/bin/vmfusion'
require 'fog/bin/vsphere'
require 'fog/bin/voxel'
require 'fog/bin/vsphere'
require 'fog/bin/xenserver'
require 'fog/bin/zerigo'

View file

@ -1,4 +1,4 @@
class Google < Fog::Bin
module Google # deviates from other bin stuff to accomodate gem
class << self
def class_for(key)
@ -36,5 +36,27 @@ class Google < Fog::Bin
Fog::Google.services
end
# based off of virtual_box.rb
def available?
availability = if Gem::Specification.respond_to?(:find_all_by_name)
!Gem::Specification.find_all_by_name('google_api_client').empty? # newest rubygems
else
!Gem.source_index.find_name('google_api_client').empty? # legacy
end
if availability
for service in services
for collection in self.class_for(service).collections
unless self.respond_to?(collection)
self.class_eval <<-EOS, __FILE__, __LINE__
def self.#{collection}
self[:#{service}].#{collection}
end
EOS
end
end
end
end
availability
end
end
end