relaton 1.12.1 → 1.12.2

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: 8299cf7ea6a28e344f438461d16233fe9acd733bc00441583ce9768c702b15fa
4
- data.tar.gz: 28d87384bb3b763981ae98902b144236254b7cce20c3d608ef746be679b0661a
3
+ metadata.gz: 9d1245a5e26b3bf22fef51b47397cf229876b56e026e1342a80e3da129c44fad
4
+ data.tar.gz: d13c8549f75408f841ed17f6781d7b33b6cd94586b6e8775928481a045b5c0c1
5
5
  SHA512:
6
- metadata.gz: 5720aed26b5585b6673d92fd8c99fbae0883689c254344d5dbad5549a157388bd6422a2550942eb58a8d32f1c2d0aeafd6485de55274c0c02271ec5f87661405
7
- data.tar.gz: 45fca34e30fe15699b9b3933f4060c877d54947ae31c5bc70ff05812b654c0876175eedda1d71ef16755a4db02a797c30199cd2128d081ae46b186a4939964f5
6
+ metadata.gz: 7bcdd489f5db390837007665cac0e796ca37e3791b42c9d4eae575b04b30555882b0ad07bb0b9f8cf1c2dec03d9a51a61374a4a9b7c1cc907c9cc6f988ec7a8b
7
+ data.tar.gz: 821809065cd6837638ae14a029f9a6eaad48f9d4cfd1a4d90470e6acd3dbaffa9bc8590fdbb81ed8f9193e91bfe3e7f46bbbb1eee941e7bc8decd7406d3dab54
data/lib/relaton/db.rb CHANGED
@@ -306,7 +306,7 @@ module Relaton
306
306
  end
307
307
 
308
308
  #
309
- # @param entry [String] XML string
309
+ # @param entry [String, nil] XML string
310
310
  # @param stdclass [Symbol]
311
311
  #
312
312
  # @return [nil, RelatonBib::BibliographicItem,
@@ -318,7 +318,9 @@ module Relaton
318
318
  # RelatonBipm::BipmBibliographicItem, RelatonIho::IhoBibliographicItem,
319
319
  # RelatonOmg::OmgBibliographicItem, RelatonW3c::W3cBibliographicItem]
320
320
  def bib_retval(entry, stdclass)
321
- @registry.processors[stdclass].from_xml(entry) if entry
321
+ if entry && !entry.match?(/^not_found/)
322
+ @registry.processors[stdclass].from_xml(entry)
323
+ end
322
324
  end
323
325
 
324
326
  # @param code [String]
@@ -394,7 +396,10 @@ module Relaton
394
396
  def new_bib_entry(code, year, opts, stdclass, **args) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength
395
397
  entry = @semaphore.synchronize { args[:db] && args[:db][args[:id]] }
396
398
  if entry
397
- Util.log "[relaton] (#{code}) not found." if entry&.match?(/^not_found/)
399
+ if entry&.match?(/^not_found/)
400
+ Util.log "[relaton] (#{code}) not found."
401
+ return
402
+ end
398
403
  return entry
399
404
  end
400
405
 
@@ -1,3 +1,3 @@
1
1
  module Relaton
2
- VERSION = "1.12.1".freeze
2
+ VERSION = "1.12.2".freeze
3
3
  end
@@ -20,7 +20,7 @@ RSpec.describe Relaton::Db do
20
20
  expect(db).to receive(:[]).with(id).and_return "not_found"
21
21
  expect do
22
22
  entry = subject.send :new_bib_entry, "ISO 123", nil, {}, :relaton_iso, db: db, id: id
23
- expect(entry).to eq "not_found"
23
+ expect(entry).to be_nil
24
24
  end.to output("[relaton] (ISO 123) not found.\n").to_stderr
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.