httpclient 2.2.0.1 → 2.2.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/httpclient.rb CHANGED
@@ -229,7 +229,7 @@ require 'httpclient/cookie'
229
229
  # ruby -rhttpclient -e 'p HTTPClient.head(ARGV.shift).header["last-modified"]' http://dev.ctor.org/
230
230
  #
231
231
  class HTTPClient
232
- VERSION = '2.2.0.1'
232
+ VERSION = '2.2.0.2'
233
233
  RUBY_VERSION_STRING = "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
234
234
  /: (\S+) (\S+)/ =~ %q$Id$
235
235
  LIB_NAME = "(#{$1}/#{$2}, #{RUBY_VERSION_STRING})"
@@ -389,6 +389,22 @@ class HTTPClient
389
389
  @follow_redirect_count = 10
390
390
  load_environment
391
391
  self.proxy = proxy if proxy
392
+ keep_webmock_compat
393
+ end
394
+
395
+ # webmock 1.6.2 depends on HTTP::Message#body.content to work.
396
+ # let's keep it work iif webmock is loaded for a while.
397
+ def keep_webmock_compat
398
+ if respond_to?(:do_get_block_with_webmock)
399
+ ::HTTP::Message.module_eval do
400
+ def body
401
+ def (o = self.content).content
402
+ self
403
+ end
404
+ o
405
+ end
406
+ end
407
+ end
392
408
  end
393
409
 
394
410
  # Returns debug device if exists. See debug_dev=.
@@ -1,9 +1,9 @@
1
1
  MIME-Version: 1.0
2
- Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha1"; boundary="----21BACCEB0386628A2D68B26976B22018"
2
+ Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha1"; boundary="----FD1775D1D9127483D5635511E610AF67"
3
3
 
4
4
  This is an S/MIME signed message
5
5
 
6
- ------21BACCEB0386628A2D68B26976B22018
6
+ ------FD1775D1D9127483D5635511E610AF67
7
7
  -----BEGIN CERTIFICATE-----
8
8
  MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU
9
9
  MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3
@@ -1813,7 +1813,7 @@ lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3
1813
1813
  7M2CYfE45k+XmCpajQ==
1814
1814
  -----END CERTIFICATE-----
1815
1815
 
1816
- ------21BACCEB0386628A2D68B26976B22018
1816
+ ------FD1775D1D9127483D5635511E610AF67
1817
1817
  Content-Type: application/pkcs7-signature; name="smime.p7s"
1818
1818
  Content-Transfer-Encoding: base64
1819
1819
  Content-Disposition: attachment; filename="smime.p7s"
@@ -1843,16 +1843,16 @@ BO7mpwMLMIdsjTvnkx2b/WEokIPiXr2Hcnc6FEgRQ8l8ec+8znC2LILZ1wT2K3AT
1843
1843
  o3whsSOELB++JcWKxWsM3/6llkYx/rtlpjGCAiswggInAgEBMFAwSzELMAkGA1UE
1844
1844
  BhMCSlAxETAPBgNVBAoMCGN0b3Iub3JnMRQwEgYDVQQLDAtEZXZlbG9wbWVudDET
1845
1845
  MBEGA1UEAwwKaHR0cGNsaWVudAIBATAJBgUrDgMCGgUAoIGxMBgGCSqGSIb3DQEJ
1846
- AzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMTIxMzEzNTI1MlowIwYJ
1846
+ AzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTExMDQxOTEzMTk1MFowIwYJ
1847
1847
  KoZIhvcNAQkEMRYEFB6px2QzZcvvEHTjt2rAmZJQzfDEMFIGCSqGSIb3DQEJDzFF
1848
1848
  MEMwCgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcG
1849
- BSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIIBAECC6IqXybf+
1850
- fWzYjqKoIWvoNSjsvIddbRh8D46naHzBGPC6CjYf1FG/Spsv2NMKdxnZsR/P888D
1851
- xJvHgVkUqa+Q1KXS0nRk6K1/YlvNS2D3N9rPC827WgxYP+EB0nNDsBS+7tUJl2YV
1852
- k/7bBn8jJsUP34PqXfLHFhpcz2+9Djji6bWRSpFtPvDDmLF90/qZc6ESNmtOTv4G
1853
- N5guqomPy3Ayo92dS80MMWIyWLm2P/xkpjlDt9Kaekc1TiODNozHyQbaA7jMH5hJ
1854
- 3Xnp1DtzIRkvONW2tu/VnWlfnuk4MOabNrwjo713Bs6wEbEs8BFfIoToP1gybeBf
1855
- 87QK8ziDw8g=
1849
+ BSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIIBAD4EMqXaqm6w
1850
+ loVOMuk2Etbhp9jBFykE3fOB5WUTTkEH9sgI04Ajoc6CBjud97ngG+WVfK9JK1zG
1851
+ D5uEI+8IV5l4N38kzV/CJ3oomMtXlwPvzXYXcHeN3FAPcNwHxKSswMEOyCmn1Xh7
1852
+ 3UBvJBiMuqZfCuM63n0ozj5fiYCBUUnhX3fb2pcmswhO8PDEuA2XoYS5sLAmqA20
1853
+ 4mklFS4ejN1dmWcJY+cHaS45+pYfzFXtZDaOR7WU+vYIydMoTxBOgVbrjnlciZc0
1854
+ eomLCA65FMf8adnS658gfqzstjp7Sq81G7uniUQdipK4BA6uU+Qeg0LRbMSaV4VG
1855
+ 8ML4DnOTXME=
1856
1856
 
1857
- ------21BACCEB0386628A2D68B26976B22018--
1857
+ ------FD1775D1D9127483D5635511E610AF67--
1858
1858
 
@@ -1,9 +1,9 @@
1
1
  MIME-Version: 1.0
2
- Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha1"; boundary="----9D03D47FAA98363CD7978AFC0454F513"
2
+ Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha1"; boundary="----A7A3ED9F71494B934F978FF49CCFDAA8"
3
3
 
4
4
  This is an S/MIME signed message
5
5
 
6
- ------9D03D47FAA98363CD7978AFC0454F513
6
+ ------A7A3ED9F71494B934F978FF49CCFDAA8
7
7
  -----BEGIN CERTIFICATE-----
8
8
  MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU
9
9
  MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3
@@ -1813,7 +1813,7 @@ lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3
1813
1813
  7M2CYfE45k+XmCpajQ==
1814
1814
  -----END CERTIFICATE-----
1815
1815
 
1816
- ------9D03D47FAA98363CD7978AFC0454F513
1816
+ ------A7A3ED9F71494B934F978FF49CCFDAA8
1817
1817
  Content-Type: application/pkcs7-signature; name="smime.p7s"
1818
1818
  Content-Transfer-Encoding: base64
1819
1819
  Content-Disposition: attachment; filename="smime.p7s"
@@ -1843,16 +1843,16 @@ YMEtiMT3acFCZEjamCfXIcfLu6Jr7dYc6bvZqLd8tKkKFy01dOSEXIgHtDsthHbv
1843
1843
  t9v4ZZy8AJlYcuqOLLbIs9nL0lnCcKLjITGCAiswggInAgEBMFAwSzELMAkGA1UE
1844
1844
  BhMCSlAxETAPBgNVBAoMCGN0b3Iub3JnMRQwEgYDVQQLDAtEZXZlbG9wbWVudDET
1845
1845
  MBEGA1UEAwwKaHR0cGNsaWVudAIBAjAJBgUrDgMCGgUAoIGxMBgGCSqGSIb3DQEJ
1846
- AzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMTIxMzEzNTY0NlowIwYJ
1846
+ AzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTExMDQxOTEzMjAwNFowIwYJ
1847
1847
  KoZIhvcNAQkEMRYEFB6px2QzZcvvEHTjt2rAmZJQzfDEMFIGCSqGSIb3DQEJDzFF
1848
1848
  MEMwCgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcG
1849
- BSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIIBAE8dkUXL11pJ
1850
- KAFjLByBhcS+NcyeTqoVB5NSCydznZxHHBmFptQQn2lq85mjvxtpkVe2xJfEKMZY
1851
- yIJ148K7piwMY0pu79RIGDc6Ssk1ehS2TJBigsShx6mT56EdQALVrPfLofCUh0v2
1852
- 3DysNYHkbTmY+cMeEJP2uynNpXercCUrqoff5Sf5MjHfSNmJ7M8bJdjrnOOXKN2Z
1853
- 9eJJuibvV8CX+vx5TO9O9r8AezTw7ZVzdnM61qnVGpJWYZUJEQ6kA2qA2CDkQjDP
1854
- Y3GRu0DW0MMytVRG5fCdIE52Yh5hmwo54hW0WAY9TtjbiApvlOGTn9LgpW/Z7mvu
1855
- f8g+y6bwGnk=
1849
+ BSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIIBACVjHueimi/s
1850
+ rHZxaiZMz45S2uXLynpAco67tGw/iguWTk3hKHQ3Dwp2iFmqIYaAPjNeYt/eV7qr
1851
+ A+3DVL64tTxSvnNU/lgFOTmq1p8jITrKwdVYBvwWaSNURvTy3bpt3W962hdfmqAL
1852
+ CXOdo7h7nXL5haHLFPPw4Hca9Z9mFpM6x1fIjSk/zSRo2W1RgXxva/4F2LKHREcD
1853
+ OPfDbTN517z7u+mQ/J7D+4JU8zLQZA8khM0JF/PhuKzy2PxPqrEREZcx+EFy3JHA
1854
+ Q6Fdof6LYHrDEZppOrEtJB7UVhoQ1Ksw25T9dMjB2PqLK3hafUtC10iOAQxIfEDH
1855
+ ANx4tC98GH8=
1856
1856
 
1857
- ------9D03D47FAA98363CD7978AFC0454F513--
1857
+ ------A7A3ED9F71494B934F978FF49CCFDAA8--
1858
1858
 
@@ -42,10 +42,10 @@ class HTTPClient
42
42
  # end
43
43
  #
44
44
  def keyword_argument(args, *field)
45
- if args.size == 1 and args[0].is_a?(Hash)
46
- r = args[0].values_at(*field)
47
- unless r.compact.empty?
48
- return r
45
+ if args.size == 1 and Hash === args[0]
46
+ h = args[0]
47
+ if field.any? { |f| h.key?(f) }
48
+ return h.values_at(*field)
49
49
  end
50
50
  end
51
51
  args
@@ -60,10 +60,10 @@ class HTTPClient
60
60
  # includes defined keys.
61
61
  def argument_to_hash(args, *field)
62
62
  return nil if args.empty?
63
- if args.size == 1 and args[0].is_a?(Hash)
64
- r = args[0].values_at(*field)
65
- unless r.compact.empty?
66
- return args[0]
63
+ if args.size == 1 and Hash === args[0]
64
+ h = args[0]
65
+ if field.any? { |f| h.key?(f) }
66
+ return h
67
67
  end
68
68
  end
69
69
  h = {}
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: httpclient
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.2.0.1
5
+ version: 2.2.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - NAKAMURA, Hiroshi
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-19 00:00:00 Z
13
+ date: 2011-04-25 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: