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 +5 -0
- data/Gemfile.lock +1 -1
- data/LICENSE +22 -0
- data/README.md +10 -21
- data/app/helpers/wash_out_helper.rb +4 -4
- data/app/views/wash_with_soap/wsdl.builder +5 -5
- data/lib/wash_out/dispatcher.rb +1 -1
- data/lib/wash_out/version.rb +1 -1
- data/spec/wash_out_spec.rb +2 -2
- metadata +13 -12
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
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
|
-
|
135
|
+
Credits
|
136
136
|
-------
|
137
137
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
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
|
-
|
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! "
|
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
|
data/lib/wash_out/dispatcher.rb
CHANGED
@@ -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
|
data/lib/wash_out/version.rb
CHANGED
data/spec/wash_out_spec.rb
CHANGED
@@ -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[:'@
|
52
|
-
x[:'@
|
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.
|
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-
|
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: &
|
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: *
|
25
|
+
version_requirements: *70309445502780
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rspec-rails
|
28
|
-
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: *
|
36
|
+
version_requirements: *70309445499440
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: appraisal
|
39
|
-
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: *
|
47
|
+
version_requirements: *70309445483420
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: tzinfo
|
50
|
-
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: *
|
58
|
+
version_requirements: *70309457795880
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: savon
|
61
|
-
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: *
|
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
|