Skip to content

Instantly share code, notes, and snippets.

@masui
Created March 22, 2012 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masui/2165433 to your computer and use it in GitHub Desktop.
Save masui/2165433 to your computer and use it in GitHub Desktop.
RubyでAmazon S3アクセス
require 'rubygems'
require 'aws/s3'
include AWS::S3
Base.establish_connection!(
:access_key_id => 'ABCDEFG',
:secret_access_key => 'abcdefg'
)
DEFAULT_HOST.replace "s3-ap-northeast-1.amazonaws.com" # 東京を指定
# buckets = Service.buckets
b = Bucket.find('backup.pitecan.com')
b.each { |obj|
p obj
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment