relaton-bib 1.16.5 → 1.17.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.16.5".freeze
2
+ VERSION = "1.17.1".freeze
3
3
  end
@@ -63,7 +63,7 @@ module RelatonBib
63
63
  keyword: bibitem.xpath("keyword").map(&:text),
64
64
  license: bibitem.xpath("license").map(&:text),
65
65
  validity: fetch_validity(bibitem),
66
- doctype: ext&.at("doctype")&.text,
66
+ doctype: fetch_doctype(ext),
67
67
  subdoctype: ext&.at("subdoctype")&.text,
68
68
  editorialgroup: fetch_editorialgroup(ext),
69
69
  ics: fetch_ics(ext),
@@ -274,6 +274,13 @@ module RelatonBib
274
274
  Validity.new begins: begins, ends: ends, revision: revision
275
275
  end
276
276
 
277
+ def fetch_doctype(ext)
278
+ dt = ext&.at("doctype")
279
+ return unless dt
280
+
281
+ DocumentType.new type: dt.text, abbreviation: dt[:abbreviation]
282
+ end
283
+
277
284
  # @param item [Nokogiri::XML::Element]
278
285
  # @return [Array<RelatonBib::DocumentIdentifier>]
279
286
  def fetch_docid(item)
data/lib/relaton_bib.rb CHANGED
@@ -9,6 +9,7 @@ require "relaton_bib/localized_string"
9
9
  require "relaton_bib/forename"
10
10
  require "relaton_bib/full_name"
11
11
  require "relaton_bib/contributor"
12
+ require "relaton_bib/document_type"
12
13
  require "relaton_bib/bibliographic_item"
13
14
  require "relaton_bib/hit_collection"
14
15
  require "relaton_bib/hit"
data/relaton-bib.gemspec CHANGED
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency "bibtex-ruby"
28
28
  spec.add_dependency "htmlentities"
29
29
  spec.add_dependency "iso639"
30
- spec.add_dependency "nokogiri", "~> 1.14.0"
30
+ spec.add_dependency "nokogiri", "~> 1.15.0"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.5
4
+ version: 1.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-17 00:00:00.000000000 Z
11
+ date: 2023-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.14.0
75
+ version: 1.15.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.14.0
82
+ version: 1.15.0
83
83
  description: 'RelatonBib: Ruby XMLDOC impementation.'
84
84
  email:
85
85
  - open.source@ribose.com
@@ -127,6 +127,7 @@ files:
127
127
  - lib/relaton_bib/document_relation.rb
128
128
  - lib/relaton_bib/document_relation_collection.rb
129
129
  - lib/relaton_bib/document_status.rb
130
+ - lib/relaton_bib/document_type.rb
130
131
  - lib/relaton_bib/edition.rb
131
132
  - lib/relaton_bib/editorial_group.rb
132
133
  - lib/relaton_bib/forename.rb