washout_builder 0.8.12 → 0.9.0
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.
- checksums.yaml +8 -8
- data/Gemfile +1 -1
- data/app/helpers/washout_builder_helper.rb +15 -18
- data/lib/washout_builder.rb +6 -4
- data/lib/washout_builder/version.rb +1 -1
- data/washout_builder.gemspec +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmMyNTM3ODQwY2ZkYzIzMDRlZTNlZDI1ZThmNWY3Y2U2NTgyYmUyZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmZmNTQxNDNiMGM3MjY5MmU2Y2IxYTJkZTg3NjRmYTI1MTZiZTc1OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmRhMjM3OWM0MWVmMzg2MmQ0ZmMxNzZiZjE4OWI0NDAyMzIxMGE4NjYwY2Iy
|
10
|
+
ZWUwYzlhN2FjM2Y2MGZmYmEwZTE4OTRlZWJmMWZhNGFlMzk2NDRkMTA2OWE3
|
11
|
+
ZTBhYTE1ODk1ZWI0ZjlkY2VhYjk0MjE5MTRmODE2YWQ3ZjRhZWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTc3NWY5Y2I3YzJjMjYyZDVlZGM0NmEwOTViNzc1YmEzNzcyZjczNzkyMDc5
|
14
|
+
Yzk2YmE1NDIzNDg4N2JlMjhlMTJjMDIwZmU5NWI1MDNhODhiM2Q1MGUxNDg1
|
15
|
+
NmE4MDkyZWNmYThkNWNjMzYxOTE4YTU5YjQwMDc5YmEwMDliMGM=
|
data/Gemfile
CHANGED
@@ -96,8 +96,8 @@ 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.
|
100
|
-
defined.map{|item| item.
|
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?
|
100
|
+
defined.map{|item| item.to_s }.sort_by { |name| name.downcase }.uniq unless defined.blank?
|
101
101
|
end
|
102
102
|
|
103
103
|
def get_soap_action_names(map)
|
@@ -154,29 +154,26 @@ module WashoutBuilderHelper
|
|
154
154
|
end
|
155
155
|
|
156
156
|
def create_html_fault_type(xml, param)
|
157
|
-
|
158
|
-
xml.h3 "#{param
|
159
|
-
xml.a("name" => "#{param
|
157
|
+
# if param.class.ancestors.include?(WashOut::SOAPError)
|
158
|
+
xml.h3 "#{param}"
|
159
|
+
xml.a("name" => "#{param}") {}
|
160
160
|
xml.ul("class" => "pre") {
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
if attribute!=
|
165
|
-
attribute_class = param.send(attribute).class.name.downcase
|
161
|
+
fault_structure = param.attribute_set.inject({}) {|h, elem| h["#{elem.name}"]= "#{elem.primitive.to_s.downcase}"; h }
|
162
|
+
|
163
|
+
fault_structure.each do |attribute, attribute_type|
|
164
|
+
if attribute!= 'backtrace'
|
166
165
|
xml.li { |pre|
|
167
|
-
if WashoutBuilder::Type::BASIC_TYPES.include?(
|
168
|
-
pre << "<span class='blue'>#{
|
166
|
+
if WashoutBuilder::Type::BASIC_TYPES.include?(attribute_type) || attribute_type == "nilclass"
|
167
|
+
pre << "<span class='blue'>#{attribute_type == "nilclass" ? "string" : attribute_type }</span> <span class='bold'>#{attribute}</span>"
|
169
168
|
else
|
170
|
-
pre << "<a href='##{
|
169
|
+
pre << "<a href='##{attribute_type}'><span class='lightBlue'>#{attribute_type}</span></a> <span class='bold'>#{attribute}</span>"
|
171
170
|
end
|
172
171
|
}
|
173
172
|
end
|
174
173
|
end
|
175
|
-
xml.li { |pre| pre << "<span class='blue'>integer</span> <span class='bold'>code</span>" }
|
176
|
-
xml.li { |pre| pre << "<span class='blue'>string</span> <span class='bold'>message</span>" }
|
177
174
|
xml.li { |pre| pre << "<span class='blue'>string</span> <span class='bold'>backtrace</span>" }
|
178
175
|
}
|
179
|
-
|
176
|
+
# end
|
180
177
|
end
|
181
178
|
|
182
179
|
def create_html_public_methods(xml, map)
|
@@ -290,12 +287,12 @@ module WashoutBuilderHelper
|
|
290
287
|
faults = formats[:raises]
|
291
288
|
faults = [formats[:raises]] if !faults.is_a?(Array)
|
292
289
|
|
293
|
-
faults = faults.select { |x| x.
|
290
|
+
faults = faults.select { |x| x.ancestors.include?(WashOut::SOAPError) }
|
294
291
|
unless faults.blank?
|
295
292
|
xml.p "Exceptions:"
|
296
293
|
xml.ul {
|
297
294
|
faults.each do |p|
|
298
|
-
xml.li("class" => "pre"){ |y| y<< "<a href='##{p.
|
295
|
+
xml.li("class" => "pre"){ |y| y<< "<a href='##{p.to_s}'><span class='lightBlue'> #{p.to_s}</span></a>" }
|
299
296
|
end
|
300
297
|
}
|
301
298
|
end
|
data/lib/washout_builder.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'wash_out'
|
2
|
-
|
2
|
+
require 'virtus'
|
3
3
|
require 'washout_builder/soap'
|
4
4
|
require 'washout_builder/engine'
|
5
5
|
require 'washout_builder/dispatcher'
|
@@ -25,10 +25,12 @@ end
|
|
25
25
|
|
26
26
|
|
27
27
|
|
28
|
-
WashOut::SOAPError.send :include,
|
29
|
-
|
30
|
-
|
28
|
+
WashOut::SOAPError.send :include, Virtus.model
|
31
29
|
|
30
|
+
WashOut::SOAPError.class_eval do
|
31
|
+
attribute :code, Integer
|
32
|
+
attribute :message, String
|
33
|
+
end
|
32
34
|
|
33
35
|
|
34
36
|
ActionController::Base.class_eval do
|
data/washout_builder.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: washout_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bogdanRada
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.10.0.beta.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: virtus
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.0.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.0.0
|
41
55
|
description: ! 'WashOut Soap Service Documentation builder (extends WashOut https://github.com/inossidabile/wash_out/) '
|
42
56
|
email: raoul_ice@yahoo.com
|
43
57
|
executables: []
|