s3-publisher 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74b12809ccf5dbf9f093060d0ebc757f2172bef9
4
- data.tar.gz: 1240b82b8ed5e2ca03c080a6ecef4db9d001918e
3
+ metadata.gz: 8fc82eff74432725aca8f1e9b71511b3f50a63b6
4
+ data.tar.gz: 1f89bd16fadc608257fd4d58fa6ab28cbfb90f5c
5
5
  SHA512:
6
- metadata.gz: 5e371b7036db4ba29b7f427f554278295b2e8d5f71d965ee098d950cbfc7d602b01ec8b6e6bda6706e2012666fb1909414a1caa70f46d9eb665fb6a62504ed7c
7
- data.tar.gz: 1f591f7bb9c9c7d03af1448bb3491a21512df1b27efb0e8ada7b5c41f8e1b43f076564a9204f491d0bc8a625fdec084eeeec3e6ce17c16dd25d8e9efbb8247b8
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "s3-publisher"
5
- s.version = "2.0.1"
5
+ s.version = "2.0.2"
6
6
  s.authors = ["Ben Koski"]
7
7
  s.email = "bkoski@nytimes.com"
8
8
  s.summary = "Publish data to S3 for the world to see"
@@ -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.1
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: 2016-08-10 00:00:00.000000000 Z
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.5.1
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