relaton-gb 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +4 -4
- data/lib/relaton_gb/gb_scrapper.rb +2 -2
- data/lib/relaton_gb/sec_scrapper.rb +4 -4
- data/lib/relaton_gb/t_scrapper.rb +2 -2
- data/lib/relaton_gb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4e69b280feec6fc57080ce2aaf460c9507a0b1c0
|
4
|
+
data.tar.gz: 1d3f1c676a45d4cec8fce6c087ca484fff8b2e88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1521c046639e88565f43ec1fa50efe49d9529c5fcba23a438a3a7b07a97f932806919b06a7eb07554b56abf36a34b9af623be31ee83b234eb40d521eaae799ff
|
7
|
+
data.tar.gz: cc49fc4fee5b18244538b9d2439e6914617a79b0c6313b517156825680cc7064ec08339a373b96d1f2f6d95dba1a3d75a38f450b8bf4e8e22021758ce5199965
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
relaton-gb (0.5.
|
4
|
+
relaton-gb (0.5.1)
|
5
5
|
cnccs (~> 0.1.1)
|
6
6
|
gb-agencies (~> 0.0.1)
|
7
7
|
relaton-iso-bib (~> 0.2.0)
|
@@ -34,12 +34,12 @@ GEM
|
|
34
34
|
pry-byebug (3.7.0)
|
35
35
|
byebug (~> 11.0)
|
36
36
|
pry (~> 0.10)
|
37
|
-
public_suffix (3.1.
|
37
|
+
public_suffix (3.1.1)
|
38
38
|
rake (10.5.0)
|
39
|
-
relaton-bib (0.2.
|
39
|
+
relaton-bib (0.2.3)
|
40
40
|
addressable
|
41
41
|
nokogiri (~> 1.8.4)
|
42
|
-
relaton-iso-bib (0.2.
|
42
|
+
relaton-iso-bib (0.2.3)
|
43
43
|
isoics (~> 0.1.6)
|
44
44
|
nokogiri (~> 1.8.4)
|
45
45
|
relaton-bib (~> 0.2.0)
|
@@ -24,7 +24,7 @@ module RelatonGb
|
|
24
24
|
end
|
25
25
|
HitCollection.new hits
|
26
26
|
rescue OpenURI::HTTPError, SocketError
|
27
|
-
|
27
|
+
raise RelatonBib::RequestError, "Cannot access http://www.std.gov.cn/search/stdPage"
|
28
28
|
end
|
29
29
|
|
30
30
|
# @param pid [Strin] standard's page id
|
@@ -34,7 +34,7 @@ module RelatonGb
|
|
34
34
|
doc = Nokogiri::HTML OpenURI.open_uri(src)
|
35
35
|
GbBibliographicItem.new scrapped_data(doc, src: src)
|
36
36
|
rescue OpenURI::HTTPError, SocketError
|
37
|
-
|
37
|
+
raise RelatonBib::RequestError, "Cannot access #{src}"
|
38
38
|
end
|
39
39
|
|
40
40
|
# @param doc [Nokogiri::HTML]
|
@@ -24,9 +24,9 @@ module RelatonGb
|
|
24
24
|
Hit.new pid: r["id"], title: r["STD_CODE"], scrapper: self
|
25
25
|
end
|
26
26
|
HitCollection.new hits
|
27
|
-
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
27
|
+
rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
28
28
|
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError
|
29
|
-
|
29
|
+
raise RelatonBib::RequestError, "Cannot access #{uri}"
|
30
30
|
end
|
31
31
|
|
32
32
|
# @param pid [String] standard's page id
|
@@ -36,9 +36,9 @@ module RelatonGb
|
|
36
36
|
page_uri = URI src
|
37
37
|
doc = Nokogiri::HTML Net::HTTP.get(page_uri)
|
38
38
|
GbBibliographicItem.new scrapped_data(doc, src: src)
|
39
|
-
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
39
|
+
rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
40
40
|
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError
|
41
|
-
|
41
|
+
raise RelatonBib::RequestError, "Cannot access #{src}"
|
42
42
|
end
|
43
43
|
|
44
44
|
private
|
@@ -31,7 +31,7 @@ module RelatonGb
|
|
31
31
|
end
|
32
32
|
HitCollection.new hits
|
33
33
|
rescue OpenURI::HTTPError, SocketError
|
34
|
-
|
34
|
+
raise RelatonBib::RequestError, "Cannot access http://www.ttbz.org.cn/Home/Standard"
|
35
35
|
end
|
36
36
|
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
37
37
|
|
@@ -42,7 +42,7 @@ module RelatonGb
|
|
42
42
|
doc = Nokogiri::HTML OpenURI.open_uri(src), nil, Encoding::UTF_8.to_s
|
43
43
|
GbBibliographicItem.new scrapped_data(doc, src: src)
|
44
44
|
rescue OpenURI::HTTPError, SocketError
|
45
|
-
|
45
|
+
raise RelatonBib::RequestError, "Cannot access #{src}"
|
46
46
|
end
|
47
47
|
|
48
48
|
private
|
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: 0.5.
|
4
|
+
version: 0.5.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: 2019-06-
|
11
|
+
date: 2019-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.
|
224
|
+
rubygems_version: 2.6.12
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: 'RelatonGb: retrieve Chinese GB Standards for bibliographic use using the
|