csdn-tire 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tire/configuration.rb +4 -0
- data/lib/tire/http/client.rb +5 -1
- data/lib/tire/version.rb +1 -1
- metadata +4 -4
data/lib/tire/configuration.rb
CHANGED
data/lib/tire/http/client.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
+
require 'timeout'
|
2
3
|
module Tire
|
3
4
|
|
4
5
|
module HTTP
|
5
6
|
|
6
7
|
module Client
|
8
|
+
class RequestTimeout < Timeout::Error ; end
|
7
9
|
|
8
10
|
class RestClient
|
9
11
|
ConnectionExceptions = [::RestClient::ServerBrokeConnection, ::RestClient::RequestTimeout]
|
@@ -51,7 +53,9 @@ module Tire
|
|
51
53
|
private
|
52
54
|
|
53
55
|
def self.perform(response)
|
54
|
-
|
56
|
+
timeout(Configuration.timeout_sec, RequestTimeout) do
|
57
|
+
Response.new response.body, response.code, response.headers
|
58
|
+
end
|
55
59
|
end
|
56
60
|
|
57
61
|
end
|
data/lib/tire/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csdn-tire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 2
|
10
|
+
version: 0.7.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Hooopo
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-06-
|
18
|
+
date: 2012-06-27 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|