Sha256: 6e2d3b556b393a6989935624eb282bbf36df0a1625236654eb40ce8b152a5db4

Contents?: true

Size: 909 Bytes

Versions: 1

Compression:

Stored size: 909 Bytes

Contents

class Ecloud < Fog::Bin
  class << self
    def available?
      Fog::Ecloud::ECLOUD_OPTIONS.all? {|requirement| Fog.credentials.include?(requirement)}
    end

    def class_for(key)
      case key
        when :compute
          Fog::Compute::Ecloud
        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("Ecloud[:compute] is not recommended, use Compute[:ecloud] for portability")
                        Fog::Compute.new(:provider => 'Ecloud')
                      else
                        raise ArgumentError, "Unrecognized service: #{key.inspect}"
                    end
      end
      @@connections[service]
    end

    def services
      Fog::Ecloud.services
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-ecloud-0.0.2 lib/fog/bin/ecloud.rb