Sha256: 7242be7ca6480ca36bf27a7b41cd109beac2e7ee076fb62b239acea2b9107ee7
Contents?: true
Size: 841 Bytes
Versions: 4
Compression:
Stored size: 841 Bytes
Contents
# S3 (http://amazon.rubyforge.org/) UTILITY_BELT_IRB_STARTUP_PROCS[:define_s3_convenience_methods] = lambda do %w{aws/s3 cgi}.each {|lib| require lib} 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 # a quick note: the "google" command uses CGI.escape, but the URLs produced by CGI.escape # don't seem to succeed here, in practice. this may differ by OS and/or browser. Let me # know if you see something weird -- gilesb@gmail.com.
Version data entries
4 entries across 4 versions & 1 rubygems