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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 57acf797dbf9c94d3e313583c955ec19a3ca70a8
4
- data.tar.gz: ef9ec2fa9e115b7ca41412a1bcb46187b77bc567
2
+ SHA256:
3
+ metadata.gz: 2257d7a61091108b0cdf87824e8a359351ac5c3d3db8724afbbfc2253ade4e67
4
+ data.tar.gz: b7af314489fb35c28af796e59b7a0a5f179c3516227ca2ba8c5b92795b13df40
5
5
  SHA512:
6
- metadata.gz: e9f379110519981170abd74f03e02e039aab330e134bb18c2e03fb25c4c8311348264a52a7e7cbfb8f1b2c559e8d59ffd28288eafdb99d206c5bab3eeda8a4b5
7
- data.tar.gz: cf1fd33ea834afe2690d05c5288171f69168066988337a61442912a6b5df6fbec616d4905e36c8d40e56c76bc78291756fd5a653181b0de916e853daa8c9430c
6
+ metadata.gz: 6f19b8708758801d0104ca00759215ed597ce1049b21389d03235ccc3323afe436804588d31323a5aa6df1cc55d41d267b6ae41f7898c4f438e1404ddb26a9b1
7
+ data.tar.gz: 2359dbe952b54f8e7f03097ea493c112bc441da9f4459f0c647954228e4ce5b0896d76c79a8b98f9fe61b8243beb8ac5b022c3bebba74d972a2371fb819783a8
data/README.md CHANGED
@@ -1,30 +1,30 @@
1
1
  # NetHttpTimeoutErrors
2
2
 
3
- Tired of having to rescue an ever-growing list of Net::HTTP timeout error types?
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
- NetHttpTimeoutErrors.conflate do
10
- uri = URI.parse("http://google.com/")
11
- response = Net::HTTP.get_response(uri)
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 like:
18
+ Or if you prefer:
19
19
 
20
20
  ``` ruby
21
21
  begin
22
- uri = URI.parse("http://google.com/")
23
- response = Net::HTTP.get_response(uri)
24
- rescue *NetHttpTimeoutErrors.all
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
 
@@ -1,3 +1,3 @@
1
1
  class NetHttpTimeoutErrors
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
@@ -22,6 +22,7 @@ class NetHttpTimeoutErrors
22
22
  Errno::ETIMEDOUT,
23
23
  Net::HTTPBadResponse,
24
24
  Net::HTTPHeaderSyntaxError,
25
+ Net::HTTPServiceUnavailable,
25
26
  Net::ProtocolError,
26
27
  Net::ReadTimeout,
27
28
  SocketError,
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.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: 2018-07-17 00:00:00.000000000 Z
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
- rubyforge_project:
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.