Sha256: 22e722a4970ce5ef1017cbff8a59e3ced2d2a06ed065e3b857744f322ddf0296

Contents?: true

Size: 1.19 KB

Versions: 17

Compression:

Stored size: 1.19 KB

Contents

class AWS < Fog::Bin
  class << self

    def [](service)
      @@connections ||= Hash.new do |hash, key|
        hash[key] = case key
        when :cdn
          Fog::AWS::CDN.new
        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 :iam
          Fog::AWS::IAM.new
        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
      [:cdn, :compute, :elb, :iam, :sdb, :storage]
    end

  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
fog-0.3.29 lib/fog/aws/bin.rb
fog-0.3.28 lib/fog/aws/bin.rb
fog-0.3.27 lib/fog/aws/bin.rb
fog-0.3.26 lib/fog/aws/bin.rb
fog-0.3.25 lib/fog/aws/bin.rb
fog-0.3.24 lib/fog/aws/bin.rb
bbcloud-0.8.1 lib/bbcloud/vendor/fog-0.3.23/lib/fog/aws/bin.rb
fog-0.3.23 lib/fog/aws/bin.rb
fog-0.3.22 lib/fog/aws/bin.rb
fog-0.3.21 lib/fog/aws/bin.rb
fog-0.3.20 lib/fog/aws/bin.rb
fog-0.3.19 lib/fog/aws/bin.rb
fog-0.3.18 lib/fog/aws/bin.rb
fog-0.3.17 lib/fog/aws/bin.rb
fog-0.3.16 lib/fog/aws/bin.rb
fog-0.3.15 lib/fog/aws/bin.rb
fog-0.3.14 lib/fog/aws/bin.rb