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 +4 -4
- data/Gemfile.lock +4 -4
- data/lib/relaton_ietf/scrapper.rb +14 -16
- data/lib/relaton_ietf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c466ba7bce25f026ebb9b4d0b3bff3834eb19bb3
|
4
|
+
data.tar.gz: e010c6fd8b813b5f2a5a1f69d20c2a61f58aefbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
36
|
+
public_suffix (3.1.1)
|
37
37
|
rake (10.5.0)
|
38
|
-
relaton-bib (0.2.
|
38
|
+
relaton-bib (0.2.3)
|
39
39
|
addressable
|
40
40
|
nokogiri (~> 1.8.4)
|
41
|
-
relaton-iso-bib (0.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
|
-
|
34
|
-
return
|
33
|
+
raise RelatonBib::RequestError, "#{ref}: not recognised for RFC"
|
35
34
|
end
|
36
35
|
|
37
36
|
uri = uri.gsub("CODE", ref)
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
data/lib/relaton_ietf/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|