http-request 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/http-request/client.rb +5 -1
- data/lib/http-request/version.rb +1 -1
- metadata +2 -2
data/lib/http-request/client.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module HttpRequest
|
2
2
|
class Client
|
3
|
-
attr_reader :connections, :options
|
3
|
+
attr_reader :connections, :options, :open_url
|
4
4
|
|
5
5
|
# Syntax sugar to manage clients in the current thread
|
6
6
|
def self.pool(key, options={})
|
@@ -18,6 +18,9 @@ module HttpRequest
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def open(url)
|
21
|
+
# Set default url..
|
22
|
+
@open_url ||= url
|
23
|
+
|
21
24
|
# Let's close any dead connections as we open new ones
|
22
25
|
cleanup_dead_connections!
|
23
26
|
|
@@ -44,6 +47,7 @@ module HttpRequest
|
|
44
47
|
[:get, :post, :put, :delete, :head].each do |verb|
|
45
48
|
define_method(verb) do |*args|
|
46
49
|
url, headers, body = args
|
50
|
+
url ||= open_url
|
47
51
|
request(verb, url, headers || {}, body)
|
48
52
|
end
|
49
53
|
end
|
data/lib/http-request/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|