rest-client 1.0 → 1.0.1

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.

Potentially problematic release.


This version of rest-client might be problematic. Click here for more details.

@@ -141,7 +141,7 @@ Patches contributed by: Chris Anderson, Greg Borenstein, Ardekantur, Pedro
141
141
  Belo, Rafael Souza, Rick Olson, Aman Gupta, Blake Mizerany, Brian Donovan, Ivan
142
142
  Makfinsky, Marc-André Cournoyer, Coda Hale, Tetsuo Watanabe, Dusty Doris,
143
143
  Lennon Day-Reynolds, James Edward Gray II, Cyril Rohr, Juan Alvarez, and Adam
144
- Jacob
144
+ Jacob, and Paul Dlug
145
145
 
146
146
  Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
147
147
 
data/Rakefile CHANGED
@@ -31,7 +31,7 @@ require 'rake/gempackagetask'
31
31
  require 'rake/rdoctask'
32
32
  require 'fileutils'
33
33
 
34
- version = "1.0"
34
+ version = "1.0.1"
35
35
  name = "rest-client"
36
36
 
37
37
  spec = Gem::Specification.new do |s|
@@ -213,7 +213,7 @@ module RestClient
213
213
  end
214
214
 
215
215
  def response_log(res)
216
- size = @raw_response ? File.size(@tf.path) : res.body.size
216
+ size = @raw_response ? File.size(@tf.path) : (res.body.nil? ? 0 : res.body.size)
217
217
  "# => #{res.code} #{res.class.to_s.gsub(/^Net::HTTP/, '')} | #{(res['Content-type'] || '').gsub(/;.*$/, '')} #{size} bytes"
218
218
  end
219
219
 
@@ -278,6 +278,12 @@ describe RestClient::Request do
278
278
  @request.response_log(res).should == "# => 200 OK | 4 bytes"
279
279
  end
280
280
 
281
+ it "logs a response with a nil body" do
282
+ res = mock('result', :code => '200', :class => Net::HTTPOK, :body => nil)
283
+ res.stub!(:[]).with('Content-type').and_return('text/html; charset=utf-8')
284
+ @request.response_log(res).should == "# => 200 OK | text/html 0 bytes"
285
+ end
286
+
281
287
  it "strips the charset from the response content type" do
282
288
  res = mock('result', :code => '200', :class => Net::HTTPOK, :body => 'abcd')
283
289
  res.stub!(:[]).with('Content-type').and_return('text/html; charset=utf-8')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-client
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.0"
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Wiggins
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-28 00:00:00 -07:00
12
+ date: 2009-06-12 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15