httmultiparty 0.3.8 → 0.3.9

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.
data/lib/httmultiparty.rb CHANGED
@@ -8,9 +8,13 @@ module HTTMultiParty
8
8
  TRANSFORMABLE_TYPES = [File, Tempfile]
9
9
 
10
10
  QUERY_STRING_NORMALIZER = Proc.new do |params|
11
- HTTMultiParty.flatten_params(params).map do |(k,v)|
12
- [k, TRANSFORMABLE_TYPES.include?(v.class) ? HTTMultiParty.file_to_upload_io(v) : v]
11
+ multipart = false
12
+ result = HTTMultiParty.flatten_params(params).map do |(k,v)|
13
+ multipart ||= TRANSFORMABLE_TYPES.include?(v.class)
14
+ [k, multipart ? HTTMultiParty.file_to_upload_io(v) : v]
13
15
  end
16
+
17
+ multipart ? result : HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER.call(params)
14
18
  end
15
19
 
16
20
  def self.included(base)
@@ -1,3 +1,3 @@
1
1
  module HTTMultiParty
2
- VERSION = '0.3.8'
2
+ VERSION = '0.3.9'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: httmultiparty
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.8
5
+ version: 0.3.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Johannes Wagener
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-06-05 00:00:00 Z
13
+ date: 2013-04-01 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty