ethon 0.4.0 → 0.4.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.
- data/CHANGELOG.md +10 -1
- data/lib/ethon/easies/http.rb +1 -1
- data/lib/ethon/easies/queryable.rb +25 -11
- data/lib/ethon/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,16 @@
|
|
2
2
|
|
3
3
|
## Master
|
4
4
|
|
5
|
-
[Full Changelog](http://github.com/typhoeus/ethon/compare/v0.4.
|
5
|
+
[Full Changelog](http://github.com/typhoeus/ethon/compare/v0.4.1...master)
|
6
|
+
|
7
|
+
## 0.4.1
|
8
|
+
|
9
|
+
[Full Changelog](http://github.com/typhoeus/ethon/compare/v0.4.0...v0.4.1)
|
10
|
+
|
11
|
+
Bugfixes:
|
12
|
+
|
13
|
+
* Handle nested hash in an array in params correct
|
14
|
+
( [\#201](https://github.com/typhoeus/typhoeus/issues/201) )
|
6
15
|
|
7
16
|
## 0.4.0
|
8
17
|
|
data/lib/ethon/easies/http.rb
CHANGED
@@ -60,17 +60,16 @@ module Ethon
|
|
60
60
|
|
61
61
|
pairs = []
|
62
62
|
recursive = Proc.new do |h, prefix|
|
63
|
-
h
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
pairs << [Util.escape_zero_byte(key), Util.escape_zero_byte(v)]
|
63
|
+
case h
|
64
|
+
when Hash
|
65
|
+
h.each_pair do |k,v|
|
66
|
+
key = prefix == '' ? k : "#{prefix}[#{k}]"
|
67
|
+
pairs_for(v, key, pairs, recursive)
|
68
|
+
end
|
69
|
+
when Array
|
70
|
+
h.each_with_index do |v, i|
|
71
|
+
key = "#{prefix}[#{i}]"
|
72
|
+
pairs_for(v, key, pairs, recursive)
|
74
73
|
end
|
75
74
|
end
|
76
75
|
end
|
@@ -95,6 +94,21 @@ module Ethon
|
|
95
94
|
File.expand_path(file.path)
|
96
95
|
]
|
97
96
|
end
|
97
|
+
|
98
|
+
private
|
99
|
+
|
100
|
+
def pairs_for(v, key, pairs, recursive)
|
101
|
+
case v
|
102
|
+
when Hash
|
103
|
+
recursive.call(v, key)
|
104
|
+
when Array
|
105
|
+
recursive.call(v, key)
|
106
|
+
when File, Tempfile
|
107
|
+
pairs << [Util.escape_zero_byte(key), file_info(v)]
|
108
|
+
else
|
109
|
+
pairs << [Util.escape_zero_byte(key), Util.escape_zero_byte(v)]
|
110
|
+
end
|
111
|
+
end
|
98
112
|
end
|
99
113
|
end
|
100
114
|
end
|
data/lib/ethon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ethon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -264,7 +264,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
264
264
|
version: '0'
|
265
265
|
segments:
|
266
266
|
- 0
|
267
|
-
hash:
|
267
|
+
hash: 1338934003639649204
|
268
268
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
269
269
|
none: false
|
270
270
|
requirements:
|