Sha256: 6dd702207bb2b657cea8a41ce20de65c59512ae3db37219feb27408f63b254bc

Contents?: true

Size: 632 Bytes

Versions: 31

Compression:

Stored size: 632 Bytes

Contents

module EbDeployer
  class S3Driver
    def create_bucket(bucket_name)
      buckets.create(bucket_name)
    end

    def bucket_exists?(bucket_name)
      buckets[bucket_name].exists?
    end

    def object_length(bucket_name, obj_name)
      obj(bucket_name, obj_name).content_length rescue nil
    end

    def upload_file(bucket_name, obj_name, file)
      o = obj(bucket_name, obj_name)
      File.open(file) { |f| o.write(f) }
    end

    private
    def s3
      AWS::S3.new
    end

    def obj(bucket_name, obj_name)
      buckets[bucket_name].objects[obj_name]
    end

    def buckets
      s3.buckets
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
eb_deployer-0.3.6 lib/eb_deployer/s3_driver.rb
eb_deployer-0.3.5 lib/eb_deployer/s3_driver.rb
eb_deployer-0.3.4 lib/eb_deployer/s3_driver.rb
eb_deployer-0.3.3 lib/eb_deployer/s3_driver.rb
eb_deployer-0.3.2 lib/eb_deployer/s3_driver.rb
eb_deployer-0.3.1 lib/eb_deployer/s3_driver.rb
eb_deployer-0.3.0 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.9 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.8 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.7 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.6 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.5 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.4 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.3 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.2 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.1 lib/eb_deployer/s3_driver.rb
eb_deployer-0.2.0 lib/eb_deployer/s3_driver.rb
eb_deployer-0.1.1 lib/eb_deployer/s3_driver.rb
eb_deployer-0.1.0 lib/eb_deployer/s3_driver.rb
eb_deployer-0.0.12 lib/eb_deployer/s3_driver.rb