Sha256: 1466d2f80b2d6ccc43970fd7ab43e3996e9da727243d8172d6564ff1792499b3

Contents?: true

Size: 584 Bytes

Versions: 1

Compression:

Stored size: 584 Bytes

Contents

# S3 (http://amazon.rubyforge.org/)
UTILITY_BELT_IRB_STARTUP_PROCS[:define_s3_convenience_methods] = lambda do
  require 'aws/s3'
  def aws_upload(bucket,filename)
    AWS::S3::Base.establish_connection!(:access_key_id => ENV['AMAZON_ACCESS_KEY_ID'], 
                                        :secret_access_key => ENV['AMAZON_SECRET_ACCESS_KEY'])
    AWS::S3::S3Object.store(filename, open(filename), bucket, :access => :public_read)
    url = "http://s3.amazonaws.com/#{bucket}/#{filename}".gsub(/ /, "%20")
    MacClipboard.write(url) if :macosx == Platform::IMPL
    url
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
utility_belt-1.0.0 lib/amazon_upload_shortcut.rb