relaton-bib 1.9.21 → 1.9.22
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 +4 -4
- data/lib/relaton_bib/version.rb +1 -1
- data/lib/relaton_bib/xml_parser.rb +24 -20
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d003dbfecade683b1474dfc3923c2210997574d956f3c96ef0b7b0f113100d66
|
|
4
|
+
data.tar.gz: 6829735611e2ad3807ecb8014b6dddc115f8a2b8799328a11a7b7a229174a49c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fbb7e6611505b14b7b321893dd4c1941e91b0d52cd2de4ea4f6fe083e1e2378c6f8c34a6fe3c39bb9d028ee81e5548ba435a893483c6e42e16f01030dd230eaa
|
|
7
|
+
data.tar.gz: 01aef015aefc3a321442118ccafd9ae310e9fccab9f57bce7d4e3e2c8c0abf70b9b5d4a1ad3877866daabc2054f572fec72be93311e7d66446c77f119b4ce781
|
data/lib/relaton_bib/version.rb
CHANGED
|
@@ -238,11 +238,12 @@ module RelatonBib
|
|
|
238
238
|
OrgIdentifier.new(i[:type], i.text)
|
|
239
239
|
end
|
|
240
240
|
subdiv = org.xpath("subdivision").map &:text
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
contact = parse_contact org
|
|
242
|
+
Organization.new(
|
|
243
|
+
name: names, abbreviation: org.at("abbreviation")&.text,
|
|
244
|
+
subdivision: subdiv, # url: org.at("uri")&.text,
|
|
245
|
+
identifier: identifier, contact: contact
|
|
246
|
+
)
|
|
246
247
|
end
|
|
247
248
|
|
|
248
249
|
def get_person(person) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
@@ -255,21 +256,7 @@ module RelatonBib
|
|
|
255
256
|
Affiliation.new organization: get_org(org), description: desc
|
|
256
257
|
end
|
|
257
258
|
|
|
258
|
-
contact = person
|
|
259
|
-
if c.name == "address"
|
|
260
|
-
streets = c.xpath("./street").map(&:text)
|
|
261
|
-
Address.new(
|
|
262
|
-
street: streets,
|
|
263
|
-
city: c.at("./city")&.text,
|
|
264
|
-
state: c.at("./state")&.text,
|
|
265
|
-
country: c.at("./country")&.text,
|
|
266
|
-
postcode: c.at("./postcode")&.text,
|
|
267
|
-
)
|
|
268
|
-
else
|
|
269
|
-
Contact.new(type: c.name, value: c.text)
|
|
270
|
-
end
|
|
271
|
-
end
|
|
272
|
-
|
|
259
|
+
contact = parse_contact person
|
|
273
260
|
identifier = person.xpath("./identifier").map do |pi|
|
|
274
261
|
PersonIdentifier.new pi[:type], pi.text
|
|
275
262
|
end
|
|
@@ -295,6 +282,23 @@ module RelatonBib
|
|
|
295
282
|
)
|
|
296
283
|
end
|
|
297
284
|
|
|
285
|
+
def parse_contact(contrib) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength,Metrics/AbcSize
|
|
286
|
+
contrib.xpath("./address|./phone|./email|./uri").map do |c|
|
|
287
|
+
if c.name == "address"
|
|
288
|
+
streets = c.xpath("./street").map(&:text)
|
|
289
|
+
Address.new(
|
|
290
|
+
street: streets,
|
|
291
|
+
city: c.at("./city")&.text,
|
|
292
|
+
state: c.at("./state")&.text,
|
|
293
|
+
country: c.at("./country")&.text,
|
|
294
|
+
postcode: c.at("./postcode")&.text,
|
|
295
|
+
)
|
|
296
|
+
else
|
|
297
|
+
Contact.new(type: c.name, value: c.text)
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
|
|
298
302
|
def name_part(person, part)
|
|
299
303
|
person.xpath("./name/#{part}").map do |np|
|
|
300
304
|
LocalizedString.new np.text, np[:language], np[:script]
|
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.9.
|
|
4
|
+
version: 1.9.22
|
|
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-01-
|
|
11
|
+
date: 2022-01-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: byebug
|