relaton-bib 1.9.21 → 1.9.22

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: fcb3b3d66701b4722151be5191a2eabfb1bc1e00453051e1a903e2af8c2b30b2
4
- data.tar.gz: eca150d7708507187a93e6cff06eda12cfeef54dc1a6ac93d8244c0db6accdaa
3
+ metadata.gz: d003dbfecade683b1474dfc3923c2210997574d956f3c96ef0b7b0f113100d66
4
+ data.tar.gz: 6829735611e2ad3807ecb8014b6dddc115f8a2b8799328a11a7b7a229174a49c
5
5
  SHA512:
6
- metadata.gz: 7f390c1e5e802966bc00002bf54bd1d246b45fc293188dc829940d90c32bc89db6b4e49e2ef4de14c13751c6ac6cff9692d23e558c1fe929815523f99de2a680
7
- data.tar.gz: 404f08acad50390f9e63af5a3a30685eb7d50a085e6d98d8730277062b644f38ac5f3ab75c959a25523457bed001ef6a7f8d6dd063b5d227319a0e651936f379
6
+ metadata.gz: fbb7e6611505b14b7b321893dd4c1941e91b0d52cd2de4ea4f6fe083e1e2378c6f8c34a6fe3c39bb9d028ee81e5548ba435a893483c6e42e16f01030dd230eaa
7
+ data.tar.gz: 01aef015aefc3a321442118ccafd9ae310e9fccab9f57bce7d4e3e2c8c0abf70b9b5d4a1ad3877866daabc2054f572fec72be93311e7d66446c77f119b4ce781
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.9.21".freeze
2
+ VERSION = "1.9.22".freeze
3
3
  end
@@ -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
- Organization.new(name: names,
242
- abbreviation: org.at("abbreviation")&.text,
243
- subdivision: subdiv,
244
- url: org.at("uri")&.text,
245
- identifier: identifier)
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.xpath("./address|./phone|./email|./uri").map do |c|
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.21
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-17 00:00:00.000000000 Z
11
+ date: 2022-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug