washout_builder 0.8.12 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTFiNjU5Y2M2NzAzNjg2N2EyYWU1ODU3OWRkZTE2YzAyNjBmNjhlNg==
4
+ NmMyNTM3ODQwY2ZkYzIzMDRlZTNlZDI1ZThmNWY3Y2U2NTgyYmUyZA==
5
5
  data.tar.gz: !binary |-
6
- MmFkMDdmMGZhYTVjOTE4MmNhNjc5ZmUxZmMyYzk2NDk4YzZjNzQ0MQ==
6
+ ZmZmNTQxNDNiMGM3MjY5MmU2Y2IxYTJkZTg3NjRmYTI1MTZiZTc1OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWMxOTFiNzM1Y2VlNDE0ZTU2NDRkYjU0ZTc4YWIzOTA5NTU3ZTJiNGU0YmY3
10
- ZDYwOTg5YTQzOWFiNjBjNTU4ZGMyZDlmYjYxNDA1Yjg4YmFhYjJhYWExNTdi
11
- NmExZDExZWM0YWY1ZWFkNTA5ZDNkYTk4YjViYTc1YzY0Mjk3Y2M=
9
+ ZmRhMjM3OWM0MWVmMzg2MmQ0ZmMxNzZiZjE4OWI0NDAyMzIxMGE4NjYwY2Iy
10
+ ZWUwYzlhN2FjM2Y2MGZmYmEwZTE4OTRlZWJmMWZhNGFlMzk2NDRkMTA2OWE3
11
+ ZTBhYTE1ODk1ZWI0ZjlkY2VhYjk0MjE5MTRmODE2YWQ3ZjRhZWU=
12
12
  data.tar.gz: !binary |-
13
- Zjc4ZGNiMzg4NzhkNjEyNTZlMzI2YmJmYTU0MzdmNjlkNDMwMGExM2E5MzVk
14
- Y2JhY2QxODU3NDliMWE0ZjVmZGVlZDY1YjViYzRiYjZhYTQzNzZjMmQ5M2Nm
15
- NzQyZjY3YzYyOTdhZjZhZTUxZjcyNTVmODMwNTc3YWUxOWYzZWI=
13
+ NTc3NWY5Y2I3YzJjMjYyZDVlZGM0NmEwOTViNzc1YmEzNzcyZjczNzkyMDc5
14
+ Yzk2YmE1NDIzNDg4N2JlMjhlMTJjMDIwZmU5NWI1MDNhODhiM2Q1MGUxNDg1
15
+ NmE4MDkyZWNmYThkNWNjMzYxOTE4YTU5YjQwMDc5YmEwMDliMGM=
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ gemspec
4
4
 
5
5
 
6
6
  gem 'wash_out', git: 'git://github.com/inossidabile/wash_out.git'
7
-
7
+ gem 'virtus'
8
8
  gem 'wasabi'
9
9
  gem 'savon', '>= 2.0.0'
10
10
  gem 'httpi', :git => 'git://github.com/savonrb/httpi.git'
@@ -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.class.ancestors.include?(WashOut::SOAPError) } unless defined.blank?
100
- defined.map{|item| item.class.to_s }.sort_by { |name| name.downcase }.uniq unless defined.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?
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
- if param.class.ancestors.include?(WashOut::SOAPError)
158
- xml.h3 "#{param.class}"
159
- xml.a("name" => "#{param.class}") {}
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
- param.class.accessible_attributes.each do |attribute|
164
- if attribute!="code" && attribute != "message" && attribute!= 'backtrace'
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?(attribute_class) || attribute_class == "nilclass"
168
- pre << "<span class='blue'>#{attribute_class == "nilclass" ? "string" : attribute_class }</span>&nbsp;<span class='bold'>#{attribute}</span>"
166
+ if WashoutBuilder::Type::BASIC_TYPES.include?(attribute_type) || attribute_type == "nilclass"
167
+ pre << "<span class='blue'>#{attribute_type == "nilclass" ? "string" : attribute_type }</span>&nbsp;<span class='bold'>#{attribute}</span>"
169
168
  else
170
- pre << "<a href='##{attribute.class.name}'><span class='lightBlue'>#{attribute.class.name}</span></a>&nbsp;<span class='bold'>#{attribute}</span>"
169
+ pre << "<a href='##{attribute_type}'><span class='lightBlue'>#{attribute_type}</span></a>&nbsp;<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>&nbsp;<span class='bold'>code</span>" }
176
- xml.li { |pre| pre << "<span class='blue'>string</span>&nbsp;<span class='bold'>message</span>" }
177
174
  xml.li { |pre| pre << "<span class='blue'>string</span>&nbsp;<span class='bold'>backtrace</span>" }
178
175
  }
179
- end
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.class.ancestors.include?(WashOut::SOAPError) }
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.class.to_s}'><span class='lightBlue'> #{p.class.to_s}</span></a>" }
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
@@ -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, ActiveModel::MassAssignmentSecurity if defined?(WashOut::SOAPError) && defined?(ActiveModel::MassAssignmentSecurity)
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
@@ -1,3 +1,3 @@
1
1
  module WashoutBuilder
2
- VERSION = "0.8.12"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -17,4 +17,5 @@ Gem::Specification.new do |s|
17
17
  s.require_paths = ["lib"]
18
18
  s.add_dependency("nori", ">= 2.0.0")
19
19
  s.add_dependency("wash_out", ">= 0.10.0.beta.1")
20
+ s.add_dependency("virtus", ">= 1.0.0")
20
21
  end
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.8.12
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: []