-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84ecebf
commit ad95c0f
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class Voxel < Fog::Bin | ||
class << self | ||
def class_for(key) | ||
case key | ||
when :compute | ||
Fog::Compute::Voxel | ||
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("Voxel[:compute] is not recommended, use Compute[:voxel] for portability") | ||
Fog::Compute.new(:provider => 'Voxel') | ||
else | ||
raise ArgumentError, "Unrecognized service: #{key.inspect}" | ||
end | ||
end | ||
@@connections[service] | ||
end | ||
|
||
def services | ||
Fog::Voxel.services | ||
end | ||
end | ||
end |