relaton-gb 1.12.0 → 1.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_gb/gb_scrapper.rb +1 -1
- data/lib/relaton_gb/hash_converter.rb +2 -2
- data/lib/relaton_gb/hit.rb +3 -3
- data/lib/relaton_gb/scrapper.rb +1 -3
- data/lib/relaton_gb/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: 2428a14a41dedaa3593734a0af63e49d959468b60d0ee6f7c9671f5a554d42d2
|
4
|
+
data.tar.gz: 4b7080ea176fa7f02630faf497e3acce7ed1478f61bc75468599f055affcc359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d58812cd6f9b8789d3d4496fc82ad544ff7d02b33a762efc45e4d46b15fde5726197fa7f5fa0b9cd3d3ea84a2e7d3578a94cdb3d995bd3c76799f66cdfdc2b6
|
7
|
+
data.tar.gz: 7a4ccde3cb418d0a70354b14f26e3a13a2b019b9778de10e23985b5e626e7c85d073826ffe17131f260f4a2eb8c78c67f5162db2083d7a42a37763f972e41eb9
|
@@ -47,7 +47,7 @@ module RelatonGb
|
|
47
47
|
# * :type [String]
|
48
48
|
# * :name [String]
|
49
49
|
def get_committee(doc, _ref)
|
50
|
-
name = doc.at("//div[contains(
|
50
|
+
name = doc.at("//div[contains(., '归口单位') or contains(., '归口部门')]/following-sibling::div")
|
51
51
|
{ type: "technical", name: name.text.delete("\r\n\t\t") }
|
52
52
|
end
|
53
53
|
end
|
@@ -27,8 +27,8 @@ module RelatonGb
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def ccs_hash_to_bib(ret)
|
30
|
-
ret[:ccs] = array(ret[:ccs]).map do |ccs|
|
31
|
-
ccs[:code]
|
30
|
+
ret[:ccs] = RelatonBib.array(ret[:ccs]).map do |ccs|
|
31
|
+
(ccs[:code] && Cnccs.fetch(ccs[:code])) || Cnccs.fetch(ccs)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
data/lib/relaton_gb/hit.rb
CHANGED
@@ -38,9 +38,9 @@ module RelatonGb
|
|
38
38
|
|
39
39
|
# @return [String]
|
40
40
|
def inspect
|
41
|
-
"<#{self.class}:#{format('%<id>#.14x', id: object_id << 1)} "\
|
42
|
-
|
43
|
-
|
41
|
+
"<#{self.class}:#{format('%<id>#.14x', id: object_id << 1)} " \
|
42
|
+
"@fullIdentifier=\"#{@fetch&.shortref}\" " \
|
43
|
+
"@docref=\"#{docref}\">"
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
data/lib/relaton_gb/scrapper.rb
CHANGED
@@ -14,12 +14,11 @@ module RelatonGb
|
|
14
14
|
|
15
15
|
@prefixes = nil
|
16
16
|
|
17
|
-
# rubocop:disable Metrics/MethodLength
|
18
17
|
# @param doc [Nokogiri::HTML::Document]
|
19
18
|
# @param src [String]
|
20
19
|
# @param hit [RelatonGb::Hit]
|
21
20
|
# @return [Hash]
|
22
|
-
def scrapped_data(doc, src, hit)
|
21
|
+
def scrapped_data(doc, src, hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
23
22
|
{
|
24
23
|
fetched: Date.today.to_s,
|
25
24
|
committee: get_committee(doc, hit.docref),
|
@@ -38,7 +37,6 @@ module RelatonGb
|
|
38
37
|
structuredidentifier: fetch_structuredidentifier(hit.docref),
|
39
38
|
}
|
40
39
|
end
|
41
|
-
# rubocop:enable Metrics/MethodLength
|
42
40
|
|
43
41
|
# @param docref [String]
|
44
42
|
# @return [Array<RelatonBib::DocumentIdentifier>]
|
data/lib/relaton_gb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-gb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.1
|
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-
|
11
|
+
date: 2022-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|