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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 7337db6b351d1c54686af5435d60d0dbcb0252f20a5deac552df24c7a6685483
4
- data.tar.gz: 3af213bc191141fdd23823e4623166fd96b574296f0512f266104f5a20c53d1f
2
+ SHA1:
3
+ metadata.gz: 4e69b280feec6fc57080ce2aaf460c9507a0b1c0
4
+ data.tar.gz: 1d3f1c676a45d4cec8fce6c087ca484fff8b2e88
5
5
  SHA512:
6
- metadata.gz: f5c4ef47e28f7557e9d2e9f34abefb9e97ea8dd245f35d3e4cbea9d5e0fbe6f9acbed34abf9a4070f7d4691498f7b3d7fff560923d8e57398656495fa1e4621b
7
- data.tar.gz: ffea63c0ca48c925e7226e12623fcecd02c48e8cc2de15076947f72c77cecbf9375ea95c0547cfb282116e5dbbf3d9c2c68e312cd6a6109a1805a7d06cc0faed
6
+ metadata.gz: 1521c046639e88565f43ec1fa50efe49d9529c5fcba23a438a3a7b07a97f932806919b06a7eb07554b56abf36a34b9af623be31ee83b234eb40d521eaae799ff
7
+ data.tar.gz: cc49fc4fee5b18244538b9d2439e6914617a79b0c6313b517156825680cc7064ec08339a373b96d1f2f6d95dba1a3d75a38f450b8bf4e8e22021758ce5199965
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-gb (0.5.0)
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.0)
37
+ public_suffix (3.1.1)
38
38
  rake (10.5.0)
39
- relaton-bib (0.2.0)
39
+ relaton-bib (0.2.3)
40
40
  addressable
41
41
  nokogiri (~> 1.8.4)
42
- relaton-iso-bib (0.2.0)
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
- warn "Cannot access http://www.std.gov.cn/search/stdPage"
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
- warn "Cannot access http://www.std.gov.cn/gb/search/gbDetailed"
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
- warn "Cannot access #{uri}"
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
- warn "Cannot access #{src}"
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
- warn "Cannot access http://www.ttbz.org.cn/Home/Standard"
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
- warn "Cannot access #{src}"
45
+ raise RelatonBib::RequestError, "Cannot access #{src}"
46
46
  end
47
47
 
48
48
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonGb
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
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.0
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-15 00:00:00.000000000 Z
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.7.6
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