Sha256: 3579f2dd450f321beff79a0ab9b7f2e7783c6ea4bee72a9774b0aa4d88bd598d

Contents?: true

Size: 909 Bytes

Versions: 10

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

10 entries across 8 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-ecloud-0.3.0/lib/fog/bin/ecloud.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-ecloud-0.3.0/lib/fog/bin/ecloud.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-ecloud-0.3.0/lib/fog/bin/ecloud.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-ecloud-0.1.1/lib/fog/bin/ecloud.rb
fog-ecloud-0.3.0 lib/fog/bin/ecloud.rb
fog-ecloud-0.2.0 lib/fog/bin/ecloud.rb
fog-ecloud-0.1.3 lib/fog/bin/ecloud.rb
fog-ecloud-0.1.2 lib/fog/bin/ecloud.rb
fog-ecloud-0.1.1 lib/fog/bin/ecloud.rb
fog-ecloud-0.1.0 lib/fog/bin/ecloud.rb