s3-publisher 2.0.1 → 2.0.2
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.
- checksums.yaml +4 -4
- data/lib/s3-publisher.rb +6 -1
- data/s3-publisher.gemspec +1 -1
- data/spec/s3_publisher_spec.rb +15 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fc82eff74432725aca8f1e9b71511b3f50a63b6
|
4
|
+
data.tar.gz: 1f89bd16fadc608257fd4d58fa6ab28cbfb90f5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caca0cc392715d3ee125c5d045ebef55742833c0bd6d46d97244a6bf6c94e640b2fd64c5587e40e7f77c3cf984d3cd693ba2d4600f76bad01cd2da8ad9a0e19a
|
7
|
+
data.tar.gz: b38c67d3df7550cd05f5c93430702a7e15ea0119067efca159bd42eb1df668427bcae127d6fd55752eb7d3f1efcc8d9991d30785a43fc8caf2412907e0679ff3
|
data/lib/s3-publisher.rb
CHANGED
@@ -85,6 +85,11 @@ class S3Publisher
|
|
85
85
|
write_opts[:cache_control] = "max-age=#{opts[:ttl] || 5}"
|
86
86
|
end
|
87
87
|
|
88
|
+
# And ACL
|
89
|
+
if opts[:acl]
|
90
|
+
write_opts[:acl] = opts[:acl]
|
91
|
+
end
|
92
|
+
|
88
93
|
opts[:gzip] = true unless opts.has_key?(:gzip)
|
89
94
|
|
90
95
|
@publish_queue.push({ key_name: key_name, contents: contents, write_opts: write_opts, gzip: opts[:gzip] })
|
@@ -150,4 +155,4 @@ class S3Publisher
|
|
150
155
|
rescue ThreadError # ThreadError hit when queue is empty. Simply jump out of loop and return to join().
|
151
156
|
end
|
152
157
|
|
153
|
-
end
|
158
|
+
end
|
data/s3-publisher.gemspec
CHANGED
data/spec/s3_publisher_spec.rb
CHANGED
@@ -85,17 +85,29 @@ describe S3Publisher do
|
|
85
85
|
push_test_data('myfile.txt', data: '1234')
|
86
86
|
end
|
87
87
|
end
|
88
|
+
|
89
|
+
describe "acl" do
|
90
|
+
it "sets ACL to user-supplied string if :acl provided" do
|
91
|
+
set_put_expectation(acl: 'private')
|
92
|
+
push_test_data('myfile.txt', data: '1234', acl: 'private')
|
93
|
+
end
|
94
|
+
|
95
|
+
it "sets ACL to public-read when no option is provded" do
|
96
|
+
set_put_expectation(acl: 'public-read')
|
97
|
+
push_test_data('myfile.txt', data: '1234')
|
98
|
+
end
|
99
|
+
end
|
88
100
|
|
89
101
|
# Based on opts, sets expecations for AWS::S3Object.write
|
90
102
|
# Can provide expected values for:
|
91
103
|
# * :key_name
|
92
104
|
# * :data
|
93
|
-
# * :content_type, :cache_control, :content_encoding
|
105
|
+
# * :content_type, :cache_control, :content_encoding, :acl
|
94
106
|
def set_put_expectation opts
|
95
107
|
key_name = opts[:key_name] || 'myfile.txt'
|
96
108
|
|
97
109
|
expected_entries = {}
|
98
|
-
[:content_type, :cache_control, :content_encoding].each do |k|
|
110
|
+
[:content_type, :cache_control, :content_encoding, :acl].each do |k|
|
99
111
|
expected_entries[k] = opts[k] if opts.has_key?(k)
|
100
112
|
end
|
101
113
|
|
@@ -128,4 +140,4 @@ describe S3Publisher do
|
|
128
140
|
p.run
|
129
141
|
end
|
130
142
|
end
|
131
|
-
end
|
143
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3-publisher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Koski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.6.12
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Publish data to S3 for the world to see
|