bestchange 1.2 → 1.3

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
  SHA256:
3
- metadata.gz: 922d13f47b2680219ff827c355dc2246e1c27c6daa66705df6eb695e228d0695
4
- data.tar.gz: 5c9558204d44353fd6d914aaf09e3120085dcb7e34056545a295c6f999e8a207
3
+ metadata.gz: 1d6a02d56b4b2a21310cec76c34b7b35565953193839cd881e601a8793713da9
4
+ data.tar.gz: 79f74ffaad6279e4786bf0feb0c6adf0cf2cde65ae219a4831290460aa0b968f
5
5
  SHA512:
6
- metadata.gz: 4e4f8b830c30957fd2d8121ca0427973add275fcd39057c763011797385a9323fff050aa5d9440953fe6fda57242b97cb5dcfa164d475f5e7f907a73659ba0f3
7
- data.tar.gz: f36984333bed6de0df9bcf056db63abcc6ec1e2f1d3540278c3d5430a8b10e056304a5137a616c50a7eb6a6c7e8ba83d0aa442188e7fa4d552be0611ac272213
6
+ metadata.gz: 9390b359cafddf3c1f1cda493f47a0e6a3723575dc049b4e1f037795677d2f474d93163195e8e0c9ea56ec78c88d5b976c5bc315640aef2261440879cb7e6f54
7
+ data.tar.gz: 0f0b6ba210438209fddbece962396ecc7336c48b509d834e974fc0ff1ec0049260258294e5655d1514f1bae42746f5e357aeec223cbf3b8f1f3e3966d545229e
data/.rubocop.yml CHANGED
@@ -3,4 +3,4 @@ AllCops:
3
3
  Style/Documentation:
4
4
  Enabled: false
5
5
  Metrics/MethodLength:
6
- Max: 15
6
+ Max: 20
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change log
2
2
 
3
+ ## [1.3]
4
+ Add on_extract callback support to ZipExtractor initializer
5
+
3
6
  ## [1.2]
4
7
  Add base connection, request constants
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bestchange (1.2)
4
+ bestchange (1.3)
5
5
  rubyzip (= 2.3.2)
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bestchange
4
- VERSION = '1.2'
4
+ VERSION = '1.3'
5
5
  end
@@ -4,8 +4,9 @@ require 'zip'
4
4
 
5
5
  module Bestchange
6
6
  class ZipExtractor
7
- def initialize(zip_file)
7
+ def initialize(zip_file, on_extract: nil)
8
8
  @zip_file = zip_file
9
+ @on_extract = on_extract
9
10
  end
10
11
 
11
12
  def call(filename)
@@ -14,6 +15,7 @@ module Bestchange
14
15
  Zip::File.open(@zip_file) do |zip_file|
15
16
  entry = zip_file.find_entry(filename)
16
17
 
18
+ @on_extract&.call(entry)
17
19
  entry.extract(tempfile) { true }
18
20
  end
19
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bestchange
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: '1.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Karpinovsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-08 00:00:00.000000000 Z
11
+ date: 2023-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip