relaton-iso 1.7.1 → 1.7.2

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: 27378f84ac82ece901152fa00502ed4508fdb39a90c1ca204afc7ca935d7ed45
4
- data.tar.gz: 2cde47cbe23847647d9c037b238cb6d813371df874e22b983fe27b810a3bffb8
3
+ metadata.gz: a0484edee8670c0f8b65c5f16dd01ea45e29a4ef5cdfe6dbf8372063004cee71
4
+ data.tar.gz: 571928a396258e54eda1d06de63fa115adf16ba5be19461286bddd89e443681a
5
5
  SHA512:
6
- metadata.gz: f13cdfaa32be91206dd96249cf186a829aafc7ddd2eb5ec184c20cd674501c58b88dc76c32b53292942db70379948e67abcc134b2c12d7f7c5c9b15cc492f382
7
- data.tar.gz: 78855cbbeb01b5f7bcb5edc9213a7c813bb9990c05615dcfa04cbcbd56bb98c1f66ac9075e15eeea2b0ac4936c4a8c9187f48c9e59c9b6474bb74d3e60e68aaa
6
+ metadata.gz: d3ef966a35e5adacf0238be0a30be5d259954507e08ffd0782e0fe3b5ba088e9a3535d22eb0377a3a15aa4393a157b8784184ec0d239af2d1268a8c09265c678
7
+ data.tar.gz: 6bde0ed1d2b918db22c0bf012d982e763a0f0aa01bcc20728d13bd20f040c3d690e39b8ddb5dc188654575166b633dedce607497c413906cb0fe5d2e113e486a
@@ -224,9 +224,8 @@ module RelatonIso
224
224
  # @param status [String]
225
225
  # @return [Hash]
226
226
  def fetch_status(doc)
227
- stg, substg = doc.css(
228
- "li.dropdown.active span.stage-code > strong"
229
- ).text.split "."
227
+ stg, substg = doc.at("//ul[@class='dropdown-menu']/li[@class='active']/a/span[@class='stage-code']")
228
+ .text.split "."
230
229
  RelatonBib::DocumentStatus.new(stage: stg, substage: substg)
231
230
  end
232
231
 
@@ -260,20 +259,15 @@ module RelatonIso
260
259
  # @param doc [Nokogiri::HTML::Document]
261
260
  # @return [Array<Hash>]
262
261
  def fetch_relations(doc) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
263
- doc.css("ul.steps li").reduce([]) do |a, r| # rubocop:disable Metrics/BlockLength
264
- r_type = r.css("strong").text
262
+ doc.xpath("//ul[@class='steps']/li", "//div[@class='sub-step']").reduce([]) do |a, r|
263
+ r_type = r.at("h4", "h5").text
265
264
  date = []
266
265
  type = case r_type
267
266
  when "Previously", "Will be replaced by" then "obsoletes"
268
- when "Corrigenda/Amendments", "Revised by", "Now confirmed"
269
- on = doc.xpath(
270
- '//span[@class="stage-date"][contains(., "-")]'
271
- ).last
272
- if on
273
- date << { type: "circulated",
274
- on: on.text }
275
- "updates"
276
- end
267
+ when "Corrigenda / Amendments", "Revised by", "Now confirmed"
268
+ on = doc.xpath('//span[@class="stage-date"][contains(., "-")]').last
269
+ date << { type: "circulated", on: on.text } if on
270
+ "updates"
277
271
  else r_type
278
272
  end
279
273
  if ["Now", "Now under review"].include?(type) then a
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.7.1"
4
+ VERSION = "1.7.2"
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.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-08 00:00:00.000000000 Z
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug