troelskn-handsoap 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -1,6 +1,12 @@
1
1
  Handsoap
2
2
  ===
3
3
 
4
+ Install
5
+ ---
6
+
7
+ gem sources -a http://gems.github.com
8
+ sudo gem install troelskn-handsoap curb
9
+
4
10
  What
5
11
  ---
6
12
  Handsoap is a library for creating SOAP clients in Ruby.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 7
2
+ :patch: 8
3
3
  :major: 0
4
4
  :minor: 2
@@ -76,7 +76,7 @@ module Handsoap #:nodoc:
76
76
  end
77
77
 
78
78
  def message(&block)
79
- yield $stdout
79
+ yield $stdout unless logger.quiet
80
80
  end
81
81
 
82
82
  private
@@ -1,8 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'rubygems'
3
- require 'httpclient'
4
3
  require 'nokogiri'
5
- require 'curb'
6
4
  require 'time'
7
5
  require 'handsoap/xml_mason'
8
6
 
@@ -33,11 +31,14 @@ end
33
31
  module Handsoap
34
32
 
35
33
  def self.http_driver
36
- @http_driver || :curb
34
+ @http_driver || (self.http_driver = :curb)
37
35
  end
38
36
 
39
37
  def self.http_driver=(driver)
40
38
  @http_driver = driver
39
+ require 'httpclient' if driver == :httpclient
40
+ require 'curb' if driver == :curb
41
+ return driver
41
42
  end
42
43
 
43
44
  SOAP_NAMESPACE = { 1 => 'http://schemas.xmlsoap.org/soap/envelope/', 2 => 'http://www.w3.org/2001/12/soap-encoding' }
@@ -248,7 +249,7 @@ module Handsoap
248
249
  logger.puts Handsoap.pretty_format_envelope(http_client.body_str)
249
250
  end
250
251
  soap_response = Response.new(http_client.body_str, self.class.envelope_namespace)
251
- else
252
+ elsif Handsoap.http_driver == :httpclient
252
253
  response = HTTPClient.new.post(self.class.uri, body, headers)
253
254
  debug do |logger|
254
255
  logger.puts "--- Response ---"
@@ -258,6 +259,8 @@ module Handsoap
258
259
  logger.puts Handsoap.pretty_format_envelope(response.content)
259
260
  end
260
261
  soap_response = Response.new(response.content, self.class.envelope_namespace)
262
+ else
263
+ raise "Unknown http driver #{Handsoap.http_driver}"
261
264
  end
262
265
  if soap_response.fault?
263
266
  return self.on_fault(soap_response.fault)
@@ -14,9 +14,9 @@ module Handsoap
14
14
  def initialize
15
15
  @namespaces = {}
16
16
  end
17
- def add(node_name, value = nil)
17
+ def add(node_name, value = nil, *flags)
18
18
  prefix, name = parse_ns(node_name)
19
- node = append_child Element.new(self, prefix, name, value)
19
+ node = append_child Element.new(self, prefix, name, value, flags)
20
20
  if block_given?
21
21
  yield node
22
22
  end
@@ -85,7 +85,7 @@ module Handsoap
85
85
  end
86
86
 
87
87
  class Element < Node
88
- def initialize(parent, prefix, node_name, value = nil)
88
+ def initialize(parent, prefix, node_name, value = nil, flags = [])
89
89
  super()
90
90
  # if prefix.to_s == ""
91
91
  # raise "missing prefix"
@@ -96,7 +96,7 @@ module Handsoap
96
96
  @children = []
97
97
  @attributes = {}
98
98
  if not value.nil?
99
- set_value value.to_s
99
+ set_value value.to_s, *flags
100
100
  end
101
101
  if block_given?
102
102
  yield self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: troelskn-handsoap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Troels Knak-Nielsen
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-12 00:00:00 -07:00
12
+ date: 2009-06-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,16 +22,6 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.2.3
24
24
  version:
25
- - !ruby/object:Gem::Dependency
26
- name: curb
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 0.3.2
34
- version:
35
25
  description: Handsoap is a library for creating SOAP clients in Ruby
36
26
  email: troelskn@gmail.com
37
27
  executables: []