net_dav 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/net/dav.rb +6 -4
  3. data/net_dav.gemspec +2 -2
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
data/lib/net/dav.rb CHANGED
@@ -167,8 +167,8 @@ module Net #:nodoc:
167
167
  end
168
168
  def clone_req(path, req, headers)
169
169
  new_req = req.class.new(path)
170
- new_req.body = req.body
171
- new_req.body_stream = req.body_stream
170
+ new_req.body = req.body if req.body
171
+ new_req.body_stream = req.body_stream if req.body_stream
172
172
  headers.each_pair { |key, value| new_req[key] = value } if headers
173
173
  return new_req
174
174
  end
@@ -259,8 +259,10 @@ module Net #:nodoc:
259
259
  end
260
260
  curl.perform
261
261
  unless curl.response_code >= 200 && curl.response_code < 300
262
- headers = curl.header_str.split(/\r?\n/)
263
- raise Exception.new("Curl response #{headers[0]}")
262
+ header_block = curl.header_str.split(/\r?\n\r?\n/)[-1]
263
+ msg = header_block.split(/\r?\n/)[0]
264
+ msg.gsub!(/^HTTP\/\d+.\d+ /, '')
265
+ raise Net::HTTPError.new(msg, nil)
264
266
  end
265
267
  curl.body_str
266
268
  end
data/net_dav.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{net_dav}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Miron Cuperman"]
12
- s.date = %q{2009-11-04}
12
+ s.date = %q{2009-11-17}
13
13
  s.default_executable = %q{dav}
14
14
  s.description = %q{WebDAV client library in the style of Net::HTTP}
15
15
  s.email = %q{c1.github@niftybox.net}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net_dav
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miron Cuperman
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-04 00:00:00 -08:00
12
+ date: 2009-11-17 00:00:00 -08:00
13
13
  default_executable: dav
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency