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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57f7abf09dc691dbeca299fe1960057c040778da128d45b5cff25748c8442f72
4
- data.tar.gz: 39520c2293ea0f938ba81acfe13b5def8cd505bf3d6a0bf0e4c8d2ff2ec90beb
3
+ metadata.gz: f04dc5ef23a80c1aefda7338334d5b685d451c313080991179df87d85dc03e1f
4
+ data.tar.gz: da8683ae592398c2d23ee47a7905d746c85d9ade95a2ce9158b9ff2863120537
5
5
  SHA512:
6
- metadata.gz: 8efa168c29a5d1a6f49142e19d86a24f3e2ad26afb97f8126e2104f14eb86276d8e0a778bc58ff328f542d4579776ddd925d130a406c959616ece08a0a997583
7
- data.tar.gz: 75aedff7abac327dfe3b7d0abd9948fba5447e326a887dc06f0fe8fbc1b247797303193e788e13c7330f2c6b6ad0febd2f8752701b363e411f69ee34c28e35be
6
+ metadata.gz: 84c4db993685042758436a34aef83026ecd56084acc299ff359993e3a28413ad8e1ca9f54f30f39ec7a41f4a0beba046cd702f18f2000093432ea0a5df6b35a0
7
+ data.tar.gz: e0bd3dfcadd709c9e8e0627a4f27ac1ca475a896fe7efc62c8988d24b8ddeac25de1465d9dcd6f948de9f73f302d71a4376c24ce52af57b0ccaf6361d68a6de6
@@ -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 (processor = Relaton::Registry.instance.by_type(Relaton::Cli.doctype(doc)))
38
- processor.from_xml(doc.to_s)
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 content [Nokogiri::XML::Document] Document
44
+ # @param doc [Nokogiri::XML::Element]
45
45
  # @return [String] Type prefix
46
- def self.doctype(doc)
46
+ def self.processor(doc)
47
47
  docid = doc.at "docidentifier"
48
- return docid[:type] if docid && docid[:type]
49
-
50
- docid&.text&.match(/^\w+/)&.to_s
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
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "1.1.3".freeze
3
+ VERSION = "1.1.4".freeze
4
4
  end
5
5
  end
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.3
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-16 00:00:00.000000000 Z
11
+ date: 2020-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug