httpi 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gemtest ADDED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
+ ## 0.9.1 (2011-04-04)
2
+
3
+ * Fix: [issue 25](https://github.com/rubiii/httpi/issues/22) problem with HTTPI using the Net::HTTP adapter [hakanensari].
4
+
1
5
  ## 0.9.0 (2011-03-08)
2
6
 
3
- * Feature: improved the adapter loading process ([d4a091](https://github.com/rubiii/savon/commit/d4a091)) [rubiii].
7
+ * Feature: improved the adapter loading process ([d4a091](https://github.com/rubiii/httpi/commit/d4a091)) [rubiii].
4
8
 
5
9
  Instead of using HTTPClient as the default and falling back to NetHTTP, the loading process now does the following:
6
10
 
@@ -18,15 +22,15 @@
18
22
 
19
23
  ## 0.8.0 (2011-03-07)
20
24
 
21
- * Feature: added support for NTLM authentication ([96ceb1](https://github.com/rubiii/savon/commit/96ceb1)) [MattHall].
25
+ * Feature: added support for NTLM authentication ([96ceb1](https://github.com/rubiii/httpi/commit/96ceb1)) [MattHall].
22
26
 
23
27
  You should now be able to use NTLM authentication by specifying your credentials via `HTTPI::Auth::Config#ntlm`:
24
28
 
25
29
  request = HTTPI::Request.new
26
30
  request.auth.ntlm "username", "password"
27
31
 
28
- * Improvement: changed the default log level to :warn ([d01591](https://github.com/rubiii/savon/commit/d01591))
29
- and log at appropriate levels ([21ee1b](https://github.com/rubiii/savon/commit/21ee1b)) [ichverstehe].
32
+ * Improvement: changed the default log level to :warn ([d01591](https://github.com/rubiii/httpi/commit/d01591))
33
+ and log at appropriate levels ([21ee1b](https://github.com/rubiii/httpi/commit/21ee1b)) [ichverstehe].
30
34
 
31
35
  * Fix: [issue 18](https://github.com/rubiii/httpi/issues/18) don't mask exceptions in decoded_gzip_body
32
- ([f3811b](https://github.com/rubiii/savon/commit/f3811b)) [fj].
36
+ ([f3811b](https://github.com/rubiii/httpi/commit/f3811b)) [fj].
data/README.md CHANGED
@@ -25,7 +25,7 @@ Here's a POST request with a request object:
25
25
  request = HTTPI::Request.new
26
26
  request.url = "http://post.example.com"
27
27
  request.body = "send me"
28
-
28
+
29
29
  HTTPI.post request
30
30
 
31
31
  And a GET request using HTTP basic auth and the Curb adapter:
@@ -33,7 +33,7 @@ And a GET request using HTTP basic auth and the Curb adapter:
33
33
  request = HTTPI::Request.new
34
34
  request.url = "http://auth.example.com"
35
35
  request.auth.basic "username", "password"
36
-
36
+
37
37
  HTTPI.get request, :curb
38
38
 
39
39
  HTTPI also comes shortcuts. This executes a PUT request:
@@ -98,11 +98,14 @@ It currently contains adapters for:
98
98
  * [curb](http://rubygems.org/gems/curb) ~> 0.7.8
99
99
  * [net/http](http://ruby-doc.org/stdlib/libdoc/net/http/rdoc)
100
100
 
101
- By default, HTTPI uses the `HTTPClient` adapter. But changing the default is fairly easy:
101
+ You can manually specify the adapter to use via:
102
102
 
103
103
  HTTPI::Adapter.use = :curb # or one of [:httpclient, :net_http]
104
104
 
105
- Notice: HTTPI does not force you to install any of these libraries. So please make sure to install the HTTP library of your choice and/or add it to your Gemfile. HTTPI will then load the library when executing HTTP requests. HTTPI will fall back to using net/http when any other adapter could not be loaded.
105
+ If you don't specify which adapter to use, HTTPI try to load HTTPClient, then Curb and finally NetHTTP.
106
+
107
+ Notice: HTTPI does not force you to install any of these libraries. If you'd like to use on of the more advanced libraries (HTTPClient or Curb),
108
+ you have to make sure they're in your LOAD_PATH. HTTPI will then load the library when executing HTTP requests.
106
109
 
107
110
  HTTPI::Request
108
111
  --------------
@@ -131,16 +134,13 @@ HTTPI::Auth
131
134
 
132
135
  #basic(username, password) # HTTP basic auth credentials
133
136
  #digest(username, password) # HTTP digest auth credentials
137
+ #ntlm(username, password) # NTLM auth credentials
134
138
 
135
139
  ### Usage example
136
140
 
137
141
  request = HTTPI::Request.new
138
142
  request.auth.basic "username", "password"
139
143
 
140
- ### TODO
141
-
142
- * Add support for NTLM authentication
143
-
144
144
  HTTPI::Auth::SSL
145
145
  ----------------
146
146
 
@@ -166,7 +166,7 @@ As mentioned before, every request method return an `HTTPI::Response`.
166
166
  It contains the response code, headers and body.
167
167
 
168
168
  response = HTTPI.get request
169
-
169
+
170
170
  response.code # => 200
171
171
  response.headers # => { "Content-Encoding" => "gzip" }
172
172
  response.body # => "<!DOCTYPE HTML PUBLIC ...>"
data/Rakefile CHANGED
@@ -45,3 +45,4 @@ rescue LoadError
45
45
  end
46
46
 
47
47
  task :default => :spec
48
+ task :test => :spec
data/lib/httpi/adapter.rb CHANGED
@@ -50,7 +50,7 @@ module HTTPI
50
50
  def default_adapter
51
51
  return :httpclient if defined?(::HTTPClient)
52
52
  return :curb if defined?(::Curl::Easy)
53
- return :net_http if defined?(::NetHTTP)
53
+ return :net_http if defined?(::Net::HTTP)
54
54
 
55
55
  DEPENDENCIES.each do |(adapter, dependencies)|
56
56
  begin
data/lib/httpi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module HTTPI
2
2
 
3
- VERSION = "0.9.0"
3
+ VERSION = "0.9.1"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpi
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 0
10
- version: 0.9.0
9
+ - 1
10
+ version: 0.9.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Harrington
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-03-08 00:00:00 +01:00
19
+ date: 2011-04-04 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -152,6 +152,7 @@ extra_rdoc_files: []
152
152
 
153
153
  files:
154
154
  - .autotest
155
+ - .gemtest
155
156
  - .gitignore
156
157
  - .rspec
157
158
  - CHANGELOG.md
@@ -223,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
224
  requirements: []
224
225
 
225
226
  rubyforge_project: httpi
226
- rubygems_version: 1.4.1
227
+ rubygems_version: 1.4.2
227
228
  signing_key:
228
229
  specification_version: 3
229
230
  summary: Interface for Ruby HTTP libraries