washout_builder 1.2.4 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2c28b176b2de0598f62ef2d7aa9de7af602f3cf
4
- data.tar.gz: eed01ecb9d7f866619501586dab38178c94e6124
3
+ metadata.gz: f1328c1fa0594e65be4676b8297d41e56adbf698
4
+ data.tar.gz: c15f894745514023201ce24c7741e95cf5d9b8f9
5
5
  SHA512:
6
- metadata.gz: 2987851f0993d3628193353e0117f04a9b992b45dcf02e673d607ff57fb3345124eebdeae7437f65c3baad9474cf4e00ed737efcaf4a2f9b2900b1b98ea92665
7
- data.tar.gz: ea68df3f7771dad6a413c0a987d013c8f44e6cf486d7e4bec124a133520052d3c623b02d1ceb71803577942fb6d0db1f96637d2036d40fd820eb0229d50807e0
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
- find_all_routes
19
- route = params[:name].present? ? controller_is_a_service?(params[:name]) : nil
20
- if route.present?
21
- @document = WashoutBuilder::Document::Generator.new(route.defaults[:controller])
22
- render template: 'wash_with_html/doc', layout: false,
23
- content_type: 'text/html'
24
- else
25
- @services = all_services
26
- render template: 'wash_with_html/all_services', layout: false,
27
- content_type: 'text/html'
28
- end
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
- private
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
@@ -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|
@@ -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
@@ -10,9 +10,9 @@ module WashoutBuilder
10
10
  # the major version of the gem
11
11
  MAJOR = 1
12
12
  # the minor version of the gem
13
- MINOR = 2
13
+ MINOR = 3
14
14
  # the tiny version of the gem
15
- TINY = 4
15
+ TINY = 0
16
16
  # if the version should be a e
17
17
  PRE = nil
18
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: washout_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada