http2 0.0.6 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/http2.gemspec +2 -2
- data/lib/http2.rb +4 -2
- data/spec/http2_spec.rb +4 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.9
|
data/http2.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{http2}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kasper Johansen"]
|
12
|
-
s.date = %q{2012-08-
|
12
|
+
s.date = %q{2012-08-13}
|
13
13
|
s.description = %q{A lightweight framework for doing http-connections in Ruby. Supports cookies, keep-alive, compressing and much more.}
|
14
14
|
s.email = %q{k@spernj.org}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/http2.rb
CHANGED
@@ -274,6 +274,8 @@ class Http2
|
|
274
274
|
elsif pdata.is_a?(Array)
|
275
275
|
count = 0
|
276
276
|
pdata.each do |val|
|
277
|
+
praw << "&" if praw != ""
|
278
|
+
|
277
279
|
if args and args[:orig_key]
|
278
280
|
key = "#{args[:orig_key]}[#{count}]"
|
279
281
|
else
|
@@ -531,11 +533,11 @@ class Http2
|
|
531
533
|
return http.get(url)
|
532
534
|
end
|
533
535
|
elsif resp.args[:code].to_s == "500"
|
534
|
-
err = Http2::Errors::Internalserver.new
|
536
|
+
err = Http2::Errors::Internalserver.new(resp.body)
|
535
537
|
err.response = resp
|
536
538
|
raise err
|
537
539
|
elsif resp.args[:code].to_s == "403"
|
538
|
-
err = Http2::Errors::Noaccess.new
|
540
|
+
err = Http2::Errors::Noaccess.new(resp.body)
|
539
541
|
err.response = resp
|
540
542
|
raise err
|
541
543
|
else
|
data/spec/http2_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe "Http2" do
|
|
10
10
|
res = Http2.post_convert_data(
|
11
11
|
"test1" => [1, 2, 3]
|
12
12
|
)
|
13
|
-
raise "Expected 'test1%5B0%5D=
|
13
|
+
raise "Expected 'test1%5B0%5D=1&test1%5B1%5D=2&test1%5B2%5D=3' but got: '#{res}'." if res != "test1%5B0%5D=1&test1%5B1%5D=2&test1%5B2%5D=3"
|
14
14
|
|
15
15
|
res = Http2.post_convert_data(
|
16
16
|
"test1" => {
|
@@ -45,7 +45,8 @@ describe "Http2" do
|
|
45
45
|
"val8" => "test8"
|
46
46
|
}
|
47
47
|
]
|
48
|
-
}
|
48
|
+
},
|
49
|
+
"val9" => ["a", "b", "d"]
|
49
50
|
})
|
50
51
|
res = JSON.parse(resp.body)
|
51
52
|
|
@@ -55,6 +56,7 @@ describe "Http2" do
|
|
55
56
|
raise "Error 3" if !res["val3"] or res["val3"][0] != "test3"
|
56
57
|
raise "Error 4" if res["val4"]["val5"] != "test5"
|
57
58
|
raise "Error 5" if res["val6"]["val7"][0]["val8"] != "test8"
|
59
|
+
raise "Array error: '#{res["val9"]}'." if res["val9"][0] != "a" or res["val9"][1] != "b" or res["val9"][2] != "d"
|
58
60
|
end
|
59
61
|
end
|
60
62
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: http2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.9
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kasper Johansen
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-08-
|
13
|
+
date: 2012-08-13 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
hash:
|
110
|
+
hash: -648209720838738036
|
111
111
|
segments:
|
112
112
|
- 0
|
113
113
|
version: "0"
|