Sha256: 0aaf03e120881e5706b882eb394dc02f2092516204af0ba13a3e14efe697b519

Contents?: true

Size: 1.03 KB

Versions: 58

Compression:

Stored size: 1.03 KB

Contents

module Terremark
  class << self
    if (Fog::Terremark::ECLOUD_OPTIONS.all? { |option| Fog.credentials.has_key?(option) } ) ||
       (Fog::Terremark::VCLOUD_OPTIONS.all? { |option| Fog.credentials.has_key?(option) } )

      def initialized?
        true
      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

    else

      def initialized?
        false
      end

    end
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/terremark/bin.rb
fog-0.2.28 lib/fog/terremark/bin.rb
fog-0.2.27 lib/fog/terremark/bin.rb
fog-0.2.26 lib/fog/terremark/bin.rb
fog-0.2.25 lib/fog/terremark/bin.rb
fog-0.2.24 lib/fog/terremark/bin.rb
tecnh-fog-0.2.23.vpc lib/fog/terremark/bin.rb
fog-0.2.23 lib/fog/terremark/bin.rb
fog-0.2.22 lib/fog/terremark/bin.rb
fog-0.2.21 lib/fog/terremark/bin.rb
fog-0.2.20 lib/fog/terremark/bin.rb
fog-0.2.19 lib/fog/terremark/bin.rb
fog-0.2.18 lib/fog/terremark/bin.rb
fog-0.2.17 lib/fog/terremark/bin.rb
fog-0.2.16 lib/fog/terremark/bin.rb
fog-0.2.15 lib/fog/terremark/bin.rb
fog-0.2.14 lib/fog/terremark/bin.rb
fog-0.2.13 lib/fog/terremark/bin.rb
fog-0.2.12 lib/fog/terremark/bin.rb
fog-0.2.11 lib/fog/terremark/bin.rb