ezclient 0.14.0 → 0.15.0

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
  SHA256:
3
- metadata.gz: dcf557ea3e57e7058976351ec931aaa365f47c962649c15b0371401ad212042d
4
- data.tar.gz: c4a20588700dfff8c863ba469467eca6a5233cb5af01796f56402306cb6c974c
3
+ metadata.gz: ec39573becaed18cf1a79fa1a85eaac6e0a3e647512065a2d82906fbc42bf689
4
+ data.tar.gz: e39d4b4fa736a3d4304e1d27084383d327c2534477b5d80a60b6786193a31778
5
5
  SHA512:
6
- metadata.gz: 736bb680cc5b2e28f9e8e6bc6ac098d9a09c6a2990b3679207f2edb3205ddf46e156652117de570f7cbdd1efa4fbaa39dbb42e40d8a94ddc55ddbb3cc96a9160
7
- data.tar.gz: e60fd674b78b707c78479be4017ffeff62c7b596d6857ff5b1eb4c24b8fa894dd13f52860fb5937f62439d4f18e3b9c7a4f071d3e5410a6c5834bbb92ac2f475
6
+ metadata.gz: 0e6a78977613cfac3506602d015a451d297160b358c1cd2ae413f42ff490d52fb8eac908c929063aba4ec6a01f855a97687e7b9dd35a85ce461fddd8eb6b9cb2
7
+ data.tar.gz: d5c70726fa56ddbbeb664f182396aeb477a2ed09d9ab5906a4091c041cd5de9695c859c85047ccc459759ce22b218c552eb59a2b66174ebd24d9e7ac0b140819
@@ -75,6 +75,7 @@ class EzClient::Request
75
75
  opts[:body] = options[:body] if options[:body]
76
76
  opts[:params] = options[:query] if options[:query]
77
77
  opts[:form] = options[:form] if options[:form]
78
+ opts[:form] = prepare_form_params(opts[:form]) if opts[:form]
78
79
  opts[:headers] = prepare_headers(options[:headers])
79
80
 
80
81
  http_client.build_request(verb, url, opts)
@@ -150,6 +151,16 @@ class EzClient::Request
150
151
  headers
151
152
  end
152
153
 
154
+ def prepare_form_params(params)
155
+ params.transform_values do |value|
156
+ if value.is_a?(File)
157
+ HTTP::FormData::File.new(value)
158
+ else
159
+ value
160
+ end
161
+ end
162
+ end
163
+
153
164
  def set_timeout(client)
154
165
  return client unless timeout
155
166
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EzClient
4
- VERSION = "0.14.0"
4
+ VERSION = "0.15.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ezclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Smirnov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-21 00:00:00.000000000 Z
11
+ date: 2018-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http