emmy-extends 0.1.15 → 0.1.16

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7088fa3fafc3fdc98958ff1734a2522928fe3170
4
- data.tar.gz: b7863454fe8471690716ab1d003741af1c5dcdd4
3
+ metadata.gz: c6242a8417b5290e908926dec11edaab460494bf
4
+ data.tar.gz: 666e1a1dee20d2129886e296af08ed50708dbd66
5
5
  SHA512:
6
- metadata.gz: e10fbf26fcbed70fa700c6ef74493481da16c6a122f5851a904b6cfca0261f796adcc89e7a1947fc684416a465cf3416301a39ea15f2d335e11f01f5769d8f28
7
- data.tar.gz: 07bb371f777657cda35cdebc31bfcc90ff61eacac44dd571c02fdd9b39baed50db70d4a1ec597607c651235c06befacad09fe6e108e98fd92b42d4b1fd3dacf3
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
- @url.query = operation.request.query.is_a?(Hash) ? Encoders.query(operation.request.query) : operation.request.query.to_s if operation.request.query
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 : Encoders.www_form(form)
55
- body_text = Encoders.rfc3986(form_encoded)
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
@@ -1,3 +1,3 @@
1
1
  module EmmyExtends
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
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.15
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-05 00:00:00.000000000 Z
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: emmy-machine