washout_builder 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.rdoc +19 -4
- data/app/helpers/washout_builder_helper.rb +4 -4
- data/lib/washout_builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTljZWJlOTljYmQyMmM1NzlkNDQ2NGIzZGQ4OTFiNmM2ZmMyOWFkNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTk2Y2FmNjZiMDhkYWEwYzJlODg1ZTgyMjZjOGFmZTdlM2JkMWI0NQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzhhMGJiMTQzMWVjNTFiNDY4MDUxOGIyYzE3OTIxMzBkZWZlNDQ4OWQxOGZk
|
10
|
+
ZjZlYjFiMGFjZDNhZWI0NzUyODA5OTUxZWQ3YjQ5YjI0OTY2M2JmZmUyNzQ2
|
11
|
+
OTZkMTc5MDRlNGY3ZTI4OTI5ZmQ2ZmRmYjZlNWQxM2U5OWI5Zjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjM4MjVjMTcxNzc1NGQ3NDZmNWNmNTliYWQwMGUzMjRiYmZiNDY5M2ZmZDc2
|
14
|
+
YTg4NDU5Mzk4MjIxNzhhYjA1ZjhiNGQ1ODRjMzdhMmQ4YWU3M2U1YTU2ODBi
|
15
|
+
YWQxNDc0NGRmYmYwYzc3ZTAzY2U0ZDUzMzMwOGExNzFhNzkxZGM=
|
data/README.rdoc
CHANGED
@@ -22,6 +22,7 @@ The way WashOut is used is not modified, it just extends its functionality by ge
|
|
22
22
|
2. {Ruby on Rails}[http://rubyonrails.org].
|
23
23
|
3. {WashOut Gem version >= 0.10.0.beta.1}[https://github.com/inossidabile/wash_out]
|
24
24
|
4. {Nori Gem}[https://github.com/savonrb/nori]
|
25
|
+
5. {Virtus Gem}[https://github.com/solnic/virtus]
|
25
26
|
|
26
27
|
= Compatibility
|
27
28
|
|
@@ -61,15 +62,29 @@ Please read {release details}[https://github.com/bogdanRada/washout_builder/rele
|
|
61
62
|
The way soap_actions, or reusable types are defined or how the configuration is made using WashOut(https://github.com/inossidabile/wash_out) haven't changed
|
62
63
|
You can still do everything that gem does .
|
63
64
|
|
64
|
-
When specifying the <b>soap_action</b> you can also pass a <b>option for description</b> and a <b>list of exceptions(need to be
|
65
|
+
When specifying the <b>soap_action</b> you can also pass a <b>option for description</b> and a <b>list of exceptions(need to be classes)</b> that the method can raise at a certain moment.
|
65
66
|
|
66
|
-
The exception classes used <b>must inherit</b> from <tt>WashOut::SOAPError</tt>, which has by default a error code and a message as attributes but you can extend it by adding more
|
67
|
+
The exception classes used <b>must inherit</b> from <tt>WashOut::SOAPError</tt>, which has by default a error code and a message as attributes but you can extend it by adding more attributes to your own custom class.
|
67
68
|
|
68
|
-
|
69
|
+
The WashOut::SoapError now includes Virtus.model from +virtus+ gem. This way you can add attributes like this:
|
70
|
+
|
71
|
+
|
72
|
+
class MyCustomSoapError < WashOut::SOAPError
|
73
|
+
|
74
|
+
attribute :custom_attribute, String
|
75
|
+
attribute :other_custom_attribute, Integer
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
<b> If your custom exception class doesn't have any attributes set, only the inherited attributes will appear!!!</b>
|
69
80
|
|
70
81
|
Here is an example :
|
71
82
|
|
72
|
-
soap_action "find",
|
83
|
+
soap_action "find",
|
84
|
+
:args => {:number => :integer} ,
|
85
|
+
:return => :boolean,
|
86
|
+
:raises => [MyCustomSoapError, MySecondExceptionClass ] ,
|
87
|
+
:description => "some description about this method to show in the documentation"
|
73
88
|
|
74
89
|
|
75
90
|
In order to see the documentation you must write something like this in the routes (exactly like you would do when using only WashOut)
|
@@ -96,7 +96,7 @@ module WashoutBuilderHelper
|
|
96
96
|
|
97
97
|
def get_fault_types_names(map)
|
98
98
|
defined = map.select{|operation, formats| !formats[:raises].blank? }
|
99
|
-
defined = defined.collect {|operation, formats| formats[:raises].is_a?(Array) ? formats[:raises] : [formats[:raises]] }.flatten.select { |x| x.ancestors.include?(WashOut::SOAPError) } unless defined.blank?
|
99
|
+
defined = defined.collect {|operation, formats| formats[:raises].is_a?(Array) ? formats[:raises] : [formats[:raises]] }.flatten.select { |x| x.is_a?(Class) && x.ancestors.include?(WashOut::SOAPError) } unless defined.blank?
|
100
100
|
defined.map{|item| item.to_s }.sort_by { |name| name.downcase }.uniq unless defined.blank?
|
101
101
|
end
|
102
102
|
|
@@ -154,7 +154,7 @@ module WashoutBuilderHelper
|
|
154
154
|
end
|
155
155
|
|
156
156
|
def create_html_fault_type(xml, param)
|
157
|
-
|
157
|
+
if param.is_a?(Class) && param.ancestors.include?(WashOut::SOAPError)
|
158
158
|
xml.h3 "#{param}"
|
159
159
|
xml.a("name" => "#{param}") {}
|
160
160
|
xml.ul("class" => "pre") {
|
@@ -173,7 +173,7 @@ module WashoutBuilderHelper
|
|
173
173
|
end
|
174
174
|
xml.li { |pre| pre << "<span class='blue'>string</span> <span class='bold'>backtrace</span>" }
|
175
175
|
}
|
176
|
-
|
176
|
+
end
|
177
177
|
end
|
178
178
|
|
179
179
|
def create_html_public_methods(xml, map)
|
@@ -287,7 +287,7 @@ module WashoutBuilderHelper
|
|
287
287
|
faults = formats[:raises]
|
288
288
|
faults = [formats[:raises]] if !faults.is_a?(Array)
|
289
289
|
|
290
|
-
faults = faults.select { |x| x.ancestors.include?(WashOut::SOAPError) }
|
290
|
+
faults = faults.select { |x| x.is_a?(Class) && x.ancestors.include?(WashOut::SOAPError) }
|
291
291
|
unless faults.blank?
|
292
292
|
xml.p "Exceptions:"
|
293
293
|
xml.ul {
|