Sha256: 3f25e8a1083565435739e59c09d4bf1352c6d368b336201bf614a817cb5c8e1a

Contents?: true

Size: 1.09 KB

Versions: 13

Compression:

Stored size: 1.09 KB

Contents

class AWS < Fog::Bin
  class << self

    def [](service)
      @@connections ||= Hash.new do |hash, key|
        hash[key] = case key
        when :compute
          Fog::AWS::Compute.new
        when :ec2
          location = caller.first
          warning = "[yellow][WARN] AWS[:ec2] is deprecated, use AWS[:compute] instead[/]"
          warning << " [light_black](" << location << ")[/] "
          Formatador.display_line(warning)
          Fog::AWS::Compute.new
        when :elb
          Fog::AWS::ELB.new
        when :eu_storage
          Fog::AWS::Storage.new(:region => 'eu-west-1')
        when :sdb
          Fog::AWS::SimpleDB.new
        when :s3
          location = caller.first
          warning = "[yellow][WARN] AWS[:s3] is deprecated, use AWS[:storage] instead[/]"
          warning << " [light_black](" << location << ")[/] "
          Formatador.display_line(warning)
          Fog::AWS::Storage.new
        when :storage
          Fog::AWS::Storage.new
        end
      end
      @@connections[service]
    end

    def services
      [:compute, :elb, :sdb, :storage]
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fog-0.3.13 lib/fog/aws/bin.rb
fog-0.3.12 lib/fog/aws/bin.rb
fog-0.3.11 lib/fog/aws/bin.rb
fog-0.3.10 lib/fog/aws/bin.rb
fog-0.3.9 lib/fog/aws/bin.rb
fog-0.3.8 lib/fog/aws/bin.rb
fog-0.3.7 lib/fog/aws/bin.rb
fog-0.3.6 lib/fog/aws/bin.rb
fog-0.3.5 lib/fog/aws/bin.rb
fog-0.3.4 lib/fog/aws/bin.rb
fog-0.3.3 lib/fog/aws/bin.rb
fog-0.3.2 lib/fog/aws/bin.rb
fog-0.3.1 lib/fog/aws/bin.rb