bestchange-api 0.6 → 0.7

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: f8da60c9f91d2fac5ff9899af64181c5715b668baa92dd5789dfcf508a92a286
4
- data.tar.gz: c8259d19fd314094146ad62d60507ca4eb3279af5d481105fb6e57aac929dd57
3
+ metadata.gz: a4519573ffcd91610bf68a30544ebd17c00506ab8c052b5412b74ff348f07d8a
4
+ data.tar.gz: c6e1e36c2ed0d7c35a374e00576c8c5de2f433e86edb986a0ceaf5e17a04e167
5
5
  SHA512:
6
- metadata.gz: 3fc1081e2b6e436b0fc1659dae92a3c48396d51ee562310d6a0433979a576e173c7025fa19aed0b3941a020e889a26f4beef94b13c68af6cad27ef43bcee3b50
7
- data.tar.gz: 5c891ca4e54319a4a542472daea41fcf00d349f5c4e130854e9650259029c04f31a1ca375ccb9d2fab1156dd1c114235e166db240fca0eae8726bfc58601dcdb
6
+ metadata.gz: 8677e25eb2333d11e437e0b06eb64bcc122994b12fba0b81693e10dee37a6f31ce71d47a3f124929dafd865d72280db7e37df2c3109c7f0c4d2231c7b7d89c84
7
+ data.tar.gz: 5459ab729ad2777e2981b8ba1b55fd37a88a8720d85ddbf18167dcb2587c095b0c5ba6e85f1a2583cad53446545ad569e77fcbc53491f71134cc53d867285e02
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change log
2
2
 
3
+ ## [0.7]
4
+ Small improvements
5
+
3
6
  ## [0.6]
4
7
  Pass zip entry via before_extract block
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bestchange-api (0.5)
4
+ bestchange-api (0.7)
5
5
  rubyzip (= 2.3.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  # bestchange-api
3
2
 
4
3
  bestchange-api is a simple library for getting data from Bestchange aggregator
@@ -20,11 +20,8 @@ module Bestchange
20
20
 
21
21
  def fetch_files(filenames, &before_extract)
22
22
  response = make_request
23
-
24
- archive = Tempfile.new(ARCHIVE_DATA_FILENAME, encoding: ARCHIVE_DATA_ENCODING)
25
- archive.write(response)
26
-
27
- extract_files('info.zip', filenames, &before_extract)
23
+ archive = make_archive(response)
24
+ extract_files(archive, filenames, &before_extract)
28
25
  ensure
29
26
  archive.close if defined?(archive)
30
27
  end
@@ -33,6 +30,12 @@ module Bestchange
33
30
  Net::HTTP.get(URI(BASE_URI))
34
31
  end
35
32
 
33
+ def make_archive(response)
34
+ archive = Tempfile.new(ARCHIVE_DATA_FILENAME, encoding: ARCHIVE_DATA_ENCODING)
35
+ archive.write(response)
36
+ archive
37
+ end
38
+
36
39
  def extract_files(archive, filenames, &before_extract)
37
40
  Zip::File.open(archive) do |zip_file|
38
41
  filenames.map do |filename|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bestchange
4
- VERSION = '0.6'
4
+ VERSION = '0.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bestchange-api
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Karpinovsky