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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec38a35b2e9d43b66692ac792f5fe25ce130ee1687611733e086131482bac895
4
- data.tar.gz: c86f6285e1445ee5d42cb46338f791c7e7919ac09e52dbc481048784dcf8f917
3
+ metadata.gz: 1e4a81ab67692b966aef86492f75e25c9f3c093ae078e6d3701c069b61d02a5a
4
+ data.tar.gz: 140a56db38dbf62a43283e5b6a039aee3d6b348256df9d4104059de23fcbd139
5
5
  SHA512:
6
- metadata.gz: fc2b74f5f9c5e068a108bee6c3e84075e1fe0e50fe336bd5d6efdf1e4234e2b22719f9114fd5888afa866d4e54fb8c63e904d411323bb20c74685080581fbc9d
7
- data.tar.gz: 2d9f5381548d1dd443932532d69de9187fa76933f793e41c8a6f5daea4153c3f17d69fd2b1dd935834664faef2309fb8f61154989b9de398fa7fe0c61434d2c4
6
+ metadata.gz: d3756b85c1f83898b82af77f7b53b2ff31713a3b0892c01a9254c47ed5a30f81417034b4e3f84fae5c0f97b9970a5c9016210fab14ed221ff1fa213c562fe8a2
7
+ data.tar.gz: dbe91193b18dc5bc1b6d20092c91cbebf52c8dfd40d495ab1d69db61caab13c485d9aea0bf439c68f71c1e874804a632dce4c05bd162d0a1bf4d8cd8981c1276
@@ -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 @query_string
62
- buffer << escape_path(@path) << '?' << query_string
63
- buffer << '&' << encode(@parameters) if @parameters
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 @parameters
78
+ buffer << '?' << encode(@parameters) if parameters?
67
79
  end
68
80
 
69
- if @fragment
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 parameters and @parameters
99
- parameters = @parameters.merge(parameters)
100
- else
101
- parameters = @parameters
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
- "#{prefix}=#{escape(value.to_s)}"
182
+
183
+ return "#{prefix}=#{escape(value.to_s)}"
169
184
  end
170
185
  end
171
186
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.27.11"
23
+ VERSION = "0.27.12"
24
24
  end
25
25
  end
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.11
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-10 00:00:00.000000000 Z
11
+ date: 2018-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async