emmy-extends 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/emmy_extends/em_http_request/adapter.rb +6 -4
- data/lib/emmy_extends/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6242a8417b5290e908926dec11edaab460494bf
|
4
|
+
data.tar.gz: 666e1a1dee20d2129886e296af08ed50708dbd66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f99de4b888a72e7d77f312ffb178b01f892f00bc4df818e3034696b5ca0526525ce443cd4f8afd62d8dd1885a339b0a22eb314cd82995c2b31e19766bebac8c1
|
7
|
+
data.tar.gz: 230d10368caf137283d9c89f066abe53477c3cbe4289f8b894c518befcef17ffd4824e403bf685f2d76239978e4138065a02446b9d59b3f888e66f643487beb2
|
@@ -37,7 +37,9 @@ module EmmyExtends
|
|
37
37
|
end
|
38
38
|
@url.user = operation.request.user if operation.request.user
|
39
39
|
@url.password = operation.request.password if operation.request.password
|
40
|
-
|
40
|
+
if operation.request.query
|
41
|
+
@url.query = operation.request.query.is_a?(Hash) ? operation.request.query.map { |k, v| param(k, v) }.join('&') : operation.request.query.to_s
|
42
|
+
end
|
41
43
|
end
|
42
44
|
|
43
45
|
def prepare_body
|
@@ -47,12 +49,12 @@ module EmmyExtends
|
|
47
49
|
@body = if body
|
48
50
|
raise "body cannot be hash" if body.is_a?(Hash)
|
49
51
|
body_text = body.is_a?(Array) ? body.join : body.to_s
|
50
|
-
headers['Content-Length'] = body_text.bytesize
|
51
52
|
body_text
|
52
53
|
|
53
54
|
elsif form
|
54
|
-
form_encoded = form.is_a?(String) ? form :
|
55
|
-
body_text =
|
55
|
+
form_encoded = form.is_a?(String) ? form : URI.encode_www_form(form)
|
56
|
+
body_text = form_encoded.gsub(/([!'()*]+)/m) { '%'+$1.unpack('H2'*$1.bytesize).join('%').upcase }
|
57
|
+
|
56
58
|
headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
57
59
|
headers['Content-Length'] = body_text.bytesize
|
58
60
|
body_text
|
data/lib/emmy_extends/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emmy-extends
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- inre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: emmy-machine
|