Sha256: f4983d87f886d8d1d1523122d866c1df6bbfbe3ba67b61fb7182c59aac4b3833

Contents?: true

Size: 991 Bytes

Versions: 3

Compression:

Stored size: 991 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_object(bucket_name, object_name)
        @s3.get_object(bucket_name, object_name).body
      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.3 lib/heirloom/aws/s3.rb
heirloom-0.1.2 lib/heirloom/aws/s3.rb
heirloom-0.1.1 lib/heirloom/aws/s3.rb