wash_out 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.6
4
+
5
+ * Unicorn stream reading bug (#20)
6
+ * .NET minOccurs/maxOccurs basic WSDL compatibility (#22, #23)
7
+
3
8
  ## 0.3.5
4
9
 
5
10
  * Very evil thread-safety bug fixed. You are encouraged to never use anything below this version.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wash_out (0.3.4)
4
+ wash_out (0.3.5)
5
5
  nori
6
6
 
7
7
  GEM
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2012 Round Lake, inc.,
4
+ Peter Zotov <whitequark@whitequark.org>.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
data/README.md CHANGED
@@ -132,26 +132,15 @@ Available properties are:
132
132
  * **namespace**: SOAP namespace to use. Default is `urn:WashOut`.
133
133
  * **snakecase**: Determines if WashOut should modify parameters keys to snakecase. Default is true.
134
134
 
135
- License
135
+ Credits
136
136
  -------
137
137
 
138
- Copyright (C) 2011 by Boris Staal <boris@roundlake.ru>,
139
- Peter Zotov <p.zotov@roundlake.ru>.
140
-
141
- Permission is hereby granted, free of charge, to any person obtaining a copy
142
- of this software and associated documentation files (the "Software"), to deal
143
- in the Software without restriction, including without limitation the rights
144
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
145
- copies of the Software, and to permit persons to whom the Software is
146
- furnished to do so, subject to the following conditions:
147
-
148
- The above copyright notice and this permission notice shall be included in
149
- all copies or substantial portions of the Software.
150
-
151
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
153
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
154
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
155
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
156
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
157
- THE SOFTWARE.
138
+ <img src="http://roundlake.ru/assets/logo.png" align="right" />
139
+
140
+ * Boris Staal ([@_inossidabile](http://twitter.com/#!/_inossidabile))
141
+ * Peter Zotov ([@whitequark](http://twitter.com/#!/whitequark))
142
+
143
+ LICENSE
144
+ -------
145
+
146
+ It is free software, and may be redistributed under the terms of MIT license.
@@ -35,7 +35,7 @@ module WashOutHelper
35
35
  xml.tag! "xsd:sequence" do
36
36
  param.map.each do |value|
37
37
  more << value if value.struct?
38
- xml.tag! "xsd:element", wsdl_occurence(value, :name => value.name, :type => value.namespaced_type)
38
+ xml.tag! "xsd:element", wsdl_occurence(value, false, :name => value.name, :type => value.namespaced_type)
39
39
  end
40
40
  end
41
41
  end
@@ -46,10 +46,10 @@ module WashOutHelper
46
46
  end
47
47
  end
48
48
 
49
- def wsdl_occurence(param, extend_with = {})
49
+ def wsdl_occurence(param, inject, extend_with = {})
50
50
  data = !param.multiplied ? {} : {
51
- "xsi:minOccurs" => 0,
52
- "xsi:maxOccurs" => 'unbounded'
51
+ "#{'xsi:' if inject}minOccurs" => 0,
52
+ "#{'xsi:' if inject}maxOccurs" => 'unbounded'
53
53
  }
54
54
 
55
55
  extend_with.merge(data)
@@ -3,13 +3,13 @@ xml.definitions 'xmlns' => 'http://schemas.xmlsoap.org/wsdl/',
3
3
  'xmlns:tns' => @namespace,
4
4
  'xmlns:soap' => 'http://schemas.xmlsoap.org/wsdl/soap/',
5
5
  'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
6
- "xmlns:xsi" => 'http://www.w3.org/2001/XMLSchema-instance',
6
+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
7
7
  'xmlns:soap-enc' => 'http://schemas.xmlsoap.org/soap/encoding/',
8
8
  'xmlns:wsdl' => 'http://schemas.xmlsoap.org/wsdl/',
9
9
  'name' => @name,
10
10
  'targetNamespace' => @namespace do
11
11
  xml.types do
12
- xml.tag! "xsd:schema", :targetNamespace => @namespace do
12
+ xml.tag! "schema", :targetNamespace => @namespace, :xmlns => 'http://www.w3.org/2001/XMLSchema' do
13
13
  @map.each do |operation, formats|
14
14
  (formats[:in] + formats[:out]).each do |p|
15
15
  wsdl_type xml, p
@@ -51,16 +51,16 @@ xml.definitions 'xmlns' => 'http://schemas.xmlsoap.org/wsdl/',
51
51
  xml.tag! "soap:address", :location => url_for(:action => '_action', :only_path => false)
52
52
  end
53
53
  end
54
-
54
+
55
55
  @map.each do |operation, formats|
56
56
  xml.message :name => "#{operation}" do
57
57
  formats[:in].each do |p|
58
- xml.part wsdl_occurence(p, :name => p.name, :type => p.namespaced_type)
58
+ xml.part wsdl_occurence(p, true, :name => p.name, :type => p.namespaced_type)
59
59
  end
60
60
  end
61
61
  xml.message :name => "#{operation}_response" do
62
62
  formats[:out].each do |p|
63
- xml.part wsdl_occurence(p, :name => p.name, :type => p.namespaced_type)
63
+ xml.part wsdl_occurence(p, true, :name => p.name, :type => p.namespaced_type)
64
64
  end
65
65
  end
66
66
  end
@@ -25,7 +25,7 @@ module WashOut
25
25
  Nori.convert_tags_to { |tag| tag.to_sym }
26
26
  end
27
27
 
28
- params = Nori.parse(request.body)
28
+ params = Nori.parse(request.body.read)
29
29
 
30
30
  xml_data = params.values_at(:envelope, :Envelope).compact.first
31
31
  xml_data = xml_data.values_at(:body, :Body).compact.first
@@ -1,3 +1,3 @@
1
1
  module WashOut
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
@@ -48,8 +48,8 @@ describe WashOut do
48
48
  client.wsdl.soap_actions.should == [:answer, :get_area]
49
49
 
50
50
  x = xml[:definitions][:types][:schema][:complex_type].find{|x| x[:'@name'] == 'center'}[:sequence][:element].find{|x| x[:'@name'] == 'x'}
51
- x[:'@xsi:min_occurs'].should == "0"
52
- x[:'@xsi:max_occurs'].should == "unbounded"
51
+ x[:'@min_occurs'].should == "0"
52
+ x[:'@max_occurs'].should == "unbounded"
53
53
 
54
54
  xml[:definitions][:binding][:operation].map{|e| e[:'@name']}.should == ['answer', 'getArea']
55
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wash_out
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-03-27 00:00:00.000000000 Z
13
+ date: 2012-04-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nori
17
- requirement: &70310783969100 !ruby/object:Gem::Requirement
17
+ requirement: &70309445502780 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70310783969100
25
+ version_requirements: *70309445502780
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec-rails
28
- requirement: &70310783968680 !ruby/object:Gem::Requirement
28
+ requirement: &70309445499440 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *70310783968680
36
+ version_requirements: *70309445499440
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: appraisal
39
- requirement: &70310783968260 !ruby/object:Gem::Requirement
39
+ requirement: &70309445483420 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *70310783968260
47
+ version_requirements: *70309445483420
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: tzinfo
50
- requirement: &70310783967840 !ruby/object:Gem::Requirement
50
+ requirement: &70309457795880 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *70310783967840
58
+ version_requirements: *70309457795880
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: savon
61
- requirement: &70310783967400 !ruby/object:Gem::Requirement
61
+ requirement: &70309457794620 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *70310783967400
69
+ version_requirements: *70309457794620
70
70
  description: Dead simple Rails 3 SOAP server library
71
71
  email: boris@roundlake.ru
72
72
  executables: []
@@ -79,6 +79,7 @@ files:
79
79
  - CHANGELOG.md
80
80
  - Gemfile
81
81
  - Gemfile.lock
82
+ - LICENSE
82
83
  - README.md
83
84
  - Rakefile
84
85
  - app/helpers/wash_out_helper.rb