net_http_timeout_errors 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +12 -12
- data/lib/net_http_timeout_errors/version.rb +1 -1
- data/lib/net_http_timeout_errors.rb +1 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2257d7a61091108b0cdf87824e8a359351ac5c3d3db8724afbbfc2253ade4e67
|
4
|
+
data.tar.gz: b7af314489fb35c28af796e59b7a0a5f179c3516227ca2ba8c5b92795b13df40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f19b8708758801d0104ca00759215ed597ce1049b21389d03235ccc3323afe436804588d31323a5aa6df1cc55d41d267b6ae41f7898c4f438e1404ddb26a9b1
|
7
|
+
data.tar.gz: 2359dbe952b54f8e7f03097ea493c112bc441da9f4459f0c647954228e4ce5b0896d76c79a8b98f9fe61b8243beb8ac5b022c3bebba74d972a2371fb819783a8
|
data/README.md
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
# NetHttpTimeoutErrors
|
2
2
|
|
3
|
-
|
3
|
+
Whether you use Net::HTTP or some higher abstraction like HTTParty, are you tired of having to rescue an ever-growing list of Net::HTTP timeout error types?
|
4
4
|
|
5
5
|
Just load this gem and then do:
|
6
6
|
|
7
7
|
``` ruby
|
8
8
|
begin
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
rescue NetHttpTimeoutError
|
9
|
+
uri = URI.parse("http://google.com/")
|
10
|
+
response = Net::HTTP.get_response(uri)
|
11
|
+
rescue *NetHttpTimeoutErrors.all
|
14
12
|
puts "It timed out some way or other!"
|
13
|
+
rescue AnotherError, *NetHttpTimeoutErrors.all
|
14
|
+
puts "This works too."
|
15
15
|
end
|
16
16
|
```
|
17
17
|
|
18
|
-
Or if you
|
18
|
+
Or if you prefer:
|
19
19
|
|
20
20
|
``` ruby
|
21
21
|
begin
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
NetHttpTimeoutErrors.conflate do
|
23
|
+
uri = URI.parse("http://google.com/")
|
24
|
+
response = Net::HTTP.get_response(uri)
|
25
|
+
end
|
26
|
+
rescue NetHttpTimeoutError
|
25
27
|
puts "It timed out some way or other!"
|
26
|
-
rescue AnotherError, *NetHttpTimeoutErrors.all
|
27
|
-
puts "This works too."
|
28
28
|
end
|
29
29
|
```
|
30
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net_http_timeout_errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrik Nyh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -71,8 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
|
-
|
75
|
-
rubygems_version: 2.6.11
|
74
|
+
rubygems_version: 3.0.2
|
76
75
|
signing_key:
|
77
76
|
specification_version: 4
|
78
77
|
summary: Provides a list of Net::HTTP timeout errors.
|