File tree Expand file tree Collapse file tree 4 files changed +78
-20
lines changed
Expand file tree Collapse file tree 4 files changed +78
-20
lines changed Original file line number Diff line number Diff line change 1+ # AWS Ruby SDK
2+
3+ import CodeBlock from " @theme/CodeBlock" ;
4+
5+ This guide assumes that you have followed the steps in the
6+ [ Getting Started] ( /docs/get-started/index.md ) guide, and have the access keys
7+ available.
8+
9+ You may continue to use the AWS Ruby SDK as you normally would, but with the
10+ endpoint set to ` https://fly.storage.tigris.dev ` .
11+
12+ This example uses the [ AWS Ruby SDK v3] ( https://github.com/aws/aws-sdk-ruby ) and
13+ reads the default credentials file or the environment variables
14+ ` AWS_ACCESS_KEY_ID ` and ` AWS_SECRET_ACCESS_KEY ` .
15+
16+ import Gemfile from " !!raw-loader!../../../examples/ruby/Gemfile" ;
17+
18+ <CodeBlock language = " ruby" >{ Gemfile } </CodeBlock >
19+
20+ Then you can use the SDK as you normally would, but with the endpoint set to
21+ ` https://fly.storage.tigris.dev ` .
22+
23+ import gettingStarted from " !!raw-loader!../../../examples/ruby/getting_started.rb" ;
24+
25+ <CodeBlock language = " ruby" >{ gettingStarted } </CodeBlock >
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ source "https://rubygems.org"
4+
5+ gem 'nokogiri' , '~> 1.11'
6+ # highlight-start
7+ gem 'aws-sdk-s3' , '~> 1'
8+ # highlight-end
Original file line number Diff line number Diff line change 1+ GEM
2+ remote: https://rubygems.org/
3+ specs:
4+ aws-eventstream (1.3.0 )
5+ aws-partitions (1.1048.0 )
6+ aws-sdk-core (3.218.1 )
7+ aws-eventstream (~> 1 , >= 1.3.0 )
8+ aws-partitions (~> 1 , >= 1.992.0 )
9+ aws-sigv4 (~> 1.9 )
10+ base64
11+ jmespath (~> 1 , >= 1.6.1 )
12+ aws-sdk-kms (1.98.0 )
13+ aws-sdk-core (~> 3 , >= 3.216.0 )
14+ aws-sigv4 (~> 1.5 )
15+ aws-sdk-s3 (1.180.0 )
16+ aws-sdk-core (~> 3 , >= 3.216.0 )
17+ aws-sdk-kms (~> 1 )
18+ aws-sigv4 (~> 1.5 )
19+ aws-sigv4 (1.11.0 )
20+ aws-eventstream (~> 1 , >= 1.0.2 )
21+ base64 (0.2.0 )
22+ jmespath (1.6.2 )
23+ mini_portile2 (2.8.8 )
24+ nokogiri (1.18.2 )
25+ mini_portile2 (~> 2.8.2 )
26+ racc (~> 1.4 )
27+ nokogiri (1.18.2-arm64-darwin )
28+ racc (~> 1.4 )
29+ racc (1.8.1 )
30+
31+ PLATFORMS
32+ arm64-darwin-24
33+ ruby
34+
35+ DEPENDENCIES
36+ aws-sdk-s3 (~> 1 )
37+ nokogiri (~> 1.11 )
38+
39+ BUNDLED WITH
40+ 2.6.2
Original file line number Diff line number Diff line change 1- # AWS Ruby SDK
1+ require "aws-sdk-s3"
22
3- This guide assumes that you have followed the steps in the
4- [ Getting Started] ( /docs/get-started/index.md ) guide, and have the access keys
5- available.
6-
7- You may continue to use the AWS Ruby SDK as you normally would, but with the
8- endpoint set to ` https://fly.storage.tigris.dev ` .
9-
10- This example uses the [ AWS Ruby SDK v3] ( https://github.com/aws/aws-sdk-ruby ) and
11- reads the default credentials file or the environment variables
12- ` AWS_ACCESS_KEY_ID ` and ` AWS_SECRET_ACCESS_KEY ` .
13-
14- ``` ruby
15- require " aws-sdk"
16-
17- bucket_name = " foo-bucket"
3+ bucket_name = "tigris-example"
184
195s3 = Aws ::S3 ::Client . new (
206 region : "auto" ,
3016end
3117
3218# List the first ten objects in the bucket
33- resp = s3.list_objects(bucket: ' foo-bucket ' , max_keys: 10 )
19+ resp = s3 . list_objects ( bucket : bucket_name , max_keys : 10 )
3420resp . contents . each do |object |
3521 puts "#{ object . key } => #{ object . etag } "
3622end
4127 s3 . put_object (
4228 bucket : bucket_name ,
4329 key : file_name ,
44- body: File .read(" bar.txt " )
30+ body : File . read ( "getting_started.rb " )
4531 )
4632 puts "Uploaded #{ file_name } to #{ bucket_name } ."
4733rescue Exception => e
4834 puts "Failed to upload #{ file_name } with error: #{ e . message } "
4935 exit "Please fix error with file upload before continuing."
50- end
51- ```
36+ end
You can’t perform that action at this time.
0 commit comments