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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8de63c7a8518461b8fdbb249ce857b3f06ffc2bf3a7de69d6d5d6c5111f75015
4
- data.tar.gz: edfc26eed9a1d52987a4d47330a015d2ebb0e3129f2c0791199a51b3b5abec70
3
+ metadata.gz: 235a7a580ab0b56077afa5988027ff16a1aa35d2ea786bd4898667be9a8e1fbf
4
+ data.tar.gz: e47202054d22fb3ee17f5654b96f3c57459a3d74d5909054a33daf04d81daff5
5
5
  SHA512:
6
- metadata.gz: cc54e592ebd7c24cad03669786938a3662430389e81322ceef258898ec5d8e9949db956a7433ab7c4d139b4671100772c062c525f8d20b6782f3a221b80ea9f3
7
- data.tar.gz: 2482828adb931c9630c209b7a9a06c913b43d577232dea8d877b88acb1fa3b60834c35a92175608610da0d7e80ad36d6a1f8cd2379b9af5a249ce2b1f7456990
6
+ metadata.gz: 7aa960fbfb21cae472a07be2526723c8e2a65b36b58f3f058155284a7fc05447af5bba1e9fa4ea07e1a782c87cc66e264822b20d2b1ec810df90826435935d7d
7
+ data.tar.gz: f0847312034235655413363adbb8f7547c32040df71cf61a10bbed8977c215c38d40652552ca0ab0887e4f2c87df7528fb3f38f6783defd631d19d30f5e70572
@@ -1,3 +1,3 @@
1
1
  module Zipline
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -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.0
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-01-25 00:00:00.000000000 Z
11
+ date: 2021-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack