Skip to content

Commit

Permalink
Merge branch 'release/v0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed Dec 9, 2013
2 parents cacd494 + 7f80776 commit 3da05a7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 68 deletions.
28 changes: 14 additions & 14 deletions app/helpers/washout_builder_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = "&nbsp;&nbsp;&nbsp;&nbsp;"
if mlen > 0
j=0
while j<mlen
param = formats[:input][j]
param = formats[:in][j]
use_spacer = mlen > 1 ? true : false
if WashoutBuilder::Type::BASIC_TYPES.include?(param.type)
pre << "#{use_spacer ? spacer: ''}<span class='blue'>#{param.type}</span>&nbsp;<span class='bold'>#{param.name}</span>"
Expand Down Expand Up @@ -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<mlen
param = formats[:input][j]
param = formats[:in][j]
xml.li("class" => "pre") { |pre|
if WashoutBuilder::Type::BASIC_TYPES.include?(param.type)
pre << "<span class='blue'>#{param.type}</span>&nbsp;<span class='bold'>#{param.name}</span>"
Expand All @@ -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" }
Expand Down
34 changes: 0 additions & 34 deletions lib/washout_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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




Expand Down
18 changes: 0 additions & 18 deletions lib/washout_builder/soap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/washout_builder/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module WashoutBuilder
VERSION = "0.7.2"
VERSION = "0.8.0"
end
2 changes: 1 addition & 1 deletion washout_builder.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3da05a7

Please sign in to comment.