Sha256: ec0711f977855cd8fd2a4eae7f367d0813f3a2cabe1b108509018f46115b7b53

Contents?: true

Size: 612 Bytes

Versions: 1

Compression:

Stored size: 612 Bytes

Contents

module AWSS3Methods
  def load_s3
    begin
      require 'aws/s3'
    rescue LoadError => e
      fail "You do not have aws-s3 installed."
    end
  end

  def assert_credentials(key, secret)
    load_s3
    begin
      AWS::S3::Base.establish_connection!(
        :access_key_id => key,
        :secret_access_key => secret
      )
      AWS::S3::Service.buckets
    rescue AWS::S3::ResponseError => e
      fail "Could not connect using AWS credentials in AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. " +
           "Please make sure these are set in your environment."
    end
  end
end

World(AWSS3Methods)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smarter_paperclip-0.3.0 features/support/s3.rb