s3-publisher 2.0.0 → 2.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c5f5fd908bd87713d65bad6e7429c1090284f35
4
- data.tar.gz: d58aabf2f780673028dd3b5e342dbba86aa00b21
3
+ metadata.gz: 74b12809ccf5dbf9f093060d0ebc757f2172bef9
4
+ data.tar.gz: 1240b82b8ed5e2ca03c080a6ecef4db9d001918e
5
5
  SHA512:
6
- metadata.gz: 5281ecababe99562e4795a2f13072ec5791ba8c0a74f6087a5a298a844c8251208ddd3d3ce2d63779fbc92fa80059339b4e8283b43c4775ec8538e897ea0575f
7
- data.tar.gz: 55284b8a3218c84982ad925297cd5fefd9d7d4a7bb59018c883622bf7a73611033cfcabf3286eb31faf34398492d5ffa86a684e45f7d381fbb6f7fe1f4880fa3
6
+ metadata.gz: 5e371b7036db4ba29b7f427f554278295b2e8d5f71d965ee098d950cbfc7d602b01ec8b6e6bda6706e2012666fb1909414a1caa70f46d9eb665fb6a62504ed7c
7
+ data.tar.gz: 1f591f7bb9c9c7d03af1448bb3491a21512df1b27efb0e8ada7b5c41f8e1b43f076564a9204f491d0bc8a625fdec084eeeec3e6ce17c16dd25d8e9efbb8247b8
data/lib/s3-publisher.rb CHANGED
@@ -121,10 +121,13 @@ class S3Publisher
121
121
  begin
122
122
  gzip = item[:gzip] != false && !item[:write_opts][:content_type].match('image/')
123
123
 
124
+ if item[:contents].is_a?(Pathname)
125
+ item[:contents] = item[:contents].read
126
+ end
127
+
124
128
  if gzip
125
129
  item[:write_opts][:content_encoding] = 'gzip'
126
- gzip_body = item[:contents].is_a?(Pathname) ? item[:contents].read : item[:contents]
127
- item[:contents] = gzip(gzip_body)
130
+ item[:contents] = gzip(item[:contents])
128
131
  end
129
132
 
130
133
  write_opts = {
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.0"
5
+ s.version = "2.0.1"
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"
@@ -42,7 +42,7 @@ describe S3Publisher do
42
42
  end
43
43
 
44
44
  describe ":file opt" do
45
- it "queues files as a pathname to be read if gzip is false" do
45
+ it "queues contents of files if gzip is false" do
46
46
  set_put_expectation(file: __FILE__)
47
47
  push_test_data('myfile.txt', file: __FILE__, gzip: false)
48
48
  end
@@ -102,7 +102,7 @@ describe S3Publisher do
102
102
  if opts[:data]
103
103
  expected_contents = opts[:data]
104
104
  elsif opts[:file]
105
- expected_contents = Pathname.new(opts[:file])
105
+ expected_contents = Pathname.new(opts[:file]).read
106
106
  else
107
107
  expected_contents = anything
108
108
  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.0
4
+ version: 2.0.1
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-03-23 00:00:00.000000000 Z
11
+ date: 2016-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk