http-request 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module HttpRequest
2
- VERSION = '1.1.4'
2
+ VERSION = '1.1.5'
3
3
  end
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
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-14 00:00:00.000000000 Z
12
+ date: 2012-08-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable