Sha256: 5f75c1cde1efdd9daf9ebdf932d42647dc53bb8b663aeefa96aa4ef756849e20

Contents?: true

Size: 899 Bytes

Versions: 6

Compression:

Stored size: 899 Bytes

Contents

class Bluebox < Fog::Bin
  class << self

    def class_for(key)
      case key
      when :compute
        Fog::Compute::Bluebox
      when :dns
        Fog::DNS::Bluebox
      else
        raise ArgumentError, "Unsupported #{self} service: #{key}"
      end
    end

    def [](service)
      @@connections ||= Hash.new do |hash, key|
        hash[key] = case key
        when :compute
          Fog::Logger.warning("Bluebox[:compute] is deprecated, use Compute[:bluebox] instead")
          Fog::Compute.new(:provider => 'Bluebox')
        when :dns
          Fog::Logger.warning("Bluebox[:storage] is deprecated, use Storage[:bluebox] instead")
          Fog::DNS.new(:provider => 'Bluebox')
        else
          raise ArgumentError, "Unrecognized service: #{service}"
        end
      end
      @@connections[service]
    end

    def services
      Fog::Bluebox.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/bluebox.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/bin/bluebox.rb
tag-fog-1.0.1 lib/fog/bin/bluebox.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/bin/bluebox.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/lib/fog/bin/bluebox.rb
fog-1.0.0 lib/fog/bin/bluebox.rb