httparty 0.7.6 → 0.7.7
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 httparty might be problematic. Click here for more details.
- data/History +4 -0
- data/lib/httparty/request.rb +1 -1
- data/lib/httparty/version.rb +2 -2
- data/spec/httparty/request_spec.rb +8 -1
- metadata +9 -8
data/History
CHANGED
data/lib/httparty/request.rb
CHANGED
@@ -14,7 +14,7 @@ module HTTParty
|
|
14
14
|
NON_RAILS_QUERY_STRING_NORMALIZER = Proc.new do |query|
|
15
15
|
Array(query).map do |key, value|
|
16
16
|
if value.nil?
|
17
|
-
key
|
17
|
+
key.to_s
|
18
18
|
elsif value.is_a?(Array)
|
19
19
|
value.map {|v| "#{key}=#{URI.encode(v.to_s, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))}"}
|
20
20
|
else
|
data/lib/httparty/version.rb
CHANGED
@@ -13,7 +13,7 @@ describe HTTParty::Request do
|
|
13
13
|
URI.unescape(query_string).should == "foo=bar&foo=baz"
|
14
14
|
end
|
15
15
|
|
16
|
-
context "when
|
16
|
+
context "when the query is an array" do
|
17
17
|
|
18
18
|
it "doesn't include brackets" do
|
19
19
|
query_string = normalizer[{:page => 1, :foo => %w(bar baz)}]
|
@@ -25,6 +25,13 @@ describe HTTParty::Request do
|
|
25
25
|
query_string.should == "people=Bob%20Marley&people=Tim%20%26%20Jon"
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
context "when the query is a hash" do
|
30
|
+
it "correctly handles nil values" do
|
31
|
+
query_string = normalizer[{:page => 1, :per_page => nil}]
|
32
|
+
query_string.should == "page=1&per_page"
|
33
|
+
end
|
34
|
+
end
|
28
35
|
end
|
29
36
|
|
30
37
|
describe "initialization" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 13
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 7
|
10
|
+
version: 0.7.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Nunemaker
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-04-
|
19
|
+
date: 2011-04-20 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -103,12 +103,13 @@ dependencies:
|
|
103
103
|
requirements:
|
104
104
|
- - "="
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
hash:
|
106
|
+
hash: 1923831981
|
107
107
|
segments:
|
108
108
|
- 1
|
109
109
|
- 2
|
110
110
|
- 0
|
111
|
-
-
|
111
|
+
- pre
|
112
|
+
- 2
|
112
113
|
version: 1.2.0.pre2
|
113
114
|
type: :development
|
114
115
|
version_requirements: *id006
|
@@ -222,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
223
|
requirements: []
|
223
224
|
|
224
225
|
rubyforge_project:
|
225
|
-
rubygems_version: 1.
|
226
|
+
rubygems_version: 1.4.2
|
226
227
|
signing_key:
|
227
228
|
specification_version: 3
|
228
229
|
summary: Makes http fun! Also, makes consuming restful web services dead easy.
|