relaton-ietf 1.0.3 → 1.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfc51d85c3388e1f2d4f1b4bd530ee4c36b10f60906b742eec812f313d9ec1cf
4
- data.tar.gz: 961323b40d233d6dd662f2f9fb98590bb39f649067d7efaf6de642a2ec3ae204
3
+ metadata.gz: c7c3cbbf83e978418b1b8ce37ccd498651b029af23c8917fc7dc76e7249424d3
4
+ data.tar.gz: cadfca1c00571049297c95c5ab826f27d31408db332b9d8784f97debfc56dba4
5
5
  SHA512:
6
- metadata.gz: c96ccb8c67e97d5023823b6b45d6ecc2323ffc599de7f3306948d1f92e1e4840c7c9d4dbf6161248d5cf5f0c23adcefa13afb7e7065e2077e4df6573bacb09e5
7
- data.tar.gz: 34759601e2ac3d273815cf87f54674daff30f9b1136b091e4b7af326f0a569b11370af17f9ead8f128c22b51ff070f9f9904b77fca5f16ec917c1d32a5566a32
6
+ metadata.gz: cab4dd39ba1aa43f6791e1a89e4fa373effb43dc9826af80e6e7d2ae701c6d270ea31effa7a2679a53d1240a7537a0c8c1419a809e55e950ab8de8838b0cbb32
7
+ data.tar.gz: 176c22ed17078a84e4ee7548cefc172c6924fa2470900fc8386af3736a8b5f133b991baaf709f3427eb13c9cc29094f235ca16b56b8046e186221fa677ad9b82
@@ -192,7 +192,8 @@ module RelatonIetf
192
192
 
193
193
  # @return [Array<Hash{Symbol=>RelatonBib::Person,Symbol=>Array<String>}>]
194
194
  def persons(reference)
195
- reference.xpath("./front/author").map do |author|
195
+ reference.xpath("./front/author[@surname]|./front/author[@fullname]").
196
+ map do |author|
196
197
  entity = RelatonBib::Person.new(
197
198
  name: full_name(author, reference),
198
199
  affiliation: [affiliation(author)],
@@ -216,17 +217,21 @@ module RelatonIetf
216
217
  # @param ref [Nokogiri::XML::Document]
217
218
  # @return [RelatonBib::FullName]
218
219
  def full_name(author, ref)
220
+ lang = language ref
219
221
  RelatonBib::FullName.new(
220
- completename: localized_string(author[:fullname], ref),
221
- initial: [localized_string(author[:initials], ref)],
222
- surname: [localized_string(author[:surname], ref)],
222
+ completename: localized_string(author[:fullname], lang),
223
+ initial: [localized_string(author[:initials], lang)].compact,
224
+ surname: localized_string(author[:surname], lang),
223
225
  )
224
226
  end
225
227
 
226
228
  # @param content [String]
229
+ # @param lang [String]
227
230
  # @return [RelatonBib::LocalizedString]
228
- def localized_string(content, ref)
229
- RelatonBib::LocalizedString.new(content, language(ref))
231
+ def localized_string(content, lang)
232
+ return unless content
233
+
234
+ RelatonBib::LocalizedString.new(content, lang)
230
235
  end
231
236
 
232
237
  # @param postal [Nokogiri::XML::Document]
@@ -275,6 +280,9 @@ module RelatonIetf
275
280
  RelatonBib::Affiliation.new organization: org
276
281
  end
277
282
 
283
+ # @param name [String]
284
+ # @param abbr [String]
285
+ # @return [RelatonBib::Organization]
278
286
  def new_org(name = "Internet Engineering Task Force", abbr = "IETF")
279
287
  RelatonBib::Organization.new name: name, abbreviation: abbr
280
288
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "1.0.3".freeze
2
+ VERSION = "1.0.4".freeze
3
3
  end
@@ -40,5 +40,5 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency "vcr"
41
41
  spec.add_development_dependency "webmock"
42
42
 
43
- spec.add_dependency "relaton-bib", ">= 1.0.3"
43
+ spec.add_dependency "relaton-bib", ">= 1.0.4"
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.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-05-22 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 1.0.3
159
+ version: 1.0.4
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 1.0.3
166
+ version: 1.0.4
167
167
  description: "RelatonIetf: retrieve IETF Standards for bibliographic use \nusing the
168
168
  BibliographicItem model.\n\nFormerly known as rfcbib.\n"
169
169
  email: