Sha256: df0c39a8f66ec37291d7265adc77bb42e2bb27c70d56fa0b01242a3b3abd3882

Contents?: true

Size: 492 Bytes

Versions: 3

Compression:

Stored size: 492 Bytes

Contents

require 'fog'

module Adhoq
  module Storage
    class S3 < FogStorage
      def initialize(bucket, s3_options = {})
        @bucket = bucket
        @s3     = Fog::Storage.new({provider: 'AWS'}.merge(s3_options))
      end

      def identifier
        "s3://#{@bucket}"
      end

      private

      def directory
        return @directory if @directory

        @directory = @s3.directories.get(@bucket) || @s3.directories.create(key: @bucket, public: false)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adhoq-0.0.5 lib/adhoq/storage/s3.rb
adhoq-0.0.4 lib/adhoq/storage/s3.rb
adhoq-0.0.3 lib/adhoq/storage/s3.rb