washout_builder 0.13.1 → 0.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/views/wash_with_html/doc.builder +1 -6
- data/lib/washout_builder/document/exception_model.rb +2 -32
- data/lib/washout_builder/document/generator.rb +7 -28
- data/lib/washout_builder/version.rb +1 -1
- data/spec/lib/washout_builder/document/exception_model_spec.rb +12 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjdhNzFiNjYwNDg0M2U0ZGQ5ZTcxNjg3NWIzMDJiYmIzYjZmYTI4MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmY0Y2ZiM2NjZWQzYzEwZTNhZThhNjJkYzczNzczOGI3Y2M0NGYzYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDc1YjY5MDBjYjkyYWIyMmE3MTE0M2ZlZGE2OGY1OTQzZDAxZTNiNGU4YWRj
|
10
|
+
ZTQzODRlZmUyZmIwYzUxNzBmY2RmMTEwYjQzNDk0NDE2MjBhMmFkMjFmZjJh
|
11
|
+
Y2NkZTNlYmQ1ZDU4YjZjODQxOGI2ZmJiNDA0ZjI1MjFmN2E3ZjE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2Y3MTRjNzZkYWE0MjUyZDRlMDE1YmZkNDgxYzdiOWMxMzRlYzdmYjRkMTg5
|
14
|
+
M2NjNjI4ZDgwOTczZTlkM2JmYWJmYmIyYTdhZGQ0NjZhYWE4N2Q0ZWUyZTlj
|
15
|
+
ODM3OWVhNWQwMmE1YjM3ZTllNjExNWUwMGM5NGIxMjEzN2IyOGM=
|
@@ -50,7 +50,7 @@ xml.html( "xmlns" => "http://www.w3.org/1999/xhtml" ) {
|
|
50
50
|
|
51
51
|
xml.h2 "Index "
|
52
52
|
@complex_types = @document.complex_types
|
53
|
-
@fault_types
|
53
|
+
@fault_types = @document.fault_types
|
54
54
|
unless @complex_types.blank?
|
55
55
|
xml.p "Complex Types: "
|
56
56
|
|
@@ -58,11 +58,6 @@ xml.html( "xmlns" => "http://www.w3.org/1999/xhtml" ) {
|
|
58
58
|
@complex_types.each do |hash|
|
59
59
|
xml.li { |y| y << "<a href='##{hash[:class]}'><span class='pre'>#{hash[:class]}</span></a>" }
|
60
60
|
end
|
61
|
-
unless @fault_complex_types.blank?
|
62
|
-
@fault_complex_types.each do |hash|
|
63
|
-
xml.li { |y| y << "<a href='##{hash[:fault].to_s}'><span class='pre'>#{hash[:fault].to_s}</span></a>" }
|
64
|
-
end
|
65
|
-
end
|
66
61
|
end
|
67
62
|
|
68
63
|
end
|
@@ -37,25 +37,7 @@ module WashoutBuilder
|
|
37
37
|
get_virtus_model_structure.delete_if{|key,value| keys.include?(key) }
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
|
-
# def attr_details_array?(attr_details)
|
42
|
-
# attr_details[:primitive].to_s.downcase == "array"
|
43
|
-
# end
|
44
|
-
#
|
45
|
-
# def attr_details_basic_type?(attr_details, field)
|
46
|
-
# WashoutBuilder::Type::BASIC_TYPES.include?(attr_details[field.to_sym].to_s.downcase)
|
47
|
-
# end
|
48
|
-
|
49
|
-
# def get_virtus_member_type_primitive(attr_details)
|
50
|
-
# complex_class = nil
|
51
|
-
# if attr_details_array?(attr_details) && !attr_details_basic_type?(attr_details, "member_type")
|
52
|
-
# complex_class = attr_details[:member_type]
|
53
|
-
# elsif !attr_details_array?(attr_details) && !attr_details_basic_type?(attr_details, "primitive")
|
54
|
-
# complex_class = attr_details[:primitive]
|
55
|
-
# end
|
56
|
-
# complex_class
|
57
|
-
# end
|
58
|
-
#
|
40
|
+
|
59
41
|
|
60
42
|
def get_exception_attributes
|
61
43
|
attrs = self.instance_methods.find_all do |method|
|
@@ -86,19 +68,7 @@ module WashoutBuilder
|
|
86
68
|
return h
|
87
69
|
end
|
88
70
|
|
89
|
-
|
90
|
-
# def self.extract_nested_complex_types(complex_class, complex_types)
|
91
|
-
# unless complex_class.nil?
|
92
|
-
# param_class = complex_class.is_a?(Class) ? complex_class : complex_class.constantize rescue nil
|
93
|
-
# if param_class.present? && WashoutBuilder::Type.valid_fault_class?(param_class)
|
94
|
-
# param_class.send :extend, WashoutBuilder::Document::ExceptionModel
|
95
|
-
# param_class.get_fault_class_ancestors( complex_types)
|
96
|
-
# elsif param_class.present? && !WashoutBuilder::Type.valid_fault_class?(param_class)
|
97
|
-
# raise RuntimeError, "Non-existent use of `#{param_class}` type name or this class does not inherit from SoapError. Consider using classified types that include SoapError for exception classes."
|
98
|
-
# end
|
99
|
-
# end
|
100
|
-
# end
|
101
|
-
|
71
|
+
|
102
72
|
end
|
103
73
|
end
|
104
74
|
end
|
@@ -92,40 +92,19 @@ module WashoutBuilder
|
|
92
92
|
exceptions_raised.select { |x| WashoutBuilder::Type.valid_fault_class?(x) } unless actions_with_exceptions.blank?
|
93
93
|
end
|
94
94
|
|
95
|
-
def get_complex_fault_types(
|
95
|
+
def get_complex_fault_types(base_fault_array)
|
96
|
+
fault_types =[]
|
96
97
|
defined = filter_exceptions_raised
|
97
|
-
|
98
|
-
defined = [WashoutBuilder::Type.get_fault_classes.first]
|
99
|
-
else
|
100
|
-
defined << WashoutBuilder::Type.get_fault_classes.first
|
101
|
-
end
|
98
|
+
defined = defined.blank? ? base_fault_array : defined.concat(base_fault_array)
|
102
99
|
defined.each{ |exception_class| exception_class.get_fault_class_ancestors( fault_types, true)} unless defined.blank?
|
103
100
|
fault_types
|
104
101
|
end
|
105
102
|
|
106
103
|
def fault_types
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
complex_types = sort_complex_types(complex_types, "fault")
|
112
|
-
[fault_types, complex_types]
|
113
|
-
end
|
114
|
-
|
115
|
-
# def extract_nested_complex_types_from_exceptions(fault_types)
|
116
|
-
# complex_types = []
|
117
|
-
# fault_types.each do |hash|
|
118
|
-
# hash[:structure].each do |attribute, attr_details|
|
119
|
-
# complex_class = hash[:fault].get_virtus_member_type_primitive(attr_details)
|
120
|
-
# WashoutBuilder::Document::ExceptionModel.extract_nested_complex_types(complex_class, complex_types)
|
121
|
-
# end
|
122
|
-
# end
|
123
|
-
# complex_types
|
124
|
-
# end
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
104
|
+
base_fault =[WashoutBuilder::Type.get_fault_classes.first]
|
105
|
+
fault_types = get_complex_fault_types(base_fault)
|
106
|
+
sort_complex_types(fault_types, "fault")
|
107
|
+
end
|
129
108
|
|
130
109
|
end
|
131
110
|
end
|
@@ -14,18 +14,18 @@ describe WashoutBuilder::Document::ExceptionModel do
|
|
14
14
|
it "gets the strcuture" do
|
15
15
|
subject.get_virtus_model_structure.should eq({"code"=>{:primitive=>"integer", :member_type=>nil}, "message"=>{:primitive=>"string", :member_type=>nil}, "backtrace"=>{:primitive=>"string", :member_type=>nil}})
|
16
16
|
end
|
17
|
-
|
18
|
-
it "gets the member type for arrays" do
|
19
|
-
subject.get_virtus_member_type_primitive({:primitive=>"Array", :member_type=>"SomeInexistentClass"}).should eq("SomeInexistentClass")
|
20
|
-
end
|
21
|
-
|
22
|
-
it "gets the member type for clasified types" do
|
23
|
-
subject.get_virtus_member_type_primitive({:primitive=>"SomeInexistentClass", :member_type=>nil}).should eq("SomeInexistentClass")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "returns nil because is not a classified object" do
|
27
|
-
subject.get_virtus_member_type_primitive({:primitive=>"integer", :member_type=>nil}).should eq(nil)
|
28
|
-
end
|
17
|
+
#
|
18
|
+
# it "gets the member type for arrays" do
|
19
|
+
# subject.get_virtus_member_type_primitive({:primitive=>"Array", :member_type=>"SomeInexistentClass"}).should eq("SomeInexistentClass")
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# it "gets the member type for clasified types" do
|
23
|
+
# subject.get_virtus_member_type_primitive({:primitive=>"SomeInexistentClass", :member_type=>nil}).should eq("SomeInexistentClass")
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# it "returns nil because is not a classified object" do
|
27
|
+
# subject.get_virtus_member_type_primitive({:primitive=>"integer", :member_type=>nil}).should eq(nil)
|
28
|
+
# end
|
29
29
|
|
30
30
|
|
31
31
|
it "gets the strcuture" do
|