relaton-bib 1.16.5 → 1.17.0

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: 9cd83f1b6817d3aff3fb219312882391f32f69a31e1683e6437e48771985b4a2
4
- data.tar.gz: ecbc877b14f379f0138470922b4a40feffcec3be4a7d351d50a134108317d73b
3
+ metadata.gz: 9f5805d9364d7a5f74ce37acdeb99ea547d928d276541ec7d01870621330f2f1
4
+ data.tar.gz: 2aff2d7bd6fca3bb87a34509a7b61995f3dcd0eb4bdb68b60e940887eedc4c78
5
5
  SHA512:
6
- metadata.gz: 04f486d465f35b8214bc0978a15d47678e26fc2e78d72bb6e3875771af2c480bc21f2cef576a3deee9fb99c72ecec40da6a6826c88cbf81607aba51e84757647
7
- data.tar.gz: 17a64cd868fa320959cf44a65e0794273aaf8ba992d36d4bf90bd774b66484d4021dde1285144530892a398d84b955f8aba1774ffdcbc7532d56d60ee6c6c738
6
+ metadata.gz: 7c061fc2df92d1c1418aa9a807e496ec736eec5eddfe5734ce0bdcc3c21995c3abd22fbc9162383f2370a7546f7836b325732f92bbc65ae9484124740cf5f406
7
+ data.tar.gz: 21c72729a63efff9cf5a312018206b22a8da1a77e4708e27610b2c92c8a4571c0a1cb5b0af973eb5285b4e0fb111353e73499ef00bee45d40cbce7cdc5d7d0f2
@@ -46,9 +46,12 @@ module RelatonBib
46
46
  attr_accessor :all_parts
47
47
 
48
48
  # @return [String, nil]
49
- attr_reader :id, :type, :docnumber, :doctype, :subdoctype
49
+ attr_reader :id, :type, :docnumber, :subdoctype
50
50
 
51
- # @return [RelatonBib::Edition, nil] <description>
51
+ # @return [RelatonBib::DocumentType] document type
52
+ attr_reader :doctype
53
+
54
+ # @return [RelatonBib::Edition, nil] edition
52
55
  attr_reader :edition
53
56
 
54
57
  # @!attribute [r] title
@@ -157,7 +160,7 @@ module RelatonBib
157
160
  # @param validity [RelatonBib:Validity, nil]
158
161
  # @param fetched [Date, nil] default nil
159
162
  # @param keyword [Array<String>]
160
- # @param doctype [String]
163
+ # @param doctype [RelatonBib::DocumentType]
161
164
  # @param subdoctype [String]
162
165
  # @param editorialgroup [RelatonBib::EditorialGroup, nil]
163
166
  # @param ics [Array<RelatonBib::ICS>]
@@ -421,7 +424,7 @@ module RelatonBib
421
424
  hash["fetched"] = fetched.to_s if fetched
422
425
  hash["keyword"] = single_element_array(keyword) if keyword&.any?
423
426
  hash["license"] = single_element_array(license) if license&.any?
424
- hash["doctype"] = doctype if doctype
427
+ hash["doctype"] = doctype.to_hash if doctype
425
428
  hash["subdoctype"] = subdoctype if subdoctype
426
429
  if editorialgroup&.presence?
427
430
  hash["editorialgroup"] = editorialgroup.to_hash
@@ -576,7 +579,7 @@ module RelatonBib
576
579
  end
577
580
  out += relation.to_asciibib prefix if relation
578
581
  series.each { |s| out += s.to_asciibib prefix, series.size }
579
- out += "#{pref}doctype:: #{doctype}\n" if doctype
582
+ out += doctype.to_asciibib prefix if doctype
580
583
  out += "#{pref}subdoctype:: #{subdoctype}\n" if subdoctype
581
584
  out += "#{pref}formattedref:: #{formattedref}\n" if formattedref
582
585
  keyword.each { |kw| out += kw.to_asciibib "#{pref}keyword", keyword.size }
@@ -639,7 +642,7 @@ module RelatonBib
639
642
  elsif opts[:bibdata] && (doctype || editorialgroup || ics&.any? ||
640
643
  structuredidentifier&.presence?)
641
644
  ext = builder.ext do |b|
642
- b.doctype doctype if doctype
645
+ doctype.to_xml b if doctype
643
646
  b.subdoctype subdoctype if subdoctype
644
647
  editorialgroup&.to_xml b
645
648
  ics.each { |i| i.to_xml b }
@@ -409,11 +409,12 @@ module RelatonBib
409
409
  # @param anchor [String]
410
410
  # @return [String]
411
411
  def doctype(anchor)
412
- case anchor
413
- when /I-D/ then "internet-draft"
414
- when /IEEE/ then "ieee"
415
- else "rfc"
416
- end
412
+ type = case anchor
413
+ when /I-D/ then "internet-draft"
414
+ when /IEEE/ then "ieee"
415
+ else "rfc"
416
+ end
417
+ DocumentType.new type: type
417
418
  end
418
419
 
419
420
  extend BibXMLParser
@@ -0,0 +1,52 @@
1
+ module RelatonBib
2
+ class DocumentType
3
+ attr_reader :type, :abbreviation
4
+
5
+ #
6
+ # Initialize a DocumentType.
7
+ #
8
+ # @param [String] type document type
9
+ # @param [String, nil] abbreviation type abbreviation
10
+ #
11
+ def initialize(type:, abbreviation: nil)
12
+ @type = type
13
+ @abbreviation = abbreviation
14
+ end
15
+
16
+ #
17
+ # Build XML representation of the document type.
18
+ #
19
+ # @param [Nokogiri::XML::Builder] builder XML builder
20
+ #
21
+ def to_xml(builder)
22
+ xml = builder.doctype @type
23
+ xml[:abbreviation] = @abbreviation if @abbreviation
24
+ end
25
+
26
+ #
27
+ # Hash representation of the document type.
28
+ #
29
+ # @return [Hash]
30
+ #
31
+ def to_hash
32
+ hash = { "type" => @type }
33
+ hash["abbreviation"] = @abbreviation if @abbreviation
34
+ hash
35
+ end
36
+
37
+ #
38
+ # Asciibib representation of the document type.
39
+ #
40
+ # @param [String] prefix prefix
41
+ #
42
+ # @return [String] AsciiBib representation
43
+ #
44
+ def to_asciibib(prefix = "")
45
+ pref = prefix.empty? ? prefix : prefix + "."
46
+ pref += "doctype."
47
+ out = "#{pref}type:: #{@type}\n"
48
+ out += "#{pref}abbreviation:: #{@abbreviation}\n" if @abbreviation
49
+ out
50
+ end
51
+ end
52
+ end
@@ -1,521 +1,534 @@
1
1
  module RelatonBib
2
- class HashConverter
3
- class << self
4
- # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
5
-
6
- # @param args [Hash]
7
- # @return [Hash]
8
- def hash_to_bib(args)
9
- return nil unless args.is_a?(Hash)
10
-
11
- ret = Marshal.load(Marshal.dump(symbolize(args))) # deep copy
12
- title_hash_to_bib(ret)
13
- link_hash_to_bib(ret)
14
- language_hash_to_bib(ret)
15
- script_hash_to_bib(ret)
16
- dates_hash_to_bib(ret)
17
- docid_hash_to_bib(ret)
18
- version_hash_to_bib(ret)
19
- biblionote_hash_to_bib(ret)
20
- abstract_hash_to_bib(ret)
21
- formattedref_hash_to_bib(ret)
22
- docstatus_hash_to_bib(ret)
23
- contributors_hash_to_bib(ret)
24
- copyright_hash_to_bib(ret)
25
- relations_hash_to_bib(ret)
26
- series_hash_to_bib(ret)
27
- medium_hash_to_bib(ret)
28
- place_hash_to_bib(ret)
29
- extent_hash_to_bib(ret)
30
- size_hash_to_bib(ret)
31
- accesslocation_hash_to_bib(ret)
32
- classification_hash_to_bib(ret)
33
- validity_hash_to_bib(ret)
34
- keyword_hash_to_bib(ret)
35
- # ret[:keyword] = RelatonBib.array(ret[:keyword])
36
- ret[:license] = RelatonBib.array(ret[:license])
37
- editorialgroup_hash_to_bib ret
38
- ics_hash_to_bib ret
39
- structuredidentifier_hash_to_bib ret
40
- ret
41
- end
42
- # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
43
-
44
- def keyword_hash_to_bib(ret)
45
- ret[:keyword] = RelatonBib.array(ret[:keyword]).map do |keyword|
46
- localizedstring keyword
47
- end
2
+ module HashConverter
3
+ extend self
4
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
5
+
6
+ # @param args [Hash]
7
+ # @return [Hash]
8
+ def hash_to_bib(args)
9
+ return nil unless args.is_a?(Hash)
10
+
11
+ ret = Marshal.load(Marshal.dump(symbolize(args))) # deep copy
12
+ title_hash_to_bib(ret)
13
+ link_hash_to_bib(ret)
14
+ language_hash_to_bib(ret)
15
+ script_hash_to_bib(ret)
16
+ dates_hash_to_bib(ret)
17
+ docid_hash_to_bib(ret)
18
+ version_hash_to_bib(ret)
19
+ biblionote_hash_to_bib(ret)
20
+ abstract_hash_to_bib(ret)
21
+ formattedref_hash_to_bib(ret)
22
+ docstatus_hash_to_bib(ret)
23
+ contributors_hash_to_bib(ret)
24
+ copyright_hash_to_bib(ret)
25
+ relations_hash_to_bib(ret)
26
+ series_hash_to_bib(ret)
27
+ medium_hash_to_bib(ret)
28
+ place_hash_to_bib(ret)
29
+ extent_hash_to_bib(ret)
30
+ size_hash_to_bib(ret)
31
+ accesslocation_hash_to_bib(ret)
32
+ classification_hash_to_bib(ret)
33
+ validity_hash_to_bib(ret)
34
+ keyword_hash_to_bib(ret)
35
+ # ret[:keyword] = RelatonBib.array(ret[:keyword])
36
+ ret[:license] = RelatonBib.array(ret[:license])
37
+ editorialgroup_hash_to_bib ret
38
+ ics_hash_to_bib ret
39
+ structuredidentifier_hash_to_bib ret
40
+ doctype_hash_to_bib ret
41
+ ret
42
+ end
43
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
44
+
45
+ def keyword_hash_to_bib(ret)
46
+ ret[:keyword] = RelatonBib.array(ret[:keyword]).map do |keyword|
47
+ localizedstring keyword
48
48
  end
49
+ end
49
50
 
50
- def extent_hash_to_bib(ret)
51
- return unless ret[:extent]
51
+ def extent_hash_to_bib(ret)
52
+ return unless ret[:extent]
52
53
 
53
- ret[:extent] = RelatonBib.array(ret[:extent]).map do |e|
54
- locality e
55
- # ret[:extent][i] = Locality.new(e[:type], e[:reference_from],
56
- # e[:reference_to])
57
- end
54
+ ret[:extent] = RelatonBib.array(ret[:extent]).map do |e|
55
+ locality e
56
+ # ret[:extent][i] = Locality.new(e[:type], e[:reference_from],
57
+ # e[:reference_to])
58
58
  end
59
+ end
59
60
 
60
- def locality(loc)
61
- if loc[:locality_stack]
62
- LocalityStack.new(loc[:locality_stack].map { |l| locality(l) })
63
- else
64
- l = loc[:locality]
65
- Locality.new(l[:type], l[:reference_from], l[:reference_to])
66
- end
61
+ def locality(loc)
62
+ if loc[:locality_stack]
63
+ LocalityStack.new(loc[:locality_stack].map { |l| locality(l) })
64
+ else
65
+ l = loc[:locality]
66
+ Locality.new(l[:type], l[:reference_from], l[:reference_to])
67
67
  end
68
+ end
68
69
 
69
- def size_hash_to_bib(ret)
70
- return unless ret[:size]
70
+ def size_hash_to_bib(ret)
71
+ return unless ret[:size]
71
72
 
72
- ret[:size] = RelatonBib.array(ret[:size])
73
- size = ret[:size]&.map do |val|
74
- BibliographicSize::Value.new(**val)
75
- end
76
- ret[:size] = BibliographicSize.new(size)
73
+ ret[:size] = RelatonBib.array(ret[:size])
74
+ size = ret[:size]&.map do |val|
75
+ BibliographicSize::Value.new(**val)
77
76
  end
77
+ ret[:size] = BibliographicSize.new(size)
78
+ end
78
79
 
79
- def title_hash_to_bib(ret)
80
- return unless ret[:title]
80
+ def title_hash_to_bib(ret)
81
+ return unless ret[:title]
81
82
 
82
- ret[:title] = RelatonBib.array(ret[:title])
83
- .reduce(TypedTitleStringCollection.new) do |m, t|
84
- if t.is_a?(Hash) then m << TypedTitleString.new(**t)
85
- else
86
- m + TypedTitleString.from_string(t)
87
- end
83
+ ret[:title] = RelatonBib.array(ret[:title])
84
+ .reduce(TypedTitleStringCollection.new) do |m, t|
85
+ if t.is_a?(Hash) then m << TypedTitleString.new(**t)
86
+ else
87
+ m + TypedTitleString.from_string(t)
88
88
  end
89
89
  end
90
+ end
90
91
 
91
- def language_hash_to_bib(ret)
92
- return unless ret[:language]
92
+ def language_hash_to_bib(ret)
93
+ return unless ret[:language]
93
94
 
94
- ret[:language] = RelatonBib.array(ret[:language])
95
- end
95
+ ret[:language] = RelatonBib.array(ret[:language])
96
+ end
96
97
 
97
- def script_hash_to_bib(ret)
98
- return unless ret[:script]
98
+ def script_hash_to_bib(ret)
99
+ return unless ret[:script]
99
100
 
100
- ret[:script] = RelatonBib.array(ret[:script])
101
- end
101
+ ret[:script] = RelatonBib.array(ret[:script])
102
+ end
102
103
 
103
- def abstract_hash_to_bib(ret)
104
- return unless ret[:abstract]
104
+ def abstract_hash_to_bib(ret)
105
+ return unless ret[:abstract]
105
106
 
106
- ret[:abstract] = RelatonBib.array(ret[:abstract]).map do |a|
107
- a.is_a?(String) ? FormattedString.new(content: a) : a
108
- end
107
+ ret[:abstract] = RelatonBib.array(ret[:abstract]).map do |a|
108
+ a.is_a?(String) ? FormattedString.new(content: a) : a
109
109
  end
110
+ end
110
111
 
111
- def link_hash_to_bib(ret)
112
- return unless ret[:link]
112
+ def link_hash_to_bib(ret)
113
+ return unless ret[:link]
113
114
 
114
- ret[:link] = RelatonBib.array(ret[:link])
115
- end
115
+ ret[:link] = RelatonBib.array(ret[:link])
116
+ end
116
117
 
117
- def place_hash_to_bib(ret)
118
- return unless ret[:place]
118
+ def place_hash_to_bib(ret)
119
+ return unless ret[:place]
119
120
 
120
- ret[:place] = RelatonBib.array(ret[:place]).map do |pl|
121
- pl.is_a?(String) ? Place.new(name: pl) : Place.new(**pl)
122
- end
121
+ ret[:place] = RelatonBib.array(ret[:place]).map do |pl|
122
+ pl.is_a?(String) ? Place.new(name: pl) : Place.new(**pl)
123
123
  end
124
+ end
124
125
 
125
- def accesslocation_hash_to_bib(ret)
126
- return unless ret[:accesslocation]
126
+ def accesslocation_hash_to_bib(ret)
127
+ return unless ret[:accesslocation]
127
128
 
128
- ret[:accesslocation] = RelatonBib.array(ret[:accesslocation])
129
- end
129
+ ret[:accesslocation] = RelatonBib.array(ret[:accesslocation])
130
+ end
130
131
 
131
- def dates_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize
132
- return unless ret[:date]
132
+ def dates_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize
133
+ return unless ret[:date]
133
134
 
134
- ret[:date] = RelatonBib.array(ret[:date])
135
- ret[:date].each_with_index do |d, i|
136
- # value is synonym of on: it is reserved word in YAML
137
- if d[:value]
138
- ret[:date][i][:on] ||= d[:value]
139
- ret[:date][i].delete(:value)
140
- end
135
+ ret[:date] = RelatonBib.array(ret[:date])
136
+ ret[:date].each_with_index do |d, i|
137
+ # value is synonym of on: it is reserved word in YAML
138
+ if d[:value]
139
+ ret[:date][i][:on] ||= d[:value]
140
+ ret[:date][i].delete(:value)
141
141
  end
142
142
  end
143
+ end
143
144
 
144
- def docid_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize
145
- return unless ret[:docid]
145
+ def docid_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize
146
+ return unless ret[:docid]
146
147
 
147
- ret[:docid] = RelatonBib.array(ret[:docid]).map do |id|
148
- id[:type] ||= id[:id].match(/^\w+(?=\s)/)&.to_s
149
- create_docid(**id)
150
- end
148
+ ret[:docid] = RelatonBib.array(ret[:docid]).map do |id|
149
+ id[:type] ||= id[:id].match(/^\w+(?=\s)/)&.to_s
150
+ create_docid(**id)
151
151
  end
152
+ end
152
153
 
153
- def create_docid(**args)
154
- DocumentIdentifier.new(**args)
155
- end
154
+ def create_docid(**args)
155
+ DocumentIdentifier.new(**args)
156
+ end
156
157
 
157
- def version_hash_to_bib(ret)
158
- return unless ret[:version]
158
+ def version_hash_to_bib(ret)
159
+ return unless ret[:version]
159
160
 
160
- ret[:version] = RelatonBib.array(ret[:version]).map do |v|
161
- BibliographicItem::Version.new(v[:revision_date], v[:draft])
162
- end
161
+ ret[:version] = RelatonBib.array(ret[:version]).map do |v|
162
+ BibliographicItem::Version.new(v[:revision_date], v[:draft])
163
163
  end
164
+ end
164
165
 
165
- def biblionote_hash_to_bib(ret) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
166
- return unless ret[:biblionote]
167
-
168
- ret[:biblionote] = RelatonBib.array(ret[:biblionote])
169
- .reduce(BiblioNoteCollection.new([])) do |mem, n|
170
- mem << if n.is_a?(String) then BiblioNote.new content: n
171
- else BiblioNote.new(**n)
172
- end
173
- end
174
- end
166
+ def biblionote_hash_to_bib(ret) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
167
+ return unless ret[:biblionote]
175
168
 
176
- def formattedref_hash_to_bib(ret)
177
- ret[:formattedref] &&
178
- ret[:formattedref] = formattedref(ret[:formattedref])
169
+ ret[:biblionote] = RelatonBib.array(ret[:biblionote])
170
+ .reduce(BiblioNoteCollection.new([])) do |mem, n|
171
+ mem << if n.is_a?(String) then BiblioNote.new content: n
172
+ else BiblioNote.new(**n)
173
+ end
179
174
  end
175
+ end
180
176
 
181
- def docstatus_hash_to_bib(ret)
182
- ret[:docstatus] && ret[:docstatus] = DocumentStatus.new(
183
- stage: stage(ret[:docstatus][:stage]),
184
- substage: stage(ret[:docstatus][:substage]),
185
- iteration: ret[:docstatus][:iteration],
186
- )
187
- end
177
+ def formattedref_hash_to_bib(ret)
178
+ ret[:formattedref] &&
179
+ ret[:formattedref] = formattedref(ret[:formattedref])
180
+ end
188
181
 
189
- # @param stg [Hash]
190
- # @return [RelatonBib::DocumentStatus::Stage]
191
- def stage(stg)
192
- return unless stg
182
+ def docstatus_hash_to_bib(ret)
183
+ ret[:docstatus] && ret[:docstatus] = DocumentStatus.new(
184
+ stage: stage(ret[:docstatus][:stage]),
185
+ substage: stage(ret[:docstatus][:substage]),
186
+ iteration: ret[:docstatus][:iteration],
187
+ )
188
+ end
193
189
 
194
- args = stg.is_a?(String) ? { value: stg } : stg
195
- DocumentStatus::Stage.new(**args)
196
- end
190
+ # @param stg [Hash]
191
+ # @return [RelatonBib::DocumentStatus::Stage]
192
+ def stage(stg)
193
+ return unless stg
197
194
 
198
- def contributors_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength,Metrics/PerceivedComplexity
199
- return unless ret[:contributor]
195
+ args = stg.is_a?(String) ? { value: stg } : stg
196
+ DocumentStatus::Stage.new(**args)
197
+ end
200
198
 
201
- ret[:contributor] = RelatonBib.array(ret[:contributor])
202
- ret[:contributor]&.each_with_index do |c, i|
203
- roles = RelatonBib.array(ret[:contributor][i][:role]).map do |r|
204
- if r.is_a? Hash
205
- desc = RelatonBib.array(r[:description]).map { |d| d.is_a?(String) ? d : d[:content] }
206
- { type: r[:type], description: desc }
207
- # elsif r.is_a? Array
208
- # { type: r[0], description: r.fetch(1) }
209
- else
210
- { type: r }
211
- end
199
+ def contributors_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength,Metrics/PerceivedComplexity
200
+ return unless ret[:contributor]
201
+
202
+ ret[:contributor] = RelatonBib.array(ret[:contributor])
203
+ ret[:contributor]&.each_with_index do |c, i|
204
+ roles = RelatonBib.array(ret[:contributor][i][:role]).map do |r|
205
+ if r.is_a? Hash
206
+ desc = RelatonBib.array(r[:description]).map { |d| d.is_a?(String) ? d : d[:content] }
207
+ { type: r[:type], description: desc }
208
+ # elsif r.is_a? Array
209
+ # { type: r[0], description: r.fetch(1) }
210
+ else
211
+ { type: r }
212
212
  end
213
- ret[:contributor][i][:role] = roles
214
- ret[:contributor][i][:entity] = if c[:person]
215
- person_hash_to_bib(c[:person])
216
- else
217
- org_hash_to_bib(c[:organization])
218
- end
219
- ret[:contributor][i].delete(:person)
220
- ret[:contributor][i].delete(:organization)
221
213
  end
214
+ ret[:contributor][i][:role] = roles
215
+ ret[:contributor][i][:entity] = if c[:person]
216
+ person_hash_to_bib(c[:person])
217
+ else
218
+ org_hash_to_bib(c[:organization])
219
+ end
220
+ ret[:contributor][i].delete(:person)
221
+ ret[:contributor][i].delete(:organization)
222
222
  end
223
+ end
223
224
 
224
- def org_hash_to_bib(org) # rubocop:disable Metrics/AbcSize
225
- return nil if org.nil?
225
+ def org_hash_to_bib(org) # rubocop:disable Metrics/AbcSize
226
+ return nil if org.nil?
226
227
 
227
- org[:identifier] = RelatonBib.array(org[:identifier])&.map do |a|
228
- OrgIdentifier.new(a[:type], a[:id])
229
- end
230
- org[:subdivision] = RelatonBib.array(org[:subdivision]).map do |sd|
231
- LocalizedString.new sd
232
- end
233
- org[:contact] = contacts_hash_to_bib(org)
234
- org
228
+ org[:identifier] = RelatonBib.array(org[:identifier])&.map do |a|
229
+ OrgIdentifier.new(a[:type], a[:id])
235
230
  end
236
-
237
- def person_hash_to_bib(person)
238
- Person.new(
239
- name: fullname_hash_to_bib(person),
240
- affiliation: affiliation_hash_to_bib(person),
241
- contact: contacts_hash_to_bib(person),
242
- identifier: person_identifiers_hash_to_bib(person),
243
- )
231
+ org[:subdivision] = RelatonBib.array(org[:subdivision]).map do |sd|
232
+ LocalizedString.new sd
244
233
  end
234
+ org[:contact] = contacts_hash_to_bib(org)
235
+ org
236
+ end
245
237
 
246
- def fullname_hash_to_bib(person) # rubocop:disable Metrics/AbcSize
247
- n = person[:name]
248
- fname, inits = given_hash_to_bib n[:given] || n # `n` is for backward compatibility
249
- FullName.new(
250
- forename: fname, initials: inits,
251
- addition: RelatonBib.array(n[:addition])&.map { |f| localizedstring(f) },
252
- prefix: RelatonBib.array(n[:prefix])&.map { |f| localizedstring(f) },
253
- surname: localizedstring(n[:surname]),
254
- completename: localizedstring(n[:completename])
255
- )
256
- end
238
+ def person_hash_to_bib(person)
239
+ Person.new(
240
+ name: fullname_hash_to_bib(person),
241
+ affiliation: affiliation_hash_to_bib(person),
242
+ contact: contacts_hash_to_bib(person),
243
+ identifier: person_identifiers_hash_to_bib(person),
244
+ )
245
+ end
257
246
 
258
- def given_hash_to_bib(given)
259
- return [[], nil] unless given
247
+ def fullname_hash_to_bib(person) # rubocop:disable Metrics/AbcSize
248
+ n = person[:name]
249
+ fname, inits = given_hash_to_bib n[:given] || n # `n` is for backward compatibility
250
+ FullName.new(
251
+ forename: fname, initials: inits,
252
+ addition: RelatonBib.array(n[:addition])&.map { |f| localizedstring(f) },
253
+ prefix: RelatonBib.array(n[:prefix])&.map { |f| localizedstring(f) },
254
+ surname: localizedstring(n[:surname]),
255
+ completename: localizedstring(n[:completename])
256
+ )
257
+ end
260
258
 
261
- fname = RelatonBib.array(given[:forename])&.map { |f| forename_hash_to_bib(f) }
262
- inits = localizedstring(given[:formatted_initials])
263
- [fname, inits]
264
- end
259
+ def given_hash_to_bib(given)
260
+ return [[], nil] unless given
265
261
 
266
- def forename_hash_to_bib(fname)
267
- case fname
268
- when Hash then Forename.new(**fname)
269
- when String then Forename.new(content: fname)
270
- end
262
+ fname = RelatonBib.array(given[:forename])&.map { |f| forename_hash_to_bib(f) }
263
+ inits = localizedstring(given[:formatted_initials])
264
+ [fname, inits]
265
+ end
266
+
267
+ def forename_hash_to_bib(fname)
268
+ case fname
269
+ when Hash then Forename.new(**fname)
270
+ when String then Forename.new(content: fname)
271
271
  end
272
+ end
272
273
 
273
- def person_identifiers_hash_to_bib(person)
274
- RelatonBib.array(person[:identifier])&.map do |a|
275
- PersonIdentifier.new(a[:type], a[:id])
276
- end
274
+ def person_identifiers_hash_to_bib(person)
275
+ RelatonBib.array(person[:identifier])&.map do |a|
276
+ PersonIdentifier.new(a[:type], a[:id])
277
277
  end
278
+ end
278
279
 
279
- def affiliation_hash_to_bib(person) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
280
- return [] unless person[:affiliation]
280
+ def affiliation_hash_to_bib(person) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
281
+ return [] unless person[:affiliation]
281
282
 
282
- RelatonBib.array(person[:affiliation]).map do |a|
283
- a[:description] = RelatonBib.array(a[:description]).map do |d|
284
- cnt = if d.is_a?(Hash)
285
- { content: d[:content], language: d[:language],
286
- script: d[:script], format: d[:format] }
287
- else { content: d }
288
- end
289
- FormattedString.new(**cnt)
290
- end
291
- name = LocalizedString.new(a[:name][:content], a[:name][:language], a[:name][:script]) if a[:name]
292
- Affiliation.new(
293
- organization: Organization.new(**org_hash_to_bib(a[:organization])),
294
- description: a[:description], name: name
295
- )
283
+ RelatonBib.array(person[:affiliation]).map do |a|
284
+ a[:description] = RelatonBib.array(a[:description]).map do |d|
285
+ cnt = if d.is_a?(Hash)
286
+ { content: d[:content], language: d[:language],
287
+ script: d[:script], format: d[:format] }
288
+ else { content: d }
289
+ end
290
+ FormattedString.new(**cnt)
296
291
  end
292
+ name = LocalizedString.new(a[:name][:content], a[:name][:language], a[:name][:script]) if a[:name]
293
+ Affiliation.new(
294
+ organization: Organization.new(**org_hash_to_bib(a[:organization])),
295
+ description: a[:description], name: name
296
+ )
297
297
  end
298
+ end
298
299
 
299
- def contacts_hash_to_bib(entity) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength,Metrics/PerceivedComplexity,Metrics/CyclomaticComplexity
300
- return [] unless entity[:contact]
301
-
302
- RelatonBib.array(entity[:contact]).map do |a|
303
- if a[:city] || a[:country] # it's for old version compatibility, should be removed in the future
304
- RelatonBib::Address.new(
305
- street: Array(a[:street]), city: a[:city], postcode: a[:postcode],
306
- country: a[:country], state: a[:state]
307
- )
308
- elsif a[:address]
309
- a[:address][:street] = RelatonBib.array(a[:address][:street])
310
- RelatonBib::Address.new(**a[:address])
311
- elsif a[:type] # it's for old version compatibility, should be removed in the future
312
- RelatonBib::Contact.new(type: a[:type], value: a[:value])
313
- else
314
- type, value = a.flatten
315
- RelatonBib::Contact.new(type: type.to_s, value: value)
316
- end
300
+ def contacts_hash_to_bib(entity) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength,Metrics/PerceivedComplexity,Metrics/CyclomaticComplexity
301
+ return [] unless entity[:contact]
302
+
303
+ RelatonBib.array(entity[:contact]).map do |a|
304
+ if a[:city] || a[:country] # it's for old version compatibility, should be removed in the future
305
+ RelatonBib::Address.new(
306
+ street: Array(a[:street]), city: a[:city], postcode: a[:postcode],
307
+ country: a[:country], state: a[:state]
308
+ )
309
+ elsif a[:address]
310
+ a[:address][:street] = RelatonBib.array(a[:address][:street])
311
+ RelatonBib::Address.new(**a[:address])
312
+ elsif a[:type] # it's for old version compatibility, should be removed in the future
313
+ RelatonBib::Contact.new(type: a[:type], value: a[:value])
314
+ else
315
+ type, value = a.flatten
316
+ RelatonBib::Contact.new(type: type.to_s, value: value)
317
317
  end
318
318
  end
319
+ end
319
320
 
320
- # @param ret [Hash]
321
- def copyright_hash_to_bib(ret)
322
- return unless ret[:copyright]
321
+ # @param ret [Hash]
322
+ def copyright_hash_to_bib(ret)
323
+ return unless ret[:copyright]
323
324
 
324
- ret[:copyright] = RelatonBib.array(ret[:copyright]).map do |c|
325
- c[:owner] = RelatonBib.array(c[:owner]).map do |o|
326
- org_hash_to_bib(o)
327
- end
328
- c
325
+ ret[:copyright] = RelatonBib.array(ret[:copyright]).map do |c|
326
+ c[:owner] = RelatonBib.array(c[:owner]).map do |o|
327
+ org_hash_to_bib(o)
329
328
  end
329
+ c
330
330
  end
331
+ end
331
332
 
332
- # @param ret [Hash]
333
- def relations_hash_to_bib(ret)
334
- return unless ret[:relation]
333
+ # @param ret [Hash]
334
+ def relations_hash_to_bib(ret)
335
+ return unless ret[:relation]
335
336
 
336
- ret[:relation] = RelatonBib.array(ret[:relation])
337
- ret[:relation]&.each do |r|
338
- if r[:description]
339
- r[:description] = FormattedString.new(**r[:description])
340
- end
341
- relation_bibitem_hash_to_bib(r)
342
- relation_locality_hash_to_bib(r)
343
- relation_source_locality_hash_to_bib(r)
337
+ ret[:relation] = RelatonBib.array(ret[:relation])
338
+ ret[:relation]&.each do |r|
339
+ if r[:description]
340
+ r[:description] = FormattedString.new(**r[:description])
344
341
  end
342
+ relation_bibitem_hash_to_bib(r)
343
+ relation_locality_hash_to_bib(r)
344
+ relation_source_locality_hash_to_bib(r)
345
345
  end
346
+ end
346
347
 
347
- # @param rel [Hash] relation
348
- def relation_bibitem_hash_to_bib(rel)
349
- if rel[:bibitem]
350
- rel[:bibitem] = bib_item hash_to_bib(rel[:bibitem])
351
- else
352
- Util.warn "WARNING: bibitem missing: `#{rel}`"
353
- rel[:bibitem] = nil
354
- end
348
+ # @param rel [Hash] relation
349
+ def relation_bibitem_hash_to_bib(rel)
350
+ if rel[:bibitem]
351
+ rel[:bibitem] = bib_item hash_to_bib(rel[:bibitem])
352
+ else
353
+ Util.warn "WARNING: bibitem missing: `#{rel}`"
354
+ rel[:bibitem] = nil
355
355
  end
356
+ end
356
357
 
357
- # @param item_hash [Hash]
358
- # @return [RelatonBib::BibliographicItem]
359
- def bib_item(item_hash)
360
- BibliographicItem.new(**item_hash)
361
- end
358
+ # @param item_hash [Hash]
359
+ # @return [RelatonBib::BibliographicItem]
360
+ def bib_item(item_hash)
361
+ BibliographicItem.new(**item_hash)
362
+ end
362
363
 
363
- # @param rel [Hash] relation
364
- # @return [RelatonBib::LocalityStack]
365
- def relation_locality_hash_to_bib(rel)
366
- rel[:locality] = RelatonBib.array(rel[:locality])&.map do |bl|
367
- LocalityStack.new locality_locality_stack(bl)
368
- end
364
+ # @param rel [Hash] relation
365
+ # @return [RelatonBib::LocalityStack]
366
+ def relation_locality_hash_to_bib(rel)
367
+ rel[:locality] = RelatonBib.array(rel[:locality])&.map do |bl|
368
+ LocalityStack.new locality_locality_stack(bl)
369
369
  end
370
+ end
370
371
 
371
- def locality_locality_stack(lls)
372
- if lls[:locality_stack]
373
- RelatonBib.array(lls[:locality_stack]).map do |lc|
374
- l = lc[:locality] || lc
375
- Locality.new(l[:type], l[:reference_from], l[:reference_to])
376
- end
377
- else
378
- [Locality.new(lls[:type], lls[:reference_from], lls[:reference_to])]
372
+ def locality_locality_stack(lls)
373
+ if lls[:locality_stack]
374
+ RelatonBib.array(lls[:locality_stack]).map do |lc|
375
+ l = lc[:locality] || lc
376
+ Locality.new(l[:type], l[:reference_from], l[:reference_to])
379
377
  end
378
+ else
379
+ [Locality.new(lls[:type], lls[:reference_from], lls[:reference_to])]
380
380
  end
381
+ end
381
382
 
382
- # @param rel [Hash] relation
383
- def relation_source_locality_hash_to_bib(rel) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
384
- rel[:source_locality] = RelatonBib.array(rel[:source_locality])&.map do |sl|
385
- sls = if sl[:source_locality_stack]
386
- RelatonBib.array(sl[:source_locality_stack]).map do |l|
387
- SourceLocality.new(l[:type], l[:reference_from],
388
- l[:reference_to])
389
- end
390
- else
391
- l = SourceLocality.new(sl[:type], sl[:reference_from],
392
- sl[:reference_to])
393
- [l]
383
+ # @param rel [Hash] relation
384
+ def relation_source_locality_hash_to_bib(rel) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
385
+ rel[:source_locality] = RelatonBib.array(rel[:source_locality])&.map do |sl|
386
+ sls = if sl[:source_locality_stack]
387
+ RelatonBib.array(sl[:source_locality_stack]).map do |l|
388
+ SourceLocality.new(l[:type], l[:reference_from],
389
+ l[:reference_to])
394
390
  end
395
- SourceLocalityStack.new sls
396
- end
391
+ else
392
+ l = SourceLocality.new(sl[:type], sl[:reference_from],
393
+ sl[:reference_to])
394
+ [l]
395
+ end
396
+ SourceLocalityStack.new sls
397
397
  end
398
+ end
398
399
 
399
- # @param ret [Hash]
400
- def series_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
401
- ret[:series] = RelatonBib.array(ret[:series])&.map do |s|
402
- s[:formattedref] && s[:formattedref] = formattedref(s[:formattedref])
403
- if s[:title]
404
- s[:title] = { content: s[:title] } unless s[:title].is_a?(Hash)
405
- s[:title] = typed_title_strig(s[:title])
406
- end
407
- s[:abbreviation] &&
408
- s[:abbreviation] = localizedstring(s[:abbreviation])
409
- Series.new(**s)
400
+ # @param ret [Hash]
401
+ def series_hash_to_bib(ret) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
402
+ ret[:series] = RelatonBib.array(ret[:series])&.map do |s|
403
+ s[:formattedref] && s[:formattedref] = formattedref(s[:formattedref])
404
+ if s[:title]
405
+ s[:title] = { content: s[:title] } unless s[:title].is_a?(Hash)
406
+ s[:title] = typed_title_strig(s[:title])
410
407
  end
408
+ s[:abbreviation] &&
409
+ s[:abbreviation] = localizedstring(s[:abbreviation])
410
+ Series.new(**s)
411
411
  end
412
+ end
412
413
 
413
- # @param title [Hash]
414
- # @return [RelatonBib::TypedTitleString]
415
- def typed_title_strig(title)
416
- TypedTitleString.new(**title)
417
- end
414
+ # @param title [Hash]
415
+ # @return [RelatonBib::TypedTitleString]
416
+ def typed_title_strig(title)
417
+ TypedTitleString.new(**title)
418
+ end
418
419
 
419
- # @param ret [Hash]
420
- def medium_hash_to_bib(ret)
421
- ret[:medium] = Medium.new(**ret[:medium]) if ret[:medium]
422
- end
420
+ # @param ret [Hash]
421
+ def medium_hash_to_bib(ret)
422
+ ret[:medium] = Medium.new(**ret[:medium]) if ret[:medium]
423
+ end
423
424
 
424
- # @param ret [Hash]
425
- def classification_hash_to_bib(ret)
426
- if ret[:classification]
427
- ret[:classification] = RelatonBib.array(ret[:classification]).map do |cls|
428
- Classification.new(**cls)
429
- end
425
+ # @param ret [Hash]
426
+ def classification_hash_to_bib(ret)
427
+ if ret[:classification]
428
+ ret[:classification] = RelatonBib.array(ret[:classification]).map do |cls|
429
+ Classification.new(**cls)
430
430
  end
431
431
  end
432
+ end
432
433
 
433
- # @param ret [Hash]
434
- def validity_hash_to_bib(ret)
435
- return unless ret[:validity]
434
+ # @param ret [Hash]
435
+ def validity_hash_to_bib(ret)
436
+ return unless ret[:validity]
436
437
 
437
- b = parse_validity_time(ret[:validity], :begins)
438
- e = parse_validity_time(ret[:validity], :ends)
439
- r = parse_validity_time(ret[:validity], :revision)
440
- ret[:validity] = Validity.new(begins: b, ends: e, revision: r)
441
- end
438
+ b = parse_validity_time(ret[:validity], :begins)
439
+ e = parse_validity_time(ret[:validity], :ends)
440
+ r = parse_validity_time(ret[:validity], :revision)
441
+ ret[:validity] = Validity.new(begins: b, ends: e, revision: r)
442
+ end
442
443
 
443
- def parse_validity_time(val, period)
444
- t = val[period]&.to_s
445
- return unless t
444
+ def parse_validity_time(val, period)
445
+ t = val[period]&.to_s
446
+ return unless t
446
447
 
447
- p = period == :ends ? -1 : 1
448
- case t
449
- when /^\d{4}$/
450
- Date.new(t.to_i, p, p).to_time
451
- when /^(?<year>\d{4})-(?<month>\d{1,2})$/
452
- Date.new($~[:year].to_i, $~[:month].to_i, p).to_time
453
- else Time.parse t
454
- end
448
+ p = period == :ends ? -1 : 1
449
+ case t
450
+ when /^\d{4}$/
451
+ Date.new(t.to_i, p, p).to_time
452
+ when /^(?<year>\d{4})-(?<month>\d{1,2})$/
453
+ Date.new($~[:year].to_i, $~[:month].to_i, p).to_time
454
+ else Time.parse t
455
455
  end
456
+ end
456
457
 
457
- # @param ret [Hash]
458
- def editorialgroup_hash_to_bib(ret)
459
- return unless ret[:editorialgroup]
458
+ # @param ret [Hash]
459
+ def editorialgroup_hash_to_bib(ret)
460
+ return unless ret[:editorialgroup]
460
461
 
461
- technical_committee = RelatonBib.array(ret[:editorialgroup]).map do |wg|
462
- TechnicalCommittee.new WorkGroup.new(**wg)
463
- end
464
- ret[:editorialgroup] = EditorialGroup.new technical_committee
462
+ technical_committee = RelatonBib.array(ret[:editorialgroup]).map do |wg|
463
+ TechnicalCommittee.new WorkGroup.new(**wg)
465
464
  end
465
+ ret[:editorialgroup] = EditorialGroup.new technical_committee
466
+ end
466
467
 
467
- # @param ret [Hash]
468
- def ics_hash_to_bib(ret)
469
- return unless ret[:ics]
468
+ # @param ret [Hash]
469
+ def ics_hash_to_bib(ret)
470
+ return unless ret[:ics]
470
471
 
471
- ret[:ics] = RelatonBib.array(ret[:ics]).map { |ics| ICS.new(**ics) }
472
- end
472
+ ret[:ics] = RelatonBib.array(ret[:ics]).map { |ics| ICS.new(**ics) }
473
+ end
473
474
 
474
- # @param ret [Hash]
475
- def structuredidentifier_hash_to_bib(ret)
476
- return unless ret[:structuredidentifier]
475
+ # @param ret [Hash]
476
+ def structuredidentifier_hash_to_bib(ret)
477
+ return unless ret[:structuredidentifier]
477
478
 
478
- sids = RelatonBib.array(ret[:structuredidentifier]).map do |si|
479
- si[:agency] = RelatonBib.array si[:agency]
480
- StructuredIdentifier.new(**si)
481
- end
482
- ret[:structuredidentifier] = StructuredIdentifierCollection.new sids
479
+ sids = RelatonBib.array(ret[:structuredidentifier]).map do |si|
480
+ si[:agency] = RelatonBib.array si[:agency]
481
+ StructuredIdentifier.new(**si)
483
482
  end
483
+ ret[:structuredidentifier] = StructuredIdentifierCollection.new sids
484
+ end
484
485
 
485
- # @param ogj [Hash, Array, String]
486
- # @return [Hash, Array, String]
487
- def symbolize(obj)
488
- case obj
489
- when Hash
490
- obj.reduce({}) do |memo, (k, v)|
491
- memo[k.to_sym] = symbolize(v)
492
- memo
493
- end
494
- when Array then obj.reduce([]) { |memo, v| memo << symbolize(v) }
495
- else obj
486
+ # @param ogj [Hash, Array, String]
487
+ # @return [Hash, Array, String]
488
+ def symbolize(obj)
489
+ case obj
490
+ when Hash
491
+ obj.reduce({}) do |memo, (k, v)|
492
+ memo[k.to_sym] = symbolize(v)
493
+ memo
496
494
  end
495
+ when Array then obj.reduce([]) { |memo, v| memo << symbolize(v) }
496
+ else obj
497
497
  end
498
+ end
498
499
 
499
- # @param lst [Hash, Array<RelatonBib::LocalizedString>, String]
500
- # @return [RelatonBib::LocalizedString]
501
- def localizedstring(lst)
502
- return unless lst
500
+ # @param lst [Hash, Array<RelatonBib::LocalizedString>, String]
501
+ # @return [RelatonBib::LocalizedString]
502
+ def localizedstring(lst)
503
+ return unless lst
503
504
 
504
- if lst.is_a?(Hash)
505
- LocalizedString.new(lst[:content], lst[:language], lst[:script])
506
- else LocalizedString.new(lst)
507
- end
505
+ if lst.is_a?(Hash)
506
+ LocalizedString.new(lst[:content], lst[:language], lst[:script])
507
+ else LocalizedString.new(lst)
508
508
  end
509
+ end
509
510
 
510
- # @param frf [Hash, String]
511
- # @return [RelatonBib::FormattedRef]
512
- def formattedref(frf)
513
- if frf.is_a?(Hash)
514
- RelatonBib::FormattedRef.new(**frf)
515
- else
516
- RelatonBib::FormattedRef.new(content: frf)
517
- end
511
+ # @param frf [Hash, String]
512
+ # @return [RelatonBib::FormattedRef]
513
+ def formattedref(frf)
514
+ if frf.is_a?(Hash)
515
+ RelatonBib::FormattedRef.new(**frf)
516
+ else
517
+ RelatonBib::FormattedRef.new(content: frf)
518
518
  end
519
519
  end
520
+
521
+ def doctype_hash_to_bib(ret)
522
+ return unless ret[:doctype]
523
+
524
+ ret[:doctype] = if ret[:doctype].is_a?(String)
525
+ create_doctype(type: ret[:doctype])
526
+ else create_doctype(**ret[:doctype])
527
+ end
528
+ end
529
+
530
+ def create_doctype(**args)
531
+ DocumentType.new(**args)
532
+ end
520
533
  end
521
534
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.16.5".freeze
2
+ VERSION = "1.17.0".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.0
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-11-27 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