relaton 1.9.2 → 1.9.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: 00617ed8db3b679a9c44d7b8854b17c16d48f10b84a30bbc2e175113d02e9025
4
- data.tar.gz: 198a87943ebe8f2ffdeabfc0c1ec12a9499ec9642d90ca393a8c26440f3acf3f
3
+ metadata.gz: a3599c52bacdd454603dc095055338b4a89b8264ee9391fa2a2b25f1724a46e2
4
+ data.tar.gz: aa64435911173af46c12a522b05d063c4cfa0644f1919c96ec3879f9b8f9af39
5
5
  SHA512:
6
- metadata.gz: 2bf33ca669f3b719eea8e9add8a107e9f54e86ffcfda53d3845fe5dd109f08cde651b08024dda622f5d3438f8dce51d142c8b1f886e5b45b7ef481242b9212ea
7
- data.tar.gz: bf242855dfb87ff3920907cf69616b2831c8ce35e65342327d0cfee3182b252bbceca244fbd30cdb097f09befc90769c9c4b72847b52cea852ddd3dc9c2d7441
6
+ metadata.gz: 74fc610b35697515cf2f925349ff9ad076c50a3ec8e0fa08a9cbfa3fc82217c32b2f5e2869af604a58e12f70898de41addade73971a6fae9085b56eb7b3b5ff0
7
+ data.tar.gz: 8cda3116f9e84eb3f549dc1a4c5a74fb6957d4834d0cf140f587434f2b9ff84e7cae93946147b7151fa6cf1739f13aba1639f92c2f73fce552999e3a7dfe35fd
data/docs/README.adoc CHANGED
@@ -187,8 +187,8 @@ refs = ["ISO 19011", "ISO 19115"]
187
187
 
188
188
  # fetch documents
189
189
  refs.each do |ref|
190
- db.fetch_async(ref, ref: ref) do |doc, other_args|
191
- results << [doc, other_args[:ref]]
190
+ db.fetch_async(ref) do |doc|
191
+ results << [doc, ref]
192
192
  end
193
193
  end
194
194
 
data/lib/relaton/db.rb CHANGED
@@ -99,20 +99,20 @@ module Relaton
99
99
  end
100
100
 
101
101
  # Fetch asynchronously
102
- def fetch_async(code, year = nil, opts = {}, **others, &_block) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
102
+ def fetch_async(code, year = nil, opts = {}, &block) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
103
103
  stdclass = standard_class code
104
104
  if stdclass
105
105
  unless @queues[stdclass]
106
106
  processor = @registry.processors[stdclass]
107
107
  wp = WorkersPool.new(processor.threads) do |args|
108
- yield fetch(*args[0..2]), **args[3]
108
+ args[3].call fetch(*args[0..2])
109
109
  rescue RelatonBib::RequestError => e
110
- yield e, **args[3]
110
+ args[3].call e
111
111
  end
112
112
  @queues[stdclass] = { queue: Queue.new, workers_pool: wp }
113
113
  Thread.new { process_queue @queues[stdclass] }
114
114
  end
115
- @queues[stdclass][:queue] << [code, year, opts, others]
115
+ @queues[stdclass][:queue] << [code, year, opts, block]
116
116
  else yield nil
117
117
  end
118
118
  end
@@ -1,3 +1,3 @@
1
1
  module Relaton
2
- VERSION = "1.9.2".freeze
2
+ VERSION = "1.9.3".freeze
3
3
  end
@@ -163,8 +163,8 @@ RSpec.describe Relaton::Db do
163
163
  results = []
164
164
  VCR.use_cassette "async_fetch", match_requests_on: %i[method uri body] do
165
165
  refs.each do |ref|
166
- db.fetch_async(ref, ref: ref) do |r, otherargs|
167
- queue << [r, otherargs[:ref]]
166
+ db.fetch_async(ref) do |r|
167
+ queue << [r, ref]
168
168
  end
169
169
  end
170
170
  Timeout.timeout(60) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-01 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: relaton-bipm