relaton 1.12.1 → 1.12.2
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 +4 -4
- data/lib/relaton/db.rb +8 -3
- data/lib/relaton/version.rb +1 -1
- data/spec/relaton/db_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d1245a5e26b3bf22fef51b47397cf229876b56e026e1342a80e3da129c44fad
|
4
|
+
data.tar.gz: d13c8549f75408f841ed17f6781d7b33b6cd94586b6e8775928481a045b5c0c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
|
data/lib/relaton/version.rb
CHANGED
data/spec/relaton/db_spec.rb
CHANGED
@@ -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
|
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
|