relaton-ietf 0.5.2 → 0.5.3

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
2
  SHA1:
3
- metadata.gz: 2bd64e2b1b82c30517ced0edbee51f15dda6728f
4
- data.tar.gz: 56732d86da2fd04bd72dc7488afd86e39601f938
3
+ metadata.gz: c466ba7bce25f026ebb9b4d0b3bff3834eb19bb3
4
+ data.tar.gz: e010c6fd8b813b5f2a5a1f69d20c2a61f58aefbc
5
5
  SHA512:
6
- metadata.gz: '0882fd199bf6ddce5e07bf4fe814b2452f53b05c9dc977c0b847aa8483219f78fc8e80c69c2e667ce7a59446df654f4a0199d994cf206709063b43b9dca994ee'
7
- data.tar.gz: 3cecef4a8412ba5477e74e784593b727646e3cbe4f08d9dc9a448991bc4ec6f44761a8bcc9a4e68d56b7df15532851f0c83458c68bca7ab07b2ce67e92a5fd81
6
+ metadata.gz: 1cff20bb38d967bef880108fea4e92b9f5fb47a2de68b224da1d05dc0663bf7f184834270343e51bab822b8a6d957bc3abd62ada4a60340eb96c15abaa697f85
7
+ data.tar.gz: 204ed7490cb37921bfa2e5bb0b2cd7673c81845a064a54018d5858fa8b7f7a29e357961e27118116b2deb2b54ec3f8fb71bb6a422c780edcb4107ba5dbb9d1ea
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-ietf (0.5.2)
4
+ relaton-ietf (0.5.3)
5
5
  relaton-iso-bib (~> 0.2.0)
6
6
 
7
7
  GEM
@@ -33,12 +33,12 @@ GEM
33
33
  pry-byebug (3.7.0)
34
34
  byebug (~> 11.0)
35
35
  pry (~> 0.10)
36
- public_suffix (3.1.0)
36
+ public_suffix (3.1.1)
37
37
  rake (10.5.0)
38
- relaton-bib (0.2.1)
38
+ relaton-bib (0.2.3)
39
39
  addressable
40
40
  nokogiri (~> 1.8.4)
41
- relaton-iso-bib (0.2.2)
41
+ relaton-iso-bib (0.2.3)
42
42
  isoics (~> 0.1.6)
43
43
  nokogiri (~> 1.8.4)
44
44
  relaton-bib (~> 0.2.0)
@@ -30,26 +30,24 @@ module RelatonIetf
30
30
  uri = ID_URI_PATTERN.dup
31
31
  doctype = "internet-draft"
32
32
  else
33
- warn "#{ref}: not recognised for RFC"
34
- return
33
+ raise RelatonBib::RequestError, "#{ref}: not recognised for RFC"
35
34
  end
36
35
 
37
36
  uri = uri.gsub("CODE", ref)
38
- begin
39
- res = Net::HTTP.get_response(URI(uri))
40
- if res.code != "200"
41
- warn "No document found at #{uri}"
42
- return
43
- end
44
- doc = Nokogiri::HTML Net::HTTP.get(URI(uri))
45
- reference = doc.at("//reference")
46
- return unless reference
47
-
48
- bib_item reference, doctype
49
- rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
50
- Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError
51
- warn "No document found at #{uri}"
37
+ res = Net::HTTP.get_response(URI(uri))
38
+ if res.code != "200"
39
+ raise RelatonBib::RequestError, "No document found at #{uri}"
52
40
  end
41
+
42
+ doc = Nokogiri::HTML Net::HTTP.get(URI(uri))
43
+ reference = doc.at("//reference")
44
+ return unless reference
45
+
46
+ bib_item reference, doctype
47
+ rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
48
+ Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
49
+ Net::ProtocolError, SocketError
50
+ raise RelatonBib::RequestError, "No document found at #{uri}"
53
51
  end
54
52
 
55
53
  # rubocop:disable Metrics/MethodLength
@@ -1,3 +1,3 @@
1
1
  module RelatonIetf
2
- VERSION = "0.5.2".freeze
2
+ VERSION = "0.5.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
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-21 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