savon 0.9.0 → 0.9.1

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.
@@ -1,3 +1,8 @@
1
+ ## 0.9.1 (2011-04-06)
2
+
3
+ * Improvement: if you're only setting the local or remote address of your wsdl document, you can
4
+ now pass an (optional) String to `Savon::Client.new` to set `wsdl.document`.
5
+
1
6
  ## 0.9.0 (2011-04-05)
2
7
 
3
8
  * Feature: issues [#158](https://github.com/rubiii/savon/issues/158),
@@ -40,6 +45,8 @@
40
45
  * Fix: [issue #163](https://github.com/rubiii/savon/issues/163) "Savon 0.8.6 not playing nicely
41
46
  with Httpi 0.9.0". Updating HTTPI to v0.9.1 should solve this problem.
42
47
 
48
+ * And if you haven't already seen the new documentation: [savonrb.com](http://savonrb.com)
49
+
43
50
  ## 0.8.6 (2011-02-15)
44
51
 
45
52
  * Fix for issues [issue #147](https://github.com/rubiii/savon/issues/147) and [#151](https://github.com/rubiii/savon/issues/151)
@@ -24,12 +24,16 @@ module Savon
24
24
  # # Using a local WSDL
25
25
  # client = Savon::Client.new { wsdl.document = "../wsdl/user_service.xml" }
26
26
  #
27
+ # # Shortcut for setting the WSDL
28
+ # client = Savon::Client.new "http://example.com/UserService?wsdl"
29
+ #
27
30
  # # Directly accessing a SOAP endpoint
28
31
  # client = Savon::Client.new do
29
32
  # wsdl.endpoint = "http://example.com/UserService"
30
33
  # wsdl.namespace = "http://users.example.com"
31
34
  # end
32
- def initialize(&block)
35
+ def initialize(wsdl_document = nil, &block)
36
+ wsdl.document = wsdl_document if wsdl_document
33
37
  process 1, &block if block
34
38
  wsdl.request = http
35
39
  end
@@ -61,21 +61,11 @@ module Savon
61
61
  # Sets whether to strip namespaces in a SOAP response Hash.
62
62
  attr_writer :strip_namespaces
63
63
 
64
- # Returns the current action_converter
65
- attr_reader :converter
66
-
67
- # Sets both action_converter and input_converter, converter should be a proc.
68
- def converter=(converter)
69
- @converter = converter
70
- end
71
-
72
64
  # Returns the global env_namespace.
73
65
  attr_reader :env_namespace
74
66
 
75
67
  # Sets the global env_namespace.
76
- def env_namespace=(namespace)
77
- @env_namespace = namespace
78
- end
68
+ attr_writer :env_namespace
79
69
 
80
70
  # Reset to default configuration.
81
71
  def reset_config!
@@ -85,7 +75,9 @@ module Savon
85
75
  self.raise_errors = true
86
76
  self.soap_version = SOAP::DefaultVersion
87
77
  self.strip_namespaces = true
78
+ self.env_namespace = nil
88
79
  end
89
80
 
90
81
  end
91
82
  end
83
+
@@ -48,6 +48,11 @@ module Savon
48
48
  @header_hash ||= basic_hash.find_soap_header
49
49
  end
50
50
 
51
+ # Shortcut for the +to_hash+ method.
52
+ def [](key)
53
+ to_hash[key]
54
+ end
55
+
51
56
  # Returns the SOAP response body as a Hash.
52
57
  def to_hash
53
58
  @hash ||= Savon::SOAP::XML.to_hash basic_hash
@@ -1,5 +1,5 @@
1
1
  module Savon
2
2
 
3
- Version = "0.9.0"
3
+ Version = "0.9.1"
4
4
 
5
5
  end
@@ -4,6 +4,14 @@ describe Savon::Client do
4
4
  let(:client) { Savon::Client.new { wsdl.document = Endpoint.wsdl } }
5
5
 
6
6
  describe ".new" do
7
+ context "with a String" do
8
+ it "should set the WSDL document" do
9
+ wsdl = "http://example.com/UserService?wsdl"
10
+ client = Savon::Client.new wsdl
11
+ client.wsdl.instance_variable_get("@document").should == wsdl
12
+ end
13
+ end
14
+
7
15
  context "with a block expecting one argument" do
8
16
  it "should yield the WSDL object" do
9
17
  Savon::Client.new { |wsdl| wsdl.should be_a(Savon::WSDL::Document) }
@@ -123,6 +123,13 @@ describe Savon::SOAP::Response do
123
123
  end
124
124
  end
125
125
 
126
+ describe "#[]" do
127
+ it "should return the SOAP response body as a Hash" do
128
+ soap_response[:authenticate_response][:return].should ==
129
+ Fixture.response_hash(:authentication)[:authenticate_response][:return]
130
+ end
131
+ end
132
+
126
133
  describe "#to_hash" do
127
134
  it "should return the SOAP response body as a Hash" do
128
135
  soap_response.to_hash[:authenticate_response][:return].should ==
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savon
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 0
10
- version: 0.9.0
9
+ - 1
10
+ version: 0.9.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Harrington