handsoap 1.1.8 → 1.2.2

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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTNkNjE1YWQyODkwOWU5Y2M2Y2MyNTdjNDkzNWQ2Y2I3ODJiMGQ2OQ==
5
+ data.tar.gz: !binary |-
6
+ NmZlOTFmMWQ4OTRlMzE0ZjZiNzU2ZjI1OGEzODY2NTFiOWUzNDU0Ng==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YjhmODJhNDg3MTAwNjQwOTBiODQ4OTlhNzk5YjdhNDkwNzFhZWMzZWUxMmJm
10
+ NmIxZGYxZjI3MzU5ZGVkYTIzY2Q5ZTRjY2I3NjhjN2U4MTNiNDI1NzIzYmRk
11
+ NjcxM2IzODczZDYzZTMxYTU3ODgzYTE5ODc1OWFlZDAwODk2NzI=
12
+ data.tar.gz: !binary |-
13
+ NDg4OTM3NjJkZmUwY2YzNTk0Nzk5MTE1OWEyZTNmOWFkMzMyMmQwYTZjNWQy
14
+ ZDY4YmVhNWQzZjVlMzBiZjJkZTc4OGU4YmU3MjQ3YmI1NzZkOGVlNzk4YTUw
15
+ OTVkYTg5MTQwZmVmYjViNzQ0ZjljYjQwYmJhNWE0YTVjZDAxZTM=
@@ -1,5 +1,5 @@
1
- ---
1
+ ---
2
2
  :major: 1
3
- :minor: 1
3
+ :minor: 2
4
+ :patch: 2
4
5
  :build:
5
- :patch: 8
@@ -2,3 +2,4 @@
2
2
  require 'handsoap/xml_mason'
3
3
  require 'handsoap/xml_query_front'
4
4
  require 'handsoap/service'
5
+ require 'bigdecimal'
@@ -64,8 +64,14 @@ module Handsoap
64
64
  boundary_size = boundary.size + "\r\n".size
65
65
  content_length -= boundary_size
66
66
  status = content_io.read(boundary_size)
67
+
67
68
  if nil == status
68
69
  raise EOFError, "no content body"
70
+ elsif "\r\n" + boundary == status
71
+ extra = content_io.read("\r\n".size)
72
+ unless extra == "\r\n"
73
+ raise EOFError, "parse error while reading boundary"
74
+ end
69
75
  elsif boundary + "\r\n" != status
70
76
  raise EOFError, "bad content body"
71
77
  end
@@ -22,6 +22,9 @@ module Handsoap
22
22
  @curl = ::Curl::Easy.new(url)
23
23
  @curl.timeout = Handsoap.timeout
24
24
  @curl.enable_cookies = @enable_cookies
25
+
26
+ # enables both deflate and gzip compression of responses
27
+ @curl.encoding = ''
25
28
 
26
29
  if Handsoap.follow_redirects?
27
30
  @curl.follow_location = true
@@ -18,6 +18,7 @@ module Handsoap
18
18
  end
19
19
  http_client.ssl_config.set_trust_ca(request.trust_ca_file) if request.trust_ca_file
20
20
  http_client.ssl_config.set_client_cert_file(request.client_cert_file,request.client_cert_key_file) if request.client_cert_file and request.client_cert_key_file
21
+ http_client.ssl_config.verify_mode = request.ssl_verify_mode if request.ssl_verify_mode
21
22
  # pack headers
22
23
  headers = request.headers.inject([]) do |arr, (k,v)|
23
24
  arr + v.map {|x| [k,x] }
@@ -14,8 +14,9 @@ module Handsoap
14
14
  unless url.kind_of? ::URI::Generic
15
15
  url = ::URI.parse(url)
16
16
  end
17
- ::URI::Generic.send(:public, :path_query) # hackety hack
18
- path = url.path_query
17
+
18
+ path = url.request_uri
19
+
19
20
  http_request = case request.http_method
20
21
  when :get
21
22
  Net::HTTP::Get.new(path)
@@ -5,7 +5,7 @@ module Handsoap
5
5
 
6
6
  # Represents a HTTP Request.
7
7
  class Request
8
- attr_reader :url, :http_method, :headers, :body, :username, :password, :trust_ca_file, :client_cert_file, :client_cert_key_file
8
+ attr_reader :url, :http_method, :headers, :body, :username, :password, :trust_ca_file, :client_cert_file, :client_cert_key_file,:ssl_verify_mode
9
9
  attr_writer :body, :http_method
10
10
  def initialize(url, http_method = :get)
11
11
  @url = url
@@ -17,6 +17,7 @@ module Handsoap
17
17
  @trust_ca_file = nil
18
18
  @client_cert_file = nil
19
19
  @client_cert_key_file = nil
20
+ @ssl_verify_mode = nil
20
21
  end
21
22
  def set_trust_ca_file(ca_file)
22
23
  @trust_ca_file = ca_file
@@ -25,6 +26,9 @@ module Handsoap
25
26
  @client_cert_file = client_cert_file
26
27
  @client_cert_key_file = client_cert_key_file
27
28
  end
29
+ def set_ssl_verify_mode(mode)
30
+ @ssl_verify_mode = mode
31
+ end
28
32
  def set_auth(username, password)
29
33
  @username = username
30
34
  @password = password
@@ -406,6 +406,7 @@ module Handsoap
406
406
  if http_options
407
407
  request.set_trust_ca_file(http_options[:trust_ca_file]) if http_options[:trust_ca_file]
408
408
  request.set_client_cert_files(http_options[:client_cert_file], http_options[:client_cert_key_file]) if http_options[:client_cert_file] && http_options[:client_cert_key_file]
409
+ request.set_ssl_verify_mode(http_options[:ssl_verify_mode]) if http_options[:ssl_verify_mode]
409
410
  end
410
411
 
411
412
  headers.each do |key, value|
@@ -86,6 +86,9 @@ module Handsoap
86
86
  def to_date
87
87
  self.first.to_date if self.any?
88
88
  end
89
+ def to_big_decimal(decimal_places = 2)
90
+ self.first.to_big_decimal(decimal_places) if self.any?
91
+ end
89
92
  def to_s
90
93
  self.first.to_s if self.any?
91
94
  end
@@ -159,6 +162,14 @@ module Handsoap
159
162
  return if t.nil?
160
163
  Time.iso8601(t)
161
164
  end
165
+ # Returns the value of the element as an instance of BigDecimal
166
+ #
167
+ # See +to_s+
168
+ def to_big_decimal(decimal_places = 2)
169
+ t = self.to_s
170
+ return if t.nil?
171
+ BigDecimal.new t, decimal_places
172
+ end
162
173
  # Returns the inner text content of this element, or the value (if it's an attr or textnode).
163
174
  #
164
175
  # The output is a UTF-8 encoded string, without xml-entities.
metadata CHANGED
@@ -1,35 +1,25 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: handsoap
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 1
8
- - 8
9
- version: 1.1.8
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.2
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Troels Knak-Nielsen
13
8
  - Jimmi Westerberg
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-01-07 00:00:00 +01:00
19
- default_executable:
12
+ date: 2013-09-06 00:00:00.000000000 Z
20
13
  dependencies: []
21
-
22
14
  description: Handsoap is a library for creating SOAP clients in Ruby
23
- email:
15
+ email:
24
16
  - troelskn@gmail.com
25
17
  - frontend@unwire.dk
26
18
  executables: []
27
-
28
19
  extensions: []
29
-
30
- extra_rdoc_files:
20
+ extra_rdoc_files:
31
21
  - README.markdown
32
- files:
22
+ files:
33
23
  - DEPLOY.markdown
34
24
  - README.markdown
35
25
  - VERSION.yml
@@ -54,39 +44,30 @@ files:
54
44
  - lib/handsoap/service.rb
55
45
  - lib/handsoap/xml_mason.rb
56
46
  - lib/handsoap/xml_query_front.rb
57
- has_rdoc: true
58
47
  homepage: http://github.com/unwire/handsoap
59
48
  licenses: []
60
-
49
+ metadata: {}
61
50
  post_install_message:
62
- rdoc_options:
63
- - --charset=UTF-8
64
- require_paths:
51
+ rdoc_options: []
52
+ require_paths:
65
53
  - lib
66
- required_ruby_version: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- segments:
71
- - 0
72
- version: "0"
73
- required_rubygems_version: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- segments:
78
- - 0
79
- version: "0"
80
- requirements:
81
- - |-
82
- You need to install either "curb" or "httpclient", using one of:
83
- gem install curb
84
- gem install httpclient
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ requirements:
65
+ - ! "You need to install either \"curb\" or \"httpclient\", using one of:\n gem
66
+ install curb\n gem install httpclient"
85
67
  - It is recommended that you install either "nokogiri" or "libxml-ruby"
86
68
  rubyforge_project:
87
- rubygems_version: 1.3.6
69
+ rubygems_version: 2.0.3
88
70
  signing_key:
89
- specification_version: 3
71
+ specification_version: 4
90
72
  summary: Handsoap is a library for creating SOAP clients in Ruby
91
73
  test_files: []
92
-