simple-s3 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +4 -0
- data/lib/simple-s3/simple-s3.rb +4 -3
- data/lib/simple-s3/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
A super simple uploader for S3 using Ruby.
|
4
4
|
|
5
|
+
## *Updates*
|
6
|
+
- Added the `s3_bucket_endpoint` configuration parameter to suit S3 buckets that are not in the standard US zone
|
7
|
+
|
5
8
|
## Installation
|
6
9
|
|
7
10
|
Install as a gem using `gem install simple-s3` or place a `Gemfile` within your website directory with the following info:
|
@@ -22,6 +25,7 @@ s3_bucket: '...'
|
|
22
25
|
s3_access_key: '...'
|
23
26
|
s3_secret_key: '...'
|
24
27
|
cloudfront_distribution_id: '...' # (optional)
|
28
|
+
s3_bucket_endpoint: '...' # (set this if you're not in the standard US zone)
|
25
29
|
```
|
26
30
|
|
27
31
|
And then run the command `simple-s3` from the command line within the same directory where your simple-s3.yml file is saved.
|
data/lib/simple-s3/simple-s3.rb
CHANGED
@@ -25,8 +25,8 @@ class SimpleS3
|
|
25
25
|
self.config['s3_bucket']
|
26
26
|
end
|
27
27
|
|
28
|
-
def self.
|
29
|
-
self.config['
|
28
|
+
def self.s3_bucket_endpoint
|
29
|
+
self.config['s3_bucket_endpoint']
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.cloudfront_distribution_id
|
@@ -69,8 +69,9 @@ class SimpleS3
|
|
69
69
|
metadata = config['metadata'] || {}
|
70
70
|
metadata[:access] ||= 'public-read'
|
71
71
|
|
72
|
-
endpoint = self.
|
72
|
+
endpoint = self.s3_bucket_endpoint.to_s
|
73
73
|
if endpoint.length > 0
|
74
|
+
puts "Simple-S3: Changing the bucket endpoint to: '#{endpoint}'"
|
74
75
|
AWS::S3::DEFAULT_HOST.replace(endpoint)
|
75
76
|
end
|
76
77
|
|
data/lib/simple-s3/version.rb
CHANGED