Sha256: db478f3b9196ec0a89d9874c1824c012da81949754f579b94f886af6f1bc4d17

Contents?: true

Size: 926 Bytes

Versions: 19

Compression:

Stored size: 926 Bytes

Contents

class Slicehost < Fog::Bin
  class << self

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

    def services
      Fog::Slicehost.services
    end

  end
end

Version data entries

19 entries across 19 versions & 6 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
michiels-fog-1.3.1 lib/fog/bin/slicehost.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/bin/slicehost.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
fog-1.3.1 lib/fog/bin/slicehost.rb
fog-1.3.0 lib/fog/bin/slicehost.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
fog-1.2.0 lib/fog/bin/slicehost.rb
ktheory-fog-1.1.2 lib/fog/bin/slicehost.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
fog-1.1.2 lib/fog/bin/slicehost.rb
fog_tractical-1.1.4 lib/fog/bin/slicehost.rb
fog_tractical-1.1.3 lib/fog/bin/slicehost.rb
fog-1.1.1 lib/fog/bin/slicehost.rb
fog-1.1.0 lib/fog/bin/slicehost.rb