dcu-typhoeus 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/typhoeus.rb CHANGED
@@ -10,6 +10,7 @@ require 'typhoeus/multi'
10
10
  require 'typhoeus/filter'
11
11
  require 'typhoeus/param_processor'
12
12
  require 'typhoeus/remote'
13
+ require 'typhoeus/remote_method'
13
14
  require 'typhoeus/remote_proxy_object'
14
15
  require 'typhoeus/response'
15
16
  require 'typhoeus/request'
@@ -177,7 +177,7 @@ module Typhoeus
177
177
  unless mock_object.nil?
178
178
  decode_nil_response(mock_object)
179
179
  else
180
- enforce_allow_net_connect!(:#{method.to_s}, url, Typhoeus::Utils.escape_params(options[:params]))
180
+ enforce_allow_net_connect!(:#{method.to_s}, url, options[:params])
181
181
  remote_proxy_object(url, :#{method.to_s}, options)
182
182
  end
183
183
  end
@@ -286,9 +286,10 @@ module Typhoeus
286
286
  args[:path] ||= @remote_defaults[:path]
287
287
  args[:follow_location] ||= @remote_defaults[:follow_location]
288
288
  args[:max_redirects] ||= @remote_defaults[:max_redirects]
289
- args[:params] ||= @remote_defaults[:params]
290
- args[:username] ||= @remote_defaults[:username]
291
- args[:password] ||= @remote_defaults[:password]
289
+ args[:params] ||= @remote_defaults[:params] if @remote_defaults[:params]
290
+ args[:username] ||= @remote_defaults[:username] if @remote_defaults[:username]
291
+ args[:password] ||= @remote_defaults[:password] if @remote_defaults[:password]
292
+
292
293
  m = RemoteMethod.new(args)
293
294
 
294
295
  @remote_methods ||= {}
@@ -11,6 +11,8 @@ module Typhoeus
11
11
  module_function :escape
12
12
 
13
13
  def escape_params(params)
14
+ return {} if params.nil?
15
+
14
16
  traverse_params_hash(params)[:params].inject({}) do |memo, (k, v)|
15
17
  memo[escape(k)] = CGI.escape(v)
16
18
  memo
@@ -1,3 +1,3 @@
1
1
  module Typhoeus
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dcu-typhoeus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-08-21 00:00:00.000000000 Z
14
+ date: 2012-08-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: ffi