diff --git a/app/helpers/washout_builder_helper.rb b/app/helpers/washout_builder_helper.rb index dc7b47f..cc8e5f7 100644 --- a/app/helpers/washout_builder_helper.rb +++ b/app/helpers/washout_builder_helper.rb @@ -181,12 +181,18 @@ def create_html_public_method(xml, operation, formats) xml.p "Return value:" xml.ul { xml.li { - if !formats[:out].nil? - + unless formats[:out].nil? + complex_class = formats[:out][0].get_complex_class_name if WashoutBuilder::Type::BASIC_TYPES.include?(formats[:out][0].type) xml.span("class" => "pre") { |xml| xml.span("class" => "blue") { |sp| sp << "#{formats[:out][0].type}" } } else - xml.span("class" => "pre") { xml.a("href" => "##{formats[:out][0].type}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"#{formats[:out][0].type}" } } } + unless complex_class.nil? + if formats[:out][0].multiplied == false + xml.span("class" => "pre") { xml.a("href" => "##{complex_class}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"#{complex_class}" } } } + else + xml.span("class" => "pre") { xml.a("href" => "##{complex_class}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"Array of #{complex_class}" } } } + end + end end else xml.span("class" => "pre") { |sp| sp << "void" } diff --git a/lib/washout_builder/document/generator.rb b/lib/washout_builder/document/generator.rb index adfe035..aae471d 100644 --- a/lib/washout_builder/document/generator.rb +++ b/lib/washout_builder/document/generator.rb @@ -74,9 +74,9 @@ def fault_types 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) || x.ancestors.include?(SOAPError) ) } unless defined.blank? fault_types = [] if defined.blank? - defined = [SOAPError] + defined = [WashOut::SOAPError] else - defined << SOAPError + defined << WashOut::SOAPError end defined.each{ |exception_class| exception_class.get_fault_class_ancestors( fault_types, true)} unless defined.blank? complex_types = extract_nested_complex_types_from_exceptions(fault_types) diff --git a/lib/washout_builder/version.rb b/lib/washout_builder/version.rb index b3f18c6..0c77931 100644 --- a/lib/washout_builder/version.rb +++ b/lib/washout_builder/version.rb @@ -1,3 +1,3 @@ module WashoutBuilder - VERSION = "0.10.3" + VERSION = "0.10.4" end diff --git a/spec/lib/washout_builder/document/generator_spec.rb b/spec/lib/washout_builder/document/generator_spec.rb index e69de29..5b785e7 100644 --- a/spec/lib/washout_builder/document/generator_spec.rb +++ b/spec/lib/washout_builder/document/generator_spec.rb @@ -0,0 +1,10 @@ +#encoding:utf-8 +require 'spec_helper' + + +describe WashoutBuilder::Document::Generator do + + let(:generator) { FactoryGirl.build(:generator)} + + +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8bc81a6..46f25a6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -21,6 +21,13 @@ require "savon" require 'wash_out' +require 'capybara/rspec' +require 'capybara/rails' +require 'capybara/firebug/rspec' +require 'forgery/forgery' +require 'webmock/rspec' +require 'headless' + Rails.backtrace_cleaner.remove_silencers! # Load support files @@ -33,8 +40,19 @@ # mock framework # config.mock_with :mocha + #config.include Savon::Spec::Macros #config.include AbstractController::Translation + config.before(:suite) do + # Reload factories in spec/factories. + FactoryGirl.reload + # Blocks all remote HTTP requests by default, they need to be stubbed. + WebMock.disable_net_connect!(:allow_localhost => true) + if !RUBY_PLATFORM.downcase.include?('darwin') && !ENV['NO_HEADLESS'] + Headless.new(reuse: false, destroy_on_exit: false).start + end + end + config.mock_with :rspec config.before(:all) do WashoutBuilder::Engine.config.wash_out = { diff --git a/washout_builder.gemspec b/washout_builder.gemspec index 3551beb..5943862 100644 --- a/washout_builder.gemspec +++ b/washout_builder.gemspec @@ -4,10 +4,10 @@ Gem::Specification.new do |s| s.name = "washout_builder" s.version = WashoutBuilder::VERSION s.platform = Gem::Platform::RUBY - s.summary = "WashOut Soap Service Documentation builder (extends WashOut https://github.com/inossidabile/wash_out/)" + s.summary = "WashOut Soap Service HTML-Documentation generator (extends WashOut https://github.com/inossidabile/wash_out/)" s.email = "raoul_ice@yahoo.com" s.homepage = "http://github.com/bogdanRada/washout_builder/" - s.description = "WashOut Soap Service Documentation builder (extends WashOut https://github.com/inossidabile/wash_out/) " + s.description = "WashOut Soap Service HTML-Documentation generator (extends WashOut https://github.com/inossidabile/wash_out/) " s.authors = ["bogdanRada"] s.date = "2013-11-20"