Sha256: b348d6876918a4abb96c666a53f20106412dea6037d28f3b0aa12294fb959a47

Contents?: true

Size: 412 Bytes

Versions: 37

Compression:

Stored size: 412 Bytes

Contents

require 'pathname'

module Opsicle
  class S3Bucket
    attr_reader :bucket

    def initialize(client, bucket_name)
      @bucket = Aws::S3::Bucket.new(name: bucket_name, client: client.s3)
      raise UnknownBucket unless @bucket.exists?
    end

    def update(object)
      obj = bucket.object(object)
      obj.upload_file(Pathname.new(object))
    end
  end

  UnknownBucket = Class.new(StandardError)
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
opsicle-2.15.0 lib/opsicle/s3_bucket.rb
opsicle-2.14.2 lib/opsicle/s3_bucket.rb
opsicle-2.14.1 lib/opsicle/s3_bucket.rb
opsicle-2.14.0 lib/opsicle/s3_bucket.rb
opsicle-2.13.1 lib/opsicle/s3_bucket.rb
opsicle-2.13.0 lib/opsicle/s3_bucket.rb
opsicle-2.12.5 lib/opsicle/s3_bucket.rb
opsicle-2.12.3 lib/opsicle/s3_bucket.rb
opsicle-2.12.2 lib/opsicle/s3_bucket.rb
opsicle-2.12.1 lib/opsicle/s3_bucket.rb
opsicle-2.12.0 lib/opsicle/s3_bucket.rb
opsicle-2.11.3 lib/opsicle/s3_bucket.rb
opsicle-2.11.1 lib/opsicle/s3_bucket.rb
opsicle-2.11.0 lib/opsicle/s3_bucket.rb
opsicle-2.10.1 lib/opsicle/s3_bucket.rb
opsicle-2.10.0 lib/opsicle/s3_bucket.rb
opsicle-2.9.6 lib/opsicle/s3_bucket.rb
opsicle-2.9.4 lib/opsicle/s3_bucket.rb
opsicle-2.9.3 lib/opsicle/s3_bucket.rb
opsicle-2.9.2 lib/opsicle/s3_bucket.rb