relaton-iso 1.18.3 → 1.18.4

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: 9a8570714304ad5ccdf68c5861a53b346f14235e0839bcaeba9b5221d93d0b4f
4
- data.tar.gz: 39b230964324c2753d24440bb545233771251b2fcf2e99ef9774c9fc90f10593
3
+ metadata.gz: 9d84323d65b954dcb15e73fb00917f6420494f11f1dfb5dbb5bf59e8fcae15ef
4
+ data.tar.gz: f9b9364c9804f46af7ad56d2b1c708a3e98760c9948142686f5ace87807a628c
5
5
  SHA512:
6
- metadata.gz: a5b9cec3bbd724d0c0ea0fcabe4f499e57c1effa4c9aa4abeb3323b143608997de21a6013dd89f88048c811442139e44a2b61221abdcee08af688522314f2478
7
- data.tar.gz: a4c3923795a224b728a7353988fc1f51f443cfbcec330de7ef2a45ee8d568193aa928ccd9eb790b551300ee75de084f7d5a2f01286a6babb95dd9d8e0d1264c4
6
+ metadata.gz: b242baf862c63b243d6a4c41611cc9e6f900cc269e78ed80c36d8e44fabad7a2f2ae6abcf72b8661c65467e52193c4b922d7d15b6cf82c187f5620f5264135cc
7
+ data.tar.gz: fb95d361df7ed56a0c6b33cc2239a2445f44e7a41f8f217f41a7b337629a3021efe59a11a6686f951fbf79f8fec747dc741978308b1a800c94601f8d0061be36
@@ -56,7 +56,7 @@ module RelatonIso
56
56
  # @return [RelatonIsoBib::IsoBibliographicItem]
57
57
  def parse_page(path, lang = nil) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
58
58
  doc, url = get_page path
59
- id = doc.at("//nav[contains(@class,'heading-condensed')]/h1").text.split(" | ").first
59
+ id = doc.at("//h1/span[1]").text.split(" | ").first.strip
60
60
  pubid = Pubid::Iso::Identifier.parse(id)
61
61
  # Fetch edition.
62
62
  edition = doc.at("//div[div[.='Edition']]/text()[last()]")&.text&.match(/\d+$/)&.to_s
@@ -279,7 +279,7 @@ module RelatonIso
279
279
  # @return [String, nil] ID
280
280
  #
281
281
  def item_ref(doc)
282
- doc.at("//main//section/div/div/div//h1")&.text
282
+ doc.at("//main//section/div/div/div//h1/span[1]")&.text
283
283
  end
284
284
 
285
285
  # Fetch status.
@@ -327,7 +327,9 @@ module RelatonIso
327
327
  # @return [Array<Hash>]
328
328
  def fetch_relations(doc)
329
329
  types = ["Now", "Now under review"]
330
- doc.xpath("//ul[@class='steps']/li", "//div[@class='sub-step']").reduce([]) do |a, r|
330
+ doc.xpath(
331
+ "//ul[@class='steps']/li", "//div[contains(@class, 'sub-step')]"
332
+ ).reduce([]) do |a, r|
331
333
  type, date = relation_type(r.at("h4", "h5").text.strip, doc)
332
334
  next a if types.include?(type)
333
335
 
@@ -347,7 +349,7 @@ module RelatonIso
347
349
  date = []
348
350
  t = case type.strip
349
351
  when "Previously", "Will be replaced by" then "obsoletes"
350
- when "Corrigenda / Amendments", "Revised by", "Now confirmed"
352
+ when /Corrigenda|Amendments|Revised by|Now confirmed|replaced by/
351
353
  on = doc.xpath('//span[@class="stage-date"][contains(., "-")]').last
352
354
  date << { type: "circulated", on: on.text } if on
353
355
  "updates"
@@ -411,9 +413,9 @@ module RelatonIso
411
413
  end
412
414
 
413
415
  def titles(doc)
414
- head = doc.at "//nav[contains(@class,'heading-condensed')]"
415
- ttls = head.xpath("h2 | h3 | h4").map &:text
416
- ttls = ttls[0].split " - " if ttls.size == 1
416
+ # head = doc.at "//nav[contains(@class,'heading-condensed')]"
417
+ ttls = doc.xpath("//h1[@class='stdTitle']/span[position()>1]").map(&:text)
418
+ ttls[0, 1] = ttls[0].split(/\s(?:-|\u2014)\s/) # if ttls.size == 1
417
419
  case ttls.size
418
420
  when 0, 1 then [nil, ttls.first, nil]
419
421
  else RelatonBib::TypedTitleString.intro_or_part ttls
@@ -489,7 +491,7 @@ module RelatonIso
489
491
  #
490
492
  def fetch_link(doc, url)
491
493
  links = [{ type: "src", content: url }]
492
- obp = doc.at("//h4[contains(@class, 'h5')]/a")
494
+ obp = doc.at("//a[.='Read sample']")
493
495
  links << { type: "obp", content: obp[:href] } if obp
494
496
  rss = doc.at("//a[contains(@href, 'rss')]")
495
497
  links << { type: "rss", content: DOMAIN + rss[:href] } if rss
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.18.3"
4
+ VERSION = "1.18.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.3
4
+ version: 1.18.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: 2024-05-20 00:00:00.000000000 Z
11
+ date: 2024-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pubid