async-http 0.27.11 → 0.27.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/http/reference.rb +28 -13
- data/lib/async/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e4a81ab67692b966aef86492f75e25c9f3c093ae078e6d3701c069b61d02a5a
|
4
|
+
data.tar.gz: 140a56db38dbf62a43283e5b6a039aee3d6b348256df9d4104059de23fcbd139
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3756b85c1f83898b82af77f7b53b2ff31713a3b0892c01a9254c47ed5a30f81417034b4e3f84fae5c0f97b9970a5c9016210fab14ed221ff1fa213c562fe8a2
|
7
|
+
data.tar.gz: dbe91193b18dc5bc1b6d20092c91cbebf52c8dfd40d495ab1d69db61caab13c485d9aea0bf439c68f71c1e874804a632dce4c05bd162d0a1bf4d8cd8981c1276
|
data/lib/async/http/reference.rb
CHANGED
@@ -57,16 +57,28 @@ module Async
|
|
57
57
|
# User supplied parameters that will be appended to the query part.
|
58
58
|
attr :parameters
|
59
59
|
|
60
|
+
def parameters?
|
61
|
+
@parameters and !@parameters.empty?
|
62
|
+
end
|
63
|
+
|
64
|
+
def query_string?
|
65
|
+
@query_string and !@query_string.empty?
|
66
|
+
end
|
67
|
+
|
68
|
+
def fragment?
|
69
|
+
@fragment and !@fragment.empty?
|
70
|
+
end
|
71
|
+
|
60
72
|
def append(buffer)
|
61
|
-
if
|
62
|
-
buffer << escape_path(@path) << '?' << query_string
|
63
|
-
buffer << '&' << encode(@parameters) if
|
73
|
+
if query_string?
|
74
|
+
buffer << escape_path(@path) << '?' << @query_string
|
75
|
+
buffer << '&' << encode(@parameters) if parameters?
|
64
76
|
else
|
65
77
|
buffer << escape_path(@path)
|
66
|
-
buffer << '?' << encode(@parameters) if
|
78
|
+
buffer << '?' << encode(@parameters) if parameters?
|
67
79
|
end
|
68
80
|
|
69
|
-
if
|
81
|
+
if fragment?
|
70
82
|
buffer << '#' << escape(@fragment)
|
71
83
|
end
|
72
84
|
|
@@ -95,10 +107,12 @@ module Async
|
|
95
107
|
end
|
96
108
|
|
97
109
|
def dup(path = nil, parameters = nil)
|
98
|
-
if
|
99
|
-
|
100
|
-
|
101
|
-
|
110
|
+
if @parameters
|
111
|
+
if parameters
|
112
|
+
parameters = @parameters.merge(parameters)
|
113
|
+
else
|
114
|
+
parameters = @parameters
|
115
|
+
end
|
102
116
|
end
|
103
117
|
|
104
118
|
if path
|
@@ -154,18 +168,19 @@ module Async
|
|
154
168
|
def encode(value, prefix = nil)
|
155
169
|
case value
|
156
170
|
when Array
|
157
|
-
value.map { |v|
|
171
|
+
return value.map { |v|
|
158
172
|
encode(v, "#{prefix}[]")
|
159
173
|
}.join("&")
|
160
174
|
when Hash
|
161
|
-
value.map { |k, v|
|
175
|
+
return value.map { |k, v|
|
162
176
|
encode(v, prefix ? "#{prefix}[#{escape(k.to_s)}]" : escape(k.to_s))
|
163
177
|
}.reject(&:empty?).join('&')
|
164
178
|
when nil
|
165
|
-
prefix
|
179
|
+
return prefix
|
166
180
|
else
|
167
181
|
raise ArgumentError, "value must be a Hash" if prefix.nil?
|
168
|
-
|
182
|
+
|
183
|
+
return "#{prefix}=#{escape(value.to_s)}"
|
169
184
|
end
|
170
185
|
end
|
171
186
|
end
|
data/lib/async/http/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|