Sha256: a82798535cf95b073cd7cda9bd8dd9f37487206cd3d7de512081c8875070cf4b

Contents?: true

Size: 940 Bytes

Versions: 46

Compression:

Stored size: 940 Bytes

Contents

class Terremark < Fog::Bin
  class << self

    def available?
      Fog::Terremark::ECLOUD_OPTIONS.all? {|requirement| Fog.credentials.include?(requirement)} ||
      Fog::Terremark::VCLOUD_OPTIONS.all? {|requirement| Fog.credentials.include?(requirement)}
    end

    def terremark_service(service)
      case service
      when :ecloud
        Fog::Terremark::Ecloud
      when :vcloud
        Fog::Terremark::Vcloud
      else
        raise "Unsupported Terremark Service"
      end
    end

    def [](service)
      @@connections ||= Hash.new do |hash, key|
        credentials = Fog.credentials.reject do |k,v|
          case key
          when :ecloud
            !Fog::Terremark::ECLOUD_OPTIONS.include?(k)
          when :vcloud
            !Fog::Terremark::VCLOUD_OPTIONS.include?(k)
          end
        end
        hash[key] = terremark_service(key).new(credentials)
      end
      @@connections[service]
    end

  end
end

Version data entries

46 entries across 46 versions & 3 rubygems

Version Path
fog-0.5.3 lib/fog/bin/terremark.rb
fog-0.5.2 lib/fog/bin/terremark.rb
fog-0.5.1 lib/fog/bin/terremark.rb
fog-0.5.0 lib/fog/bin/terremark.rb
phpfog-fog-0.4.1.3 lib/fog/bin/terremark.rb
phpfog-fog-0.4.1.2 lib/fog/bin/terremark.rb
phpfog-fog-0.4.1.1 lib/fog/bin/terremark.rb
phpfog-fog-0.4.1 lib/fog/bin/terremark.rb
fog-0.4.1 lib/fog/bin/terremark.rb
fog-0.4.0 lib/fog/terremark/bin.rb
fog-0.3.34 lib/fog/terremark/bin.rb
fog-0.3.33 lib/fog/terremark/bin.rb
fog-0.3.32 lib/fog/terremark/bin.rb
fog-0.3.31 lib/fog/terremark/bin.rb
fog-0.3.30 lib/fog/terremark/bin.rb
fog-0.3.29 lib/fog/terremark/bin.rb
fog-0.3.28 lib/fog/terremark/bin.rb
fog-0.3.27 lib/fog/terremark/bin.rb
fog-0.3.26 lib/fog/terremark/bin.rb
fog-0.3.25 lib/fog/terremark/bin.rb