relaton-bib 1.13.0 → 1.13.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 86a0bd8757736f00d9823a2c7e054061070ca6a092a502f20f5598875db95aa0
|
|
4
|
+
data.tar.gz: c96b9564f71355be85fd8752bf93df410d71d3913e87e8463b070bcbcca7b1b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c37155924af6e0a88b5c2883f439f16edeb27dbfa4114e7d3bf5fd9c1eb2e54c1c0d67a535ff0e06a9cda0a9810974de0bdecb96408d0adaeaf766fb18ac29d
|
|
7
|
+
data.tar.gz: 38ec500a5144b27b2dce3b6dfab3a7c76c6e936d54f4a2ec2933cb292f6aaf133471fd7b32a1521098c5bee25de789472c5ca6238c85c70310656c5ae00f3d8b
|
|
@@ -1017,7 +1017,9 @@ module RelatonBib
|
|
|
1017
1017
|
if person.name.completename
|
|
1018
1018
|
builder.parent[:fullname] = person.name.completename.content
|
|
1019
1019
|
elsif person.name.forename.any?
|
|
1020
|
-
builder.parent[:fullname] = person.name.forename.map
|
|
1020
|
+
builder.parent[:fullname] = person.name.forename.map do |n|
|
|
1021
|
+
n.content || n.initial
|
|
1022
|
+
end.join " "
|
|
1021
1023
|
end
|
|
1022
1024
|
if person.name.initials
|
|
1023
1025
|
builder.parent[:initials] = person.name.initials.content
|
|
@@ -1027,7 +1029,7 @@ module RelatonBib
|
|
|
1027
1029
|
end.join
|
|
1028
1030
|
end
|
|
1029
1031
|
if person.name.surname
|
|
1030
|
-
if person.name.forename.any?
|
|
1032
|
+
if !person.name.completename && person.name.forename.any? && person.name.surname
|
|
1031
1033
|
builder.parent[:fullname] += " #{person.name.surname}"
|
|
1032
1034
|
end
|
|
1033
1035
|
builder.parent[:surname] = person.name.surname.content
|
|
@@ -267,11 +267,27 @@ module RelatonBib
|
|
|
267
267
|
initials = localized_string(author[:initials], lang) if author[:initials]
|
|
268
268
|
FullName.new(
|
|
269
269
|
completename: localized_string(author[:fullname], lang),
|
|
270
|
-
initials: initials,
|
|
271
|
-
surname: localized_string(author[:surname], lang)
|
|
270
|
+
initials: initials, forename: forename(author[:initials], lang),
|
|
271
|
+
surname: localized_string(author[:surname], lang)
|
|
272
272
|
)
|
|
273
273
|
end
|
|
274
274
|
|
|
275
|
+
#
|
|
276
|
+
# Create forenames with initials
|
|
277
|
+
#
|
|
278
|
+
# @param [String] initials initials
|
|
279
|
+
# @param [String] lang language
|
|
280
|
+
#
|
|
281
|
+
# @return [Array<RelatonBib::Forename>] forenames
|
|
282
|
+
#
|
|
283
|
+
def forename(initials, lang)
|
|
284
|
+
return [] unless initials
|
|
285
|
+
|
|
286
|
+
initials.split(/\.-?\s?|\s/).map do |i|
|
|
287
|
+
Forename.new(initial: i, language: lang)
|
|
288
|
+
end
|
|
289
|
+
end
|
|
290
|
+
|
|
275
291
|
# @param author [Nokogiri::XML::Element]
|
|
276
292
|
# @return [Array<RelatonBib::Affiliation>]
|
|
277
293
|
def affiliation(author)
|
|
@@ -132,11 +132,11 @@ module RelatonBib
|
|
|
132
132
|
|
|
133
133
|
# @return [Hash]
|
|
134
134
|
def to_hash # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
135
|
-
if content.is_a?
|
|
135
|
+
if content.nil? || content.is_a?(String)
|
|
136
136
|
# return content unless language || script
|
|
137
137
|
|
|
138
138
|
hash = {}
|
|
139
|
-
hash["content"] = content unless empty?
|
|
139
|
+
hash["content"] = content unless content.nil? || content.empty?
|
|
140
140
|
hash["language"] = single_element_array(language) if language&.any?
|
|
141
141
|
hash["script"] = single_element_array(script) if script&.any?
|
|
142
142
|
hash
|
data/lib/relaton_bib/version.rb
CHANGED
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.13.
|
|
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-
|
|
11
|
+
date: 2022-08-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: byebug
|