relaton-cli 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton/cli.rb +9 -7
- data/lib/relaton/cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f04dc5ef23a80c1aefda7338334d5b685d451c313080991179df87d85dc03e1f
|
4
|
+
data.tar.gz: da8683ae592398c2d23ee47a7905d746c85d9ade95a2ce9158b9ff2863120537
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84c4db993685042758436a34aef83026ecd56084acc299ff359993e3a28413ad8e1ca9f54f30f39ec7a41f4a0beba046cd702f18f2000093432ea0a5df6b35a0
|
7
|
+
data.tar.gz: e0bd3dfcadd709c9e8e0627a4f27ac1ca475a896fe7efc62c8988d24b8ddeac25de1465d9dcd6f948de9f73f302d71a4376c24ce52af57b0ccaf6361d68a6de6
|
data/lib/relaton/cli.rb
CHANGED
@@ -34,20 +34,22 @@ module Relaton
|
|
34
34
|
# @param content [Nokogiri::XML::Document]
|
35
35
|
# @return [RelatonBib::BibliographicItem, RelatonIsoBib::IsoBibliongraphicItem]
|
36
36
|
def self.parse_xml(doc)
|
37
|
-
if (
|
38
|
-
|
37
|
+
if (proc = Cli.processor(doc))
|
38
|
+
proc.from_xml(doc.to_s)
|
39
39
|
else
|
40
40
|
RelatonBib::XMLParser.from_xml(doc.to_s)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
# @param
|
44
|
+
# @param doc [Nokogiri::XML::Element]
|
45
45
|
# @return [String] Type prefix
|
46
|
-
def self.
|
46
|
+
def self.processor(doc)
|
47
47
|
docid = doc.at "docidentifier"
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
if docid && docid[:type]
|
49
|
+
proc = Relaton::Registry.instance.by_type(docid[:type])
|
50
|
+
return proc if proc
|
51
|
+
end
|
52
|
+
Relaton::Registry.instance.by_type(docid&.text&.match(/^\w+/)&.to_s)
|
51
53
|
end
|
52
54
|
end
|
53
55
|
end
|
data/lib/relaton/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|