washout_builder 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/app/controllers/washout_builder/washout_builder_controller.rb +14 -12
- data/lib/washout_builder.rb +21 -0
- data/lib/washout_builder/type.rb +1 -1
- data/lib/washout_builder/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1328c1fa0594e65be4676b8297d41e56adbf698
|
4
|
+
data.tar.gz: c15f894745514023201ce24c7741e95cf5d9b8f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4875aea491dd888fa61cac8cf890a41a4d76adc598f3d87e0cbe496741aea0a59edb05aed5ed78f8e2a8644bc21360d1e74016cfc5e2d89f09aab169fc6fd2ce
|
7
|
+
data.tar.gz: 4da1ad2e73e3acd3c245718fe527ceab4239ab1acb551e53d6a22ee0cdb3b815994106b825f5800af611831afdde459ef6fc9c9fed3ad1a969a2d155b84f6d4b
|
data/README.md
CHANGED
@@ -10,6 +10,12 @@ WashOutBuilder is a Soap Service Documentation generator (extends [WashOut](http
|
|
10
10
|
|
11
11
|
The way [WashOut](https://github.com/inossidabile/wash_out) is used is not modified, it just extends its functionality by generating html documentation to your services that you write
|
12
12
|
|
13
|
+
NEW Improvements in version 1.3.0
|
14
|
+
---------------------------------
|
15
|
+
|
16
|
+
- link to accessing documentation for a single controller is now easier. You can use the same route as for seeing WSLD, but replacing **/wsdl** with **/soap_doc**
|
17
|
+
- The old way of acessing documentation is still kept, so if you mounted the engine at **/washout_builder**, you can still acess the documentation by appending to this url the full name of the controller including the namespace and the engine name(in case the controller is from a engine) as described below.
|
18
|
+
|
13
19
|
Features
|
14
20
|
--------
|
15
21
|
|
@@ -15,20 +15,21 @@ module WashoutBuilder
|
|
15
15
|
#
|
16
16
|
# @api public
|
17
17
|
def all
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
18
|
+
params[:name] = params[:defaults][:name] if params[:defaults].present?
|
19
|
+
find_all_routes
|
20
|
+
route = params[:name].present? ? controller_is_a_service?(params[:name]) : nil
|
21
|
+
if route.present? && defined?(controller_class(params[:name]))
|
22
|
+
@document = WashoutBuilder::Document::Generator.new(controller_class(params[:name]).controller_path)
|
23
|
+
render template: 'wash_with_html/doc', layout: false,
|
24
|
+
content_type: 'text/html'
|
25
|
+
elsif
|
26
|
+
@services = all_services
|
27
|
+
render template: 'wash_with_html/all_services', layout: false,
|
28
|
+
content_type: 'text/html'
|
29
|
+
end
|
29
30
|
end
|
30
31
|
|
31
|
-
|
32
|
+
private
|
32
33
|
|
33
34
|
# tries to find all services by searching through the rails controller
|
34
35
|
# and returns their namespace, endpoint and a documentation url
|
@@ -165,6 +166,7 @@ module WashoutBuilder
|
|
165
166
|
# @return [String] The documentation url for the web service ( relative to base url)
|
166
167
|
# @api private
|
167
168
|
def service_documentation_url(controller_name)
|
169
|
+
#service_namespace(controller_name).gsub('/wsdl', '/soap_doc')
|
168
170
|
"#{washout_builder.root_url}#{controller_naming(controller_name)}"
|
169
171
|
end
|
170
172
|
end
|
data/lib/washout_builder.rb
CHANGED
@@ -6,6 +6,27 @@ require 'active_support/core_ext/string/output_safety.rb'
|
|
6
6
|
|
7
7
|
Gem.find_files('washout_builder/**/*.rb').each { |path| require path }
|
8
8
|
|
9
|
+
|
10
|
+
ActionDispatch::Routing::Mapper.class_eval do
|
11
|
+
alias_method :original_wash_out, :wash_out
|
12
|
+
# Adds the routes for a SOAP endpoint at +controller+.
|
13
|
+
def wash_out(controller_name, options={})
|
14
|
+
if @scope
|
15
|
+
scope_frame = @scope.respond_to?(:frame) ? @scope.frame : @scope
|
16
|
+
options.each_with_index { |key, value| scope_frame[key] = value }
|
17
|
+
end
|
18
|
+
|
19
|
+
controller_class_name = [options[:module], controller_name].compact.join("/").underscore
|
20
|
+
|
21
|
+
match "#{controller_name}/soap_doc" => WashoutBuilder::Engine, via: :get,
|
22
|
+
defaults: { name: "#{controller_class_name}" },
|
23
|
+
format: false,
|
24
|
+
as: "#{controller_class_name}_soap_doc"
|
25
|
+
|
26
|
+
original_wash_out(controller_name, options)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
9
30
|
# finds all the exception class and extends them by including the ExceptionModel module in order to be
|
10
31
|
# able to generate documentation for exceptions
|
11
32
|
WashoutBuilder::Type.all_fault_classes.each do |exception_class|
|
data/lib/washout_builder/type.rb
CHANGED
@@ -26,7 +26,7 @@ module WashoutBuilder
|
|
26
26
|
classes << WashOut::SOAP::ClassMethods if defined?(WashOut::SOAP::ClassMethods)
|
27
27
|
classes
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
# returns the base class that is used for parsing definitions of soap actions
|
31
31
|
#
|
32
32
|
# @return [Class] returns the base class that is used for parsing definitions of soap actions
|