relaton-gb 1.20.2 → 1.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/relaton_gb/gb_scrapper.rb +2 -3
- data/lib/relaton_gb/processor.rb +2 -1
- data/lib/relaton_gb/scrapper.rb +3 -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: f018c7b2bdd3de88295eef4a3f1443754ffdbfd70b67655a3283c473a610cc09
|
|
4
|
+
data.tar.gz: 30f02de58467dd014c5dffb88c10431a2e9e3a92999d72b9e1adab766a753f57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a33d2082e6f14c0b00e622b141699dc83aa22a6c8a7c90774c80ae9d098b53d4aad305ccf7388131083b4828688abb9a44efba2107fb4fcafb6d5e23e5e6f03
|
|
7
|
+
data.tar.gz: 8c012e61b469aea8b4965a941bad8fd1141e0d1ab0e79b55f48790a70c215e0ae0933d35cfb4ada37efd4f4289d912a7bb685a178477f8d645e980c3ad45830a
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
require "open-uri"
|
|
5
4
|
require "nokogiri"
|
|
6
5
|
require "relaton_gb/scrapper"
|
|
7
6
|
require "relaton_gb/gb_bibliographic_item"
|
|
@@ -23,7 +22,7 @@ module RelatonGb
|
|
|
23
22
|
).map do |h|
|
|
24
23
|
ref = h.at "./td[2]/a"
|
|
25
24
|
pid = ref[:onclick].match(/[0-9A-F]+/).to_s
|
|
26
|
-
rdate = h.at("./td[
|
|
25
|
+
rdate = h.at("./td[8]").text
|
|
27
26
|
Hit.new pid: pid, docref: ref.text, scrapper: self, release_date: rdate
|
|
28
27
|
end
|
|
29
28
|
HitCollection.new hits.sort_by(&:release_date).reverse
|
|
@@ -52,7 +51,7 @@ module RelatonGb
|
|
|
52
51
|
# * :name [String]
|
|
53
52
|
def get_committee(doc, _ref)
|
|
54
53
|
name = doc.at("//div[contains(., '归口单位') or contains(., '归口部门')]/following-sibling::div")
|
|
55
|
-
{ type: "technical", name: name.text.
|
|
54
|
+
{ type: "technical", name: name.text.strip }
|
|
56
55
|
end
|
|
57
56
|
end
|
|
58
57
|
end
|
data/lib/relaton_gb/processor.rb
CHANGED
|
@@ -28,7 +28,8 @@ module RelatonGb
|
|
|
28
28
|
# @param hash [Hash]
|
|
29
29
|
# @return [RelatonGb::GbBibliographicItem]
|
|
30
30
|
def hash_to_bib(hash)
|
|
31
|
-
|
|
31
|
+
item_hash = HashConverter.hash_to_bib hash
|
|
32
|
+
::RelatonGb::GbBibliographicItem.new(**item_hash)
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
# Returns hash of XML grammar
|
data/lib/relaton_gb/scrapper.rb
CHANGED
|
@@ -123,7 +123,7 @@ module RelatonGb
|
|
|
123
123
|
# @return [Array<String>]
|
|
124
124
|
def get_ccs(doc)
|
|
125
125
|
[doc.at("//div[contains(text(), '中国标准分类号')]/following-sibling::div").
|
|
126
|
-
text.
|
|
126
|
+
text.strip]
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
# @param doc [Nokogiri::HTML::Document]
|
|
@@ -136,7 +136,7 @@ module RelatonGb
|
|
|
136
136
|
" | //dt[contains(text(), '国际标准分类号')]/following-sibling::dd")
|
|
137
137
|
return [] unless ics
|
|
138
138
|
|
|
139
|
-
field, group, subgroup = ics.text.
|
|
139
|
+
field, group, subgroup = ics.text.strip.split "."
|
|
140
140
|
[{ field: field, group: group.ljust(3, "0"), subgroup: subgroup }]
|
|
141
141
|
end
|
|
142
142
|
|
|
@@ -181,7 +181,7 @@ module RelatonGb
|
|
|
181
181
|
def get_dates(doc)
|
|
182
182
|
date = doc.at("//div[contains(text(), '发布日期')]/following-sibling::div"\
|
|
183
183
|
" | //dt[contains(text(), '发布日期')]/following-sibling::dd")
|
|
184
|
-
[{ type: "published", on: date.text.
|
|
184
|
+
[{ type: "published", on: date.text.strip }]
|
|
185
185
|
end
|
|
186
186
|
end
|
|
187
187
|
end
|
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.20.
|
|
4
|
+
version: 1.20.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: 2026-
|
|
11
|
+
date: 2026-04-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cnccs
|