Sha256: 853a501b8be6d8a30d64af46928fb9a36b80c78304e957bfe6955121d3916517

Contents?: true

Size: 909 Bytes

Versions: 7

Compression:

Stored size: 909 Bytes

Contents

class GoGrid < Fog::Bin
  class << self

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

    def [](service)
      @@connections ||= Hash.new do |hash, key|
        hash[key] = case key
        when :compute
          Fog::Compute.new(:provider => 'GoGrid')
        when :servers
          location = caller.first
          warning = "[yellow][WARN] GoGrid[:servers] is deprecated, use GoGrid[:compute] instead[/]"
          warning << " [light_black](" << location << ")[/] "
          Formatador.display_line(warning)
          Fog::Compute.new(:provider => 'GoGrid')
        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/go_grid.rb
fog-0.5.0 lib/fog/bin/go_grid.rb
phpfog-fog-0.4.1.3 lib/fog/bin/go_grid.rb
phpfog-fog-0.4.1.2 lib/fog/bin/go_grid.rb
phpfog-fog-0.4.1.1 lib/fog/bin/go_grid.rb
phpfog-fog-0.4.1 lib/fog/bin/go_grid.rb
fog-0.4.1 lib/fog/bin/go_grid.rb