Sha256: d00678d6751c2b4cf39b276692242cddae53219c7ade15530790c2c6c00d50c9

Contents?: true

Size: 913 Bytes

Versions: 6

Compression:

Stored size: 913 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 deprecated, use Compute[:slicehost] instead")
          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

6 entries across 6 versions & 3 rubygems

Version Path
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
tag-fog-1.0.1 lib/fog/bin/slicehost.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
fog-1.0.0 lib/fog/bin/slicehost.rb