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

[compute|virtualbox] backwards compatibility for gem availability check

This commit is contained in:
geemus 2011-07-08 16:45:17 -05:00
parent b7f54bbd2d
commit 0716f70068

View file

@ -24,7 +24,11 @@ module VirtualBox # deviates from other bin stuff to accomodate gem
end
def available?
availability = !Gem::Specification.find_all_by_name('virtualbox').empty?
availability = if Gem::Specification.respond_to?(:find_all_by_name)
!Gem::Specification.find_all_by_name('virtualbox').empty? # newest rubygems
else
!Gem.source_index.find_name('virtualbox').empty? # legacy
end
if availability
for service in services
for collection in self.class_for(service).collections