relaton-nist 1.13.0 → 1.13.1

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: c997f338c657a003a0bff7e75b650f59b86d4a72026a0b12734357bc48c10cdc
4
- data.tar.gz: 5d76af2d37037bb027f9875180bbcc967ca133260eb4a5494112fe81cccf5e04
3
+ metadata.gz: aeed99df30e7f99bfc8d2b05dccaf5bc45eb6c8980b1b5f608eb2ce94a541382
4
+ data.tar.gz: 41a13eb308604d5fbf7b9b808e2397d90b6c7ad0ba19722618487434233cd315
5
5
  SHA512:
6
- metadata.gz: 5971a572c9a7a5aefb4087f96787255687195c3e0cc75a49f740b57af1bb05fa48f56c2bd721cbb4b5aa7e5178cb93048c97a8782d152b4b040dd3158129ba14
7
- data.tar.gz: f266510c36ce07666a74b9881e439df01067f6baee05e03c267ce3754bef5dcf24b7391082a4fdc1d8122121f17b1fc30e3ba8377dadd86692ff80cd8efa962d
6
+ metadata.gz: d2e8d7da0a19ea149b5dce1d43831a4589a39f47ddb57bbb91f6621896d614ea670aae89348479fc6f956ecc678d9493503fe6b24e44e17b2e5986e997be89dd
7
+ data.tar.gz: caf9ddca1f1dc8eb37541c9c5620d183f72ff4bcd389261d6173f306e4d511a3e83df84a7fc6828dbb7bdc31457e01834e9fe18fca0b7f7d46fadc54d2dc6133
@@ -174,7 +174,7 @@ module RelatonNist
174
174
  #
175
175
  # @return [Array<Array<RelatonBib::LocalizedString>>] forename and initials
176
176
  #
177
- def forename_initial(person, doc) # rubocop:disable Metrics/MethodLength
177
+ def forename_initial(person, doc) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
178
178
  fnames = []
179
179
  fname = person.at("given_name")&.text
180
180
  if fname
@@ -182,10 +182,13 @@ module RelatonNist
182
182
  ints = inits.split(/[.\s]*/)
183
183
  fnames << forename(doc, fname, ints.shift)
184
184
  ints.each { |i| fnames << forename(doc, nil, i) }
185
- else fnames << forename(doc, fname)
185
+ else
186
+ fn = forename(doc, fname)
187
+ fnames << fn if fn
186
188
  end
187
189
  end
188
- [fnames, localized_string(inits, doc)]
190
+ initials = localized_string inits, doc if not(inits.nil? || inits.empty?)
191
+ [fnames, initials]
189
192
  end
190
193
 
191
194
  #
@@ -198,6 +201,8 @@ module RelatonNist
198
201
  # @return [RelatonBib::Forename] forename object
199
202
  #
200
203
  def forename(doc, cnt, init = nil)
204
+ return if (cnt.nil? || cnt.empty?) && (init.nil? || init.empty?)
205
+
201
206
  RelatonBib::Forename.new(
202
207
  content: cnt, language: doc["language"], script: "Latn", initial: init,
203
208
  )
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "1.13.0".freeze
2
+ VERSION = "1.13.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-nist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.13.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: 2022-08-21 00:00:00.000000000 Z
11
+ date: 2022-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml