Skip to content

Commit

Permalink
Merge branch 'release/v0.12.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed May 23, 2014
2 parents d1174e2 + ea478d1 commit adf05de
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 106 deletions.
7 changes: 6 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,18 @@ In the following file +config/routes.rb+ you can put this configuration
wash_out :rumbas
wash_out :my_other_service

namespace :api do
wash_out :project_service
end

mount WashoutBuilder::Engine => "/washout"
end

You can access the url +/washout+ and you will see a list with available services ( in our case there are only two : The RumbasController and MyOtherServiceController) with links to their documentation and where you can find the WSDL.

If you want to access directly the hml documentation that was generated for RumbasController you can do that by accessing url +/rumbas/doc+ And the WSDL will be available at +/rumbas/wsdl+
If you want to access directly the hml documentation that was generated for RumbasController you can do that by accessing url with camelcase name +/washout/Rumbas+ or without camelcase +/washout/rumbas+

For namespaced services you can access documentation url like this +/washout/Api::ProjectService+ or like this +/washout/api/project_service+

When specifying the <b>soap_service</b> you can also pass a <b>option for description</b> . Here is an example

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/washout_builder/washout_builder_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def all_controllers

def map_controllers
all_controllers.map do |route|
route.defaults[:controller] if route.defaults[:action] == "_generate_doc"
route.defaults[:controller] if route.defaults[:action] == "_generate_wsdl"
end.uniq.compact
end

def controller_is_a_service?(controller)
route = all_controllers.detect do |route|
route.defaults[:controller].try(:camelize) == controller.camelize && route.defaults[:action] == "_generate_doc"
route.defaults[:controller].try(:camelize) == controller.camelize && route.defaults[:action] == "_generate_wsdl"
end
end

Expand All @@ -71,7 +71,7 @@ def service_endpoint(controller_name)
end

def service_documentation_url(controller_name)
"#{request.protocol}#{request.host_with_port}/#{controller_name}/doc"
"#{washout_builder.root_url}#{controller_name.camelize}"
end

end
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WashoutBuilder::Engine.routes.draw do
root :to =>"washout_builder#all"
match '*name' => "washout_builder#all", :as => :washout_builder_service, :via => :get
match '/*name' => "washout_builder#all", :as => :washout_builder_service, :via => :get
end
17 changes: 0 additions & 17 deletions lib/washout_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,10 @@
require 'washout_builder/document/complex_type'
require 'washout_builder/document/virtus_model'
require 'washout_builder/document/generator'
require 'washout_builder/dispatcher'
require 'washout_builder/type'
require 'washout_builder/version'


module ActionDispatch::Routing
class Mapper

alias_method :original_wash_out,:wash_out

# Adds the routes for a SOAP endpoint at +controller+.
def wash_out(controller_name, options={})
options.reverse_merge!(@scope) if @scope

match "#{controller_name}/doc" => "#{controller_name}#_generate_doc", :via => :get, :format => false
original_wash_out(controller_name, options)


end
end
end

Virtus::InstanceMethods::Constructor.class_eval do
alias_method :original_initialize,:initialize
Expand Down
28 changes: 0 additions & 28 deletions lib/washout_builder/dispatcher.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/washout_builder/soap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def soap_action(action, options={})
included do
include WashOut::Configurable if defined?(WashOut::Configurable)
include WashOut::Dispatcher if defined?(WashOut::Dispatcher)
include WashoutBuilder::Dispatcher
self.soap_actions = {}
end
end
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.11.8"
VERSION = "0.12.0"
end
54 changes: 0 additions & 54 deletions spec/lib/washout_builder/dispatcher_spec.rb

This file was deleted.

0 comments on commit adf05de

Please sign in to comment.