diff --git a/app/helpers/washout_builder_helper.rb b/app/helpers/washout_builder_helper.rb index 4224951..3d44f0b 100644 --- a/app/helpers/washout_builder_helper.rb +++ b/app/helpers/washout_builder_helper.rb @@ -80,7 +80,7 @@ def get_nested_complex_types(param, defined) def get_complex_types(map) defined = [] map.each do |operation, formats| - (formats[:input] + formats[:output]).each do |p| + (formats[:in] + formats[:out]).each do |p| defined.concat(get_nested_complex_types(p, defined)) end end @@ -182,30 +182,30 @@ def create_html_public_methods(xml, map) def create_html_public_method(xml, operation, formats) - # raise YAML::dump(formats[:input]) + # raise YAML::dump(formats[:in]) xml.h3 "#{operation}" xml.a("name" => "#{operation}") {} xml.p("class" => "pre"){ |pre| - if !formats[:output].nil? - if WashoutBuilder::Type::BASIC_TYPES.include?(formats[:output][0].type) - xml.span("class" => "blue") { |y| y<< "#{formats[:output][0].type}" } + if !formats[:out].nil? + if WashoutBuilder::Type::BASIC_TYPES.include?(formats[:out][0].type) + xml.span("class" => "blue") { |y| y<< "#{formats[:out][0].type}" } else - xml.a("href" => "##{formats[:output][0].type}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"#{formats[:output][0].type}" } } + xml.a("href" => "##{formats[:out][0].type}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"#{formats[:out][0].type}" } } end else pre << "void" end xml.span("class" => "bold") {|y| y << "#{operation} (" } - mlen = formats[:input].size + mlen = formats[:in].size xml.br if mlen > 1 spacer = "    " if mlen > 0 j=0 while j 1 ? true : false if WashoutBuilder::Type::BASIC_TYPES.include?(param.type) pre << "#{use_spacer ? spacer: ''}#{param.type} #{param.name}" @@ -241,9 +241,9 @@ def create_html_public_method(xml, operation, formats) xml.ul { j=0 - mlen = formats[:input].size + mlen = formats[:in].size while j "pre") { |pre| if WashoutBuilder::Type::BASIC_TYPES.include?(param.type) pre << "#{param.type} #{param.name}" @@ -266,12 +266,12 @@ def create_html_public_method(xml, operation, formats) xml.p "Return value:" xml.ul { xml.li { - if !formats[:output].nil? + if !formats[:out].nil? - if WashoutBuilder::Type::BASIC_TYPES.include?(formats[:output][0].type) - xml.span("class" => "pre") { |xml| xml.span("class" => "blue") { |sp| sp << "#{formats[:output][0].type}" } } + 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[:output][0].type}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"#{formats[:output][0].type}" } } } + xml.span("class" => "pre") { xml.a("href" => "##{formats[:out][0].type}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"#{formats[:out][0].type}" } } } end else xml.span("class" => "pre") { |sp| sp << "void" } diff --git a/lib/washout_builder.rb b/lib/washout_builder.rb index 88dedb8..c6cac5a 100644 --- a/lib/washout_builder.rb +++ b/lib/washout_builder.rb @@ -29,40 +29,6 @@ def wash_out(controller_name, options={}) WashOut::SOAPError.send :include, ActiveModel::MassAssignmentSecurity if defined?(WashOut::SOAPError) -if defined?(WashOut::SOAP) - WashOut::SOAP::ClassMethods.class_eval do - alias_method :original_soap_action, :soap_action - end -end - -if defined?(WashOut::Rails::Controller) - WashOut::Rails::Controller::ClassMethods.class_eval do - alias_method :original_soap_action, :soap_action - end -end - - - WashOut::Param.class_eval do - - def self.parse_builder_def(soap_config, definition) - raise RuntimeError, "[] should not be used in your params. Use nil if you want to mark empty set." if definition == [] - return [] if definition == nil - - definition = { :value => definition } unless definition.is_a?(Hash) - - definition.collect do |name, opt| - if opt.is_a? WashOut::Param - opt - elsif opt.is_a? Array - WashOut::Param.new(soap_config, name, opt[0], true) - else - WashOut::Param.new(soap_config, name, opt) - end - end - end - - end - diff --git a/lib/washout_builder/soap.rb b/lib/washout_builder/soap.rb index 073b5fc..356d1a0 100644 --- a/lib/washout_builder/soap.rb +++ b/lib/washout_builder/soap.rb @@ -7,24 +7,6 @@ module SOAP include WashOut::Rails::Controller if defined?(WashOut::Rails::Controller) - module ClassMethods - - # Define a SOAP action +action+. The function has two required +options+: - # :args and :return. Each is a type +definition+ of format described in - # WashOut::Param#parse_def. - # - # An optional option :to can be passed to allow for names of SOAP actions - # which are not valid Ruby function names. - def soap_action(action, options={}) - original_soap_action(action, options) - - current_action = self.soap_actions[action] - - current_action[:input] = WashOut::Param.parse_builder_def(soap_config, options[:args]) - current_action[:output] = WashOut::Param.parse_builder_def(soap_config, options[:return]) - - end - end included do diff --git a/lib/washout_builder/version.rb b/lib/washout_builder/version.rb index b02a846..e360b6d 100644 --- a/lib/washout_builder/version.rb +++ b/lib/washout_builder/version.rb @@ -1,3 +1,3 @@ module WashoutBuilder - VERSION = "0.7.2" + VERSION = "0.8.0" end diff --git a/washout_builder.gemspec b/washout_builder.gemspec index 133aae5..fc2e92b 100644 --- a/washout_builder.gemspec +++ b/washout_builder.gemspec @@ -16,5 +16,5 @@ Gem::Specification.new do |s| s.test_files = s.files.grep(/^(spec)/) s.require_paths = ["lib"] s.add_dependency("nori", ">= 2.0.0") - s.add_dependency("wash_out", ">= 0.9.1") + s.add_dependency("wash_out", ">= 0.10.0.beta.1") end