Sha256: ac4fcd48f9cfab967bedb19052580a3b2638a0d4130c0766694d39e5f122b7e0

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 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 :simpledb
          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, :simpledb, :storage]
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-0.3.0 lib/fog/aws/bin.rb