Sha256: bbb8d1a42627adf4b1efe50684dbbfb34c31619a3697a58132100eadde8f1cdc

Contents?: true

Size: 912 Bytes

Versions: 7

Compression:

Stored size: 912 Bytes

Contents

class Bluebox < Fog::Bin
  class << self

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

    def [](service)
      @@connections ||= Hash.new do |hash, key|
        hash[key] = case key
        when :blocks
          location = caller.first
          warning = "[yellow][WARN] Bluebox[:blocks] is deprecated, use Bluebox[:compute] instead[/]"
          warning << " [light_black](" << location << ")[/] "
          Formatador.display_line(warning)
          Fog::Compute.new(:provider => 'Bluebox')
        when :compute
          Fog::Compute.new(:provider => 'Bluebox')
        else
          raise ArgumentError, "Unrecognized service: #{service}"
        end
      end
      @@connections[service]
    end

    def services
      [:compute]
    end

  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fog-0.5.1 lib/fog/bin/bluebox.rb
fog-0.5.0 lib/fog/bin/bluebox.rb
phpfog-fog-0.4.1.3 lib/fog/bin/bluebox.rb
phpfog-fog-0.4.1.2 lib/fog/bin/bluebox.rb
phpfog-fog-0.4.1.1 lib/fog/bin/bluebox.rb
phpfog-fog-0.4.1 lib/fog/bin/bluebox.rb
fog-0.4.1 lib/fog/bin/bluebox.rb