httparty 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of httparty might be problematic. Click here for more details.

data/History CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.10.1 2013-01-26
2
+
3
+ * new
4
+ * [added support for MOVE requests](https://github.com/jnunemaker/httparty/pull/183)
5
+ * [bump multi xml version](https://github.com/jnunemaker/httparty/pull/181)
6
+
1
7
  == 0.10.0 2013-01-10
2
8
  * changes
3
9
  * removed yaml support because of security risk (see rails yaml issues)
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy.}
14
14
 
15
15
  s.add_dependency 'multi_json', "~> 1.0"
16
- s.add_dependency 'multi_xml'
16
+ s.add_dependency 'multi_xml', ">= 0.5.2"
17
17
 
18
18
  s.post_install_message = "When you HTTParty, you must party hard!"
19
19
 
@@ -429,6 +429,11 @@ module HTTParty
429
429
  perform_request Net::HTTP::Delete, path, options, &block
430
430
  end
431
431
 
432
+ # Perform a MOVE request to a path
433
+ def move(path, options={}, &block)
434
+ perform_request Net::HTTP::Move, path, options, &block
435
+ end
436
+
432
437
  # Perform a HEAD request to a path
433
438
  def head(path, options={}, &block)
434
439
  perform_request Net::HTTP::Head, path, options, &block
@@ -499,6 +504,10 @@ module HTTParty
499
504
  Basement.delete(*args, &block)
500
505
  end
501
506
 
507
+ def self.move(*args, &block)
508
+ Basement.move(*args, &block)
509
+ end
510
+
502
511
  def self.head(*args, &block)
503
512
  Basement.head(*args, &block)
504
513
  end
@@ -36,11 +36,11 @@ module HTTParty
36
36
  end
37
37
 
38
38
  stack.each do |parent, hash|
39
- hash.each do |key, value|
39
+ hash.each do |k, v|
40
40
  if value.is_a?(Hash)
41
- stack << ["#{parent}[#{key}]", value]
41
+ stack << ["#{parent}[#{k}]", v]
42
42
  else
43
- param << normalize_param("#{parent}[#{key}]", value)
43
+ param << normalize_param("#{parent}[#{k}]", v)
44
44
  end
45
45
  end
46
46
  end
@@ -7,7 +7,8 @@ module HTTParty
7
7
  Net::HTTP::Put,
8
8
  Net::HTTP::Delete,
9
9
  Net::HTTP::Head,
10
- Net::HTTP::Options
10
+ Net::HTTP::Options,
11
+ Net::HTTP::Move
11
12
  ]
12
13
 
13
14
  SupportedURISchemes = [URI::HTTP, URI::HTTPS, URI::Generic]
@@ -1,3 +1,3 @@
1
1
  module HTTParty
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.1"
3
3
  end
@@ -283,7 +283,7 @@ describe HTTParty::Request do
283
283
  end
284
284
 
285
285
  it "returns the HTTParty::Response when the 300 does not contain a location header" do
286
- net_response = stub_response '', 300
286
+ stub_response '', 300
287
287
  HTTParty::Response.should === @request.perform
288
288
  end
289
289
  end
@@ -358,6 +358,11 @@ describe HTTParty::Request do
358
358
  @request.perform.should == {"hash" => {"foo" => "bar"}}
359
359
  end
360
360
 
361
+ it "should be handled by MOVE transparently" do
362
+ @request.http_method = Net::HTTP::Move
363
+ @request.perform.should == {"hash" => {"foo" => "bar"}}
364
+ end
365
+
361
366
  it "should be handled by PATCH transparently" do
362
367
  @request.http_method = Net::HTTP::Patch
363
368
  @request.perform.should == {"hash" => {"foo" => "bar"}}
@@ -491,6 +491,12 @@ describe HTTParty do
491
491
  end.should raise_error(HTTParty::RedirectionTooDeep) {|e| e.response.body.should == 'first redirect'}
492
492
  end
493
493
 
494
+ it "should fail with redirected MOVE" do
495
+ lambda do
496
+ @klass.move('/foo', :no_follow => true)
497
+ end.should raise_error(HTTParty::RedirectionTooDeep) {|e| e.response.body.should == 'first redirect'}
498
+ end
499
+
494
500
  it "should fail with redirected PUT" do
495
501
  lambda do
496
502
  @klass.put('/foo', :no_follow => true)
@@ -49,7 +49,7 @@ class SSLTestServer
49
49
 
50
50
  def thread_main
51
51
  until @stopping_mutex.synchronize{ @stopping }
52
- (rr,ww,ee) = select([@ssl_server.to_io], nil, nil, 0.1)
52
+ (rr,_,_) = select([@ssl_server.to_io], nil, nil, 0.1)
53
53
 
54
54
  next unless rr && rr.include?(@ssl_server.to_io)
55
55
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httparty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-10 00:00:00.000000000 Z
13
+ date: 2013-01-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
17
- requirement: &70244756875780 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,18 +22,28 @@ dependencies:
22
22
  version: '1.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70244756875780
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: '1.0'
26
31
  - !ruby/object:Gem::Dependency
27
32
  name: multi_xml
28
- requirement: &70244756914000 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
29
34
  none: false
30
35
  requirements:
31
36
  - - ! '>='
32
37
  - !ruby/object:Gem::Version
33
- version: '0'
38
+ version: 0.5.2
34
39
  type: :runtime
35
40
  prerelease: false
36
- version_requirements: *70244756914000
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: 0.5.2
37
47
  description: Makes http fun! Also, makes consuming restful web services dead easy.
38
48
  email:
39
49
  - nunemaker@gmail.com
@@ -135,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
145
  version: '0'
136
146
  segments:
137
147
  - 0
138
- hash: -707685205189815714
148
+ hash: -1272452598560319618
139
149
  required_rubygems_version: !ruby/object:Gem::Requirement
140
150
  none: false
141
151
  requirements:
@@ -144,10 +154,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
154
  version: '0'
145
155
  segments:
146
156
  - 0
147
- hash: -707685205189815714
157
+ hash: -1272452598560319618
148
158
  requirements: []
149
159
  rubyforge_project:
150
- rubygems_version: 1.8.10
160
+ rubygems_version: 1.8.23
151
161
  signing_key:
152
162
  specification_version: 3
153
163
  summary: Makes http fun! Also, makes consuming restful web services dead easy.