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 +4 -4
- data/lib/relaton_iso/scrapper.rb +8 -14
- data/lib/relaton_iso/version.rb +1 -1
- 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: a0484edee8670c0f8b65c5f16dd01ea45e29a4ef5cdfe6dbf8372063004cee71
|
4
|
+
data.tar.gz: 571928a396258e54eda1d06de63fa115adf16ba5be19461286bddd89e443681a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3ef966a35e5adacf0238be0a30be5d259954507e08ffd0782e0fe3b5ba088e9a3535d22eb0377a3a15aa4393a157b8784184ec0d239af2d1268a8c09265c678
|
7
|
+
data.tar.gz: 6bde0ed1d2b918db22c0bf012d982e763a0f0aa01bcc20728d13bd20f040c3d690e39b8ddb5dc188654575166b633dedce607497c413906cb0fe5d2e113e486a
|
data/lib/relaton_iso/scrapper.rb
CHANGED
@@ -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.
|
228
|
-
|
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.
|
264
|
-
r_type = r.
|
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
|
-
|
271
|
-
|
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
|
data/lib/relaton_iso/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2021-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|