Skip to content

Commit

Permalink
reverted usage in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Kuźma committed Jan 1, 2011
1 parent 5485bfe commit 4e67a7b
Showing 1 changed file with 45 additions and 7 deletions.
52 changes: 45 additions & 7 deletions README.textile
Expand Up @@ -6,12 +6,6 @@ It supports both: European and US buckets through "REST API":http://docs.amazonw

<a href="http://pledgie.com/campaigns/14173"><img alt="Click here to lend your support to: S3 and make a donation at www.pledgie.com!" src="http://pledgie.com/campaigns/14173.png?skin_name=chrome" border="0" /></a>

* "homepage":http://jah.pl/projects/s3.html
* "gemcutter":http://gemcutter.org/gems/s3
* "repository":http://github.com/qoobaa/s3
* "issue tracker":http://github.com/qoobaa/s3/issues
* "rdoc":http://qoobaa.github.com/s3

h2. Installation

<pre>
Expand All @@ -20,7 +14,51 @@ h2. Installation

h2. Usage

See "homepage":http://jah.pl/projects/s3.html for details.
<noscript><pre>
require "s3"
service = S3::Service.new(:access_key_id => "...",
:secret_access_key => "...")
#=> #<S3::Service:...>

service.buckets
#=> [#<S3::Bucket:first-bucket>,
# #<S3::Bucket:second-bucket>]

first_bucket = service.buckets.find("first-bucket")
#=> #<S3::Bucket:first-bucket>

first_bucket.objects
#=> [#<S3::Object:/first-bucket/lenna.png>,
# #<S3::Object:/first-bucket/lenna_mini.png>]

object = first_bucket.objects.find("lenna.png")
#=> #<S3::Object:/first-bucket/lenna.png>

object.content_type
#=> "image/png"

object.content
#=> "\x89PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00..."

object.destroy
#=> true

new_object = bucket.objects.build("bender.png")
#=> #<S3::Object:/synergy-staging/bender.png>

new_object.content = open("bender.png")

new_object.save
#=> true
</pre></noscript>
<script src="https://gist.github.com/755035.js?file=gistfile2.rb"></script>

h3. See also

* "gemcutter":http://gemcutter.org/gems/s3
* "repository":http://github.com/qoobaa/s3
* "issue tracker":http://github.com/qoobaa/s3/issues
* "documentation":http://qoobaa.github.com/s3

h2. Copyright

Expand Down

0 comments on commit 4e67a7b

Please sign in to comment.