Sha256: 0156932d1cf17e786f83aa4905f6bb7a4d5f5a5ad5a4ddfd8fae4f24ec7ffc3d

Contents?: true

Size: 879 Bytes

Versions: 3

Compression:

Stored size: 879 Bytes

Contents

require 'fog'

module Heirloom
  module AWS
    class S3

      def initialize(args)
        @config = args[:config]
        @region = args[:region]

        @s3 = Fog::Storage.new :provider                 => 'AWS',
                               :aws_access_key_id        => @config.access_key,
                               :aws_secret_access_key    => @config.secret_key,
                               :region                   => @region
      end

      def delete_object(bucket_name, object_name, options = {})
        @s3.delete_object(bucket_name, object_name, options = {})
      end

      def get_bucket(bucket)
        @s3.directories.get bucket
      end

      def get_bucket_acl(bucket)
        @s3.get_bucket_acl(bucket).body
      end

      def put_object_acl(bucket, key, grants)
        @s3.put_object_acl(bucket, key, grants)
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
heirloom-0.1.0 lib/heirloom/aws/s3.rb
heirloom-0.0.9 lib/heirloom/aws/s3.rb
heirloom-0.0.8 lib/heirloom/aws/s3.rb