ethon 0.4.4 → 0.5.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.
data/CHANGELOG.md CHANGED
@@ -2,7 +2,14 @@
2
2
 
3
3
  ## Master
4
4
 
5
- [Full Changelog](http://github.com/typhoeus/ethon/compare/v0.4.4...master)
5
+ ## 0.5.0
6
+
7
+ [Full Changelog](http://github.com/typhoeus/ethon/compare/v0.4.4...0.5.0)
8
+
9
+ Enhancements:
10
+
11
+ * New libcurl option proxyuserpwd
12
+ * Rename response_header to response_headers
6
13
 
7
14
  ## 0.4.4
8
15
 
data/lib/ethon/easy.rb CHANGED
@@ -475,6 +475,10 @@ module Ethon
475
475
  # @option options :proxyport [Integer]
476
476
  # Pass a long with this option to set the proxy port to connect to
477
477
  # unless it is specified in the proxy string CURLOPT_PROXY.
478
+ # @option options :proxyuserpwd [String]
479
+ # Pass a char * as parameter, which should be [user name]:[password]
480
+ # to use for the connection to the HTTP proxy. Use CURLOPT_PROXYAUTH
481
+ # to decide the authentication method.
478
482
  # @option options :readdata [String]
479
483
  # Data pointer to pass to the file read function. If you use the
480
484
  # CURLOPT_READFUNCTION option, this is the pointer you'll get as input.
@@ -846,7 +850,7 @@ module Ethon
846
850
  return @hash if defined?(@hash) && @hash
847
851
  @hash = {
848
852
  :return_code => return_code,
849
- :response_header => response_header,
853
+ :response_headers => response_headers,
850
854
  :response_body => response_body
851
855
  }
852
856
  Easy::Informations::AVAILABLE_INFORMATIONS.keys.each do |info|
@@ -7,7 +7,7 @@ module Ethon
7
7
 
8
8
  # :nodoc:
9
9
  def self.included(base)
10
- base.send(:attr_accessor, *[:response_body, :response_header])
10
+ base.send(:attr_accessor, *[:response_body, :response_headers])
11
11
  end
12
12
 
13
13
  # Set writefunction and headerfunction callback.
@@ -20,7 +20,7 @@ module Ethon
20
20
  Curl.set_option(:writefunction, body_write_callback, handle)
21
21
  Curl.set_option(:headerfunction, header_write_callback, handle)
22
22
  @response_body = ""
23
- @response_header = ""
23
+ @response_headers = ""
24
24
  end
25
25
 
26
26
  # Returns the body write callback.
@@ -44,7 +44,7 @@ module Ethon
44
44
  # @return [ Proc ] The callback.
45
45
  def header_write_callback
46
46
  @header_write_callback ||= proc {|stream, size, num, object|
47
- @response_header << stream.read_string(size * num)
47
+ @response_headers << stream.read_string(size * num)
48
48
  size * num
49
49
  }
50
50
  end
@@ -23,7 +23,7 @@ module Ethon
23
23
  def perform
24
24
  @return_code = Curl.easy_perform(handle)
25
25
  complete
26
- Ethon.logger.debug("ETHON: performed #{self.log_inspect}") if Ethon.logger
26
+ Ethon.logger.debug("ETHON: performed #{self.log_inspect}")
27
27
  @return_code
28
28
  end
29
29
 
@@ -13,9 +13,10 @@ module Ethon
13
13
  :customrequest, :cainfo, :capath, :connecttimeout, :connecttimeout_ms,
14
14
  :forbid_reuse, :followlocation, :httpauth, :infilesize, :interface,
15
15
  :maxredirs, :nosignal, :postfieldsize, :copypostfields, :proxy,
16
- :proxyauth, :proxyport, :proxytype, :timeout, :timeout_ms, :readdata, :sslcert,
17
- :ssl_verifypeer, :ssl_verifyhost, :sslcerttype, :sslkey, :sslkeytype,
18
- :sslversion, :url, :useragent, :userpwd, :verbose, :readfunction
16
+ :proxyauth, :proxyport, :proxytype, :proxyuserpwd, :timeout, :timeout_ms,
17
+ :readdata, :sslcert, :ssl_verifypeer, :ssl_verifyhost, :sslcerttype,
18
+ :sslkey, :sslkeytype, :sslversion, :url, :useragent, :userpwd,
19
+ :verbose, :readfunction
19
20
  ])
20
21
  base.send(:attr_accessor, *Ethon::Easy::AVAILABLE_OPTIONS)
21
22
  end
@@ -43,7 +43,7 @@ module Ethon
43
43
  # @example Perform multi.
44
44
  # multi.perform
45
45
  def perform
46
- Ethon.logger.debug("ETHON: started MULTI") if Ethon.logger
46
+ Ethon.logger.debug("ETHON: started MULTI")
47
47
  while ongoing?
48
48
  run
49
49
  timeout = get_timeout
@@ -51,7 +51,7 @@ module Ethon
51
51
  reset_fds
52
52
  set_fds(timeout)
53
53
  end
54
- Ethon.logger.debug("ETHON: performed MULTI") if Ethon.logger
54
+ Ethon.logger.debug("ETHON: performed MULTI")
55
55
  nil
56
56
  end
57
57
 
@@ -122,7 +122,7 @@ module Ethon
122
122
  easy.return_code = msg[:data][:code]
123
123
  delete(easy)
124
124
  easy.complete
125
- Ethon.logger.debug("ETHON: performed #{easy.log_inspect}") if Ethon.logger
125
+ Ethon.logger.debug("ETHON: performed #{easy.log_inspect}")
126
126
  end
127
127
  end
128
128
 
data/lib/ethon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Ethon
2
2
 
3
3
  # Ethon version.
4
- VERSION = '0.4.4'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-10 00:00:00.000000000 Z
12
+ date: 2012-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -121,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  segments:
123
123
  - 0
124
- hash: 3523421791018447107
124
+ hash: 3228494030236225352
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  none: false
127
127
  requirements: