Sha256: 92dbeb46509e2cf04756ae3260624b7c3e7e66c6b0c2968714e3a10544955ac0

Contents?: true

Size: 957 Bytes

Versions: 7

Compression:

Stored size: 957 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
          Formatador.display_line("[yellow][WARN] Slicehost[:compute] is deprecated, use Compute[:slicehost] instead[/]")
          Fog::Compute.new(:provider => 'Slicehost')
        when :dns
          Formatador.display_line("[yellow][WARN] 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

7 entries across 7 versions & 3 rubygems

Version Path
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb
fog-0.11.0 lib/fog/bin/slicehost.rb
fog-0.10.0 lib/fog/bin/slicehost.rb
fog4encbs-0.9.0.1 lib/fog/bin/slicehost.rb
fog4encbs-0.9.0 lib/fog/bin/slicehost.rb
fog-0.9.0 lib/fog/bin/slicehost.rb