zipline 1.3.0 → 1.3.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 +4 -4
- data/lib/zipline/version.rb +1 -1
- data/lib/zipline/zip_generator.rb +1 -1
- data/spec/lib/zipline/zip_generator_spec.rb +24 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 235a7a580ab0b56077afa5988027ff16a1aa35d2ea786bd4898667be9a8e1fbf
|
4
|
+
data.tar.gz: e47202054d22fb3ee17f5654b96f3c57459a3d74d5909054a33daf04d81daff5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aa960fbfb21cae472a07be2526723c8e2a65b36b58f3f058155284a7fc05447af5bba1e9fa4ea07e1a782c87cc66e264822b20d2b1ec810df90826435935d7d
|
7
|
+
data.tar.gz: f0847312034235655413363adbb8f7547c32040df71cf61a10bbed8977c215c38d40652552ca0ab0887e4f2c87df7528fb3f38f6783defd631d19d30f5e70572
|
data/lib/zipline/version.rb
CHANGED
@@ -80,7 +80,7 @@ module Zipline
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def write_file(streamer, file, name, options)
|
83
|
-
streamer.write_deflated_file(name, options) do |writer_for_file|
|
83
|
+
streamer.write_deflated_file(name, **options.slice(:modification_time)) do |writer_for_file|
|
84
84
|
if file[:url]
|
85
85
|
the_remote_uri = URI(file[:url])
|
86
86
|
|
@@ -199,7 +199,7 @@ describe Zipline::ZipGenerator do
|
|
199
199
|
it 'passes a string as filename to ZipTricks' do
|
200
200
|
allow(file).to receive(:url).and_return('fakeurl')
|
201
201
|
expect_any_instance_of(ZipTricks::Streamer).to receive(:write_deflated_file)
|
202
|
-
.with('test'
|
202
|
+
.with('test')
|
203
203
|
generator.each { |_| 'Test' }
|
204
204
|
end
|
205
205
|
end
|
@@ -220,7 +220,7 @@ describe Zipline::ZipGenerator do
|
|
220
220
|
generator.each { |_| 'Test' }
|
221
221
|
end
|
222
222
|
|
223
|
-
it 'passes the options hash to ZipTricks' do
|
223
|
+
it 'passes the options hash to ZipTricks as kwargs' do
|
224
224
|
allow(file).to receive(:url).and_return('fakeurl')
|
225
225
|
expect_any_instance_of(ZipTricks::Streamer).to receive(:write_deflated_file)
|
226
226
|
.with(anything, modification_time: mtime)
|
@@ -239,10 +239,30 @@ describe Zipline::ZipGenerator do
|
|
239
239
|
generator.each { |_| 'Test' }
|
240
240
|
end
|
241
241
|
|
242
|
-
it 'passes the options hash to ZipTricks' do
|
242
|
+
it 'passes the options hash to ZipTricks as kwargs' do
|
243
243
|
allow(file).to receive(:url).and_return('fakeurl')
|
244
244
|
expect_any_instance_of(ZipTricks::Streamer).to receive(:write_deflated_file)
|
245
|
-
.with(anything
|
245
|
+
.with(anything)
|
246
|
+
generator.each { |_| 'Test' }
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
context 'with extra invalid options' do
|
251
|
+
let(:mtime) { 1.day.ago }
|
252
|
+
let(:generator) do
|
253
|
+
Zipline::ZipGenerator.new([[file, 'test', modification_time: mtime, extra: 'invalid']])
|
254
|
+
end
|
255
|
+
|
256
|
+
it 'passes the whole options hash through handle_file' do
|
257
|
+
expect(generator).to receive(:handle_file)
|
258
|
+
.with(anything, anything, anything, { modification_time: mtime, extra: 'invalid' })
|
259
|
+
generator.each { |_| 'Test' }
|
260
|
+
end
|
261
|
+
|
262
|
+
it 'only passes the kwargs to ZipTricks that it expects (i.e., :modification_time)' do
|
263
|
+
allow(file).to receive(:url).and_return('fakeurl')
|
264
|
+
expect_any_instance_of(ZipTricks::Streamer).to receive(:write_deflated_file)
|
265
|
+
.with(anything, modification_time: mtime)
|
246
266
|
generator.each { |_| 'Test' }
|
247
267
|
end
|
248
268
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zipline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ram Dobson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|