washout_builder 0.11.8 → 0.12.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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzcwZTFhNDc1MDQ4MDlkOTMzNDk2NjlkNjVjZDUzMmZiM2I1OGI1Nw==
4
+ ZjhmZjI2ZjY3MTcwNTI3YTEzY2Q0ZDMwYjkwZjNlNGY4Y2U3N2MzYw==
5
5
  data.tar.gz: !binary |-
6
- YzYzYmE5NmFjNDMyNmEyMTdiODhjMTE4NzBmNjUwZTE0NTcxNTA2YQ==
6
+ NDk3ODhiOTY4ZDFjMWMwOGM2OTQzYzhiYjY5ZGZkZmJkZTM3MmRiNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjRkMTNlNjY4M2M0NTExYzMxOTE3NmU0ZDE4NjEyMzZjMmRiYzYzMWZmYjM2
10
- YjQ3YTRkNGY5YmI3OWQ0ODAzNzQ3YzU2N2JlYTU0NzFmODA2MTRhMGNmNTE3
11
- NGVkOGY3ZmQ3YWNjMmIwZmYyMzFjNmRkOWM1NzZlN2Q1MDBkODE=
9
+ ODAyYzg5YjNmYzczYzUwMDllNDExODc1MTQwM2Q0YWNkYTQ3ZGQ3NTkzNmEy
10
+ NTNmNzk3YzU0ZDVjYjA2NDRkN2NhNDhjZTY3NmQ4NzI4MTRiNTZkNjU5YzZm
11
+ NDIxNTBjMGRlNWVlZjFiMGQ0ZWIyZjg5YWVkOWE1NWY4OTNiNjQ=
12
12
  data.tar.gz: !binary |-
13
- ZWJhZTUzNGQwYmY3Y2I2YmZkNjBlMjMwOTdhZjlkYzY5YmFkYWNmZTVhOWFh
14
- ZmFmMDA3NTRmMWZkODc5N2M5NjhhMmU2OWQxNmNmMjM0MjM2OWU4ZDQ1ZTEz
15
- NGFjODg1NWJhZTdjM2ViZTU4NmYwNDU4ZWU5OTBkYjhjMzQ0YTM=
13
+ NGM2ZmE2YmE2MDk3NTdjYWYyZWQxMWVjYjM0NWMzZGZmODA1ZGFiMGQ3NmIw
14
+ NjZkN2UyMzc0ODgwODg2NDQzYjRhYjc4OTFhMzNlYjUzYzZhMzg1YWE4YzE4
15
+ NTZhMGVhYzViZDhkYWUzMDYzMzc3MDBhZWMzNjlhZDM5YzRjNzI=
data/README.rdoc CHANGED
@@ -72,13 +72,22 @@ In the following file +config/routes.rb+ you can put this configuration
72
72
  wash_out :rumbas
73
73
  wash_out :my_other_service
74
74
 
75
+ namespace :api do
76
+ wash_out :project_service
77
+ end
78
+
75
79
  mount WashoutBuilder::Engine => "/washout"
76
80
  end
77
81
 
78
82
  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.
79
83
 
80
- 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+
84
+ If you want to access directly the hml documentation that was generated for RumbasController you can do that by accessing url like this:
85
+
86
+ /washout/Rumbas #camelcase name
87
+ /washout/rumbas #without camelcase
81
88
 
89
+ /washout/Api::ProjectService # for namespaced services with camelcase
90
+ /washout/api/project_service # without camelcase
82
91
 
83
92
  When specifying the <b>soap_service</b> you can also pass a <b>option for description</b> . Here is an example
84
93
 
@@ -48,13 +48,13 @@ class WashoutBuilder::WashoutBuilderController < ActionController::Base
48
48
 
49
49
  def map_controllers
50
50
  all_controllers.map do |route|
51
- route.defaults[:controller] if route.defaults[:action] == "_generate_doc"
51
+ route.defaults[:controller] if route.defaults[:action] == "_generate_wsdl"
52
52
  end.uniq.compact
53
53
  end
54
54
 
55
55
  def controller_is_a_service?(controller)
56
56
  route = all_controllers.detect do |route|
57
- route.defaults[:controller].try(:camelize) == controller.camelize && route.defaults[:action] == "_generate_doc"
57
+ route.defaults[:controller].try(:camelize) == controller.camelize && route.defaults[:action] == "_generate_wsdl"
58
58
  end
59
59
  end
60
60
 
@@ -71,7 +71,7 @@ class WashoutBuilder::WashoutBuilderController < ActionController::Base
71
71
  end
72
72
 
73
73
  def service_documentation_url(controller_name)
74
- "#{request.protocol}#{request.host_with_port}/#{controller_name}/doc"
74
+ "#{washout_builder.root_url}#{controller_name.camelize}"
75
75
  end
76
76
 
77
77
  end
data/config/routes.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  WashoutBuilder::Engine.routes.draw do
2
2
  root :to =>"washout_builder#all"
3
- match '*name' => "washout_builder#all", :as => :washout_builder_service, :via => :get
3
+ match '/*name' => "washout_builder#all", :as => :washout_builder_service, :via => :get
4
4
  end
@@ -6,27 +6,10 @@ require 'washout_builder/document/shared_complex_type'
6
6
  require 'washout_builder/document/complex_type'
7
7
  require 'washout_builder/document/virtus_model'
8
8
  require 'washout_builder/document/generator'
9
- require 'washout_builder/dispatcher'
10
9
  require 'washout_builder/type'
11
10
  require 'washout_builder/version'
12
11
 
13
12
 
14
- module ActionDispatch::Routing
15
- class Mapper
16
-
17
- alias_method :original_wash_out,:wash_out
18
-
19
- # Adds the routes for a SOAP endpoint at +controller+.
20
- def wash_out(controller_name, options={})
21
- options.reverse_merge!(@scope) if @scope
22
-
23
- match "#{controller_name}/doc" => "#{controller_name}#_generate_doc", :via => :get, :format => false
24
- original_wash_out(controller_name, options)
25
-
26
-
27
- end
28
- end
29
- end
30
13
 
31
14
  Virtus::InstanceMethods::Constructor.class_eval do
32
15
  alias_method :original_initialize,:initialize
@@ -38,7 +38,6 @@ module WashoutBuilder
38
38
  included do
39
39
  include WashOut::Configurable if defined?(WashOut::Configurable)
40
40
  include WashOut::Dispatcher if defined?(WashOut::Dispatcher)
41
- include WashoutBuilder::Dispatcher
42
41
  self.soap_actions = {}
43
42
  end
44
43
  end
@@ -1,3 +1,3 @@
1
1
  module WashoutBuilder
2
- VERSION = "0.11.8"
2
+ VERSION = "0.12.0"
3
3
  end
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: 0.11.8
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
@@ -74,7 +74,6 @@ files:
74
74
  - config/routes.rb
75
75
  - init.rb
76
76
  - lib/washout_builder.rb
77
- - lib/washout_builder/dispatcher.rb
78
77
  - lib/washout_builder/document/complex_type.rb
79
78
  - lib/washout_builder/document/generator.rb
80
79
  - lib/washout_builder/document/shared_complex_type.rb
@@ -110,7 +109,6 @@ files:
110
109
  - spec/dummy/public/favicon.ico
111
110
  - spec/dummy/public/stylesheets/.gitkeep
112
111
  - spec/dummy/script/rails
113
- - spec/lib/washout_builder/dispatcher_spec.rb
114
112
  - spec/lib/washout_builder/document/complex_type_spec.rb
115
113
  - spec/lib/washout_builder/document/generator_spec.rb
116
114
  - spec/lib/washout_builder/document/virtus_model_spec.rb
@@ -181,7 +179,6 @@ test_files:
181
179
  - spec/dummy/public/favicon.ico
182
180
  - spec/dummy/public/stylesheets/.gitkeep
183
181
  - spec/dummy/script/rails
184
- - spec/lib/washout_builder/dispatcher_spec.rb
185
182
  - spec/lib/washout_builder/document/complex_type_spec.rb
186
183
  - spec/lib/washout_builder/document/generator_spec.rb
187
184
  - spec/lib/washout_builder/document/virtus_model_spec.rb
@@ -1,28 +0,0 @@
1
-
2
- module WashoutBuilder
3
- # The WashoutBuilder::Dispatcher module should be included in a controller acting
4
- # as a SOAP endpoint. It includes actions for generating WSDL and handling
5
- # SOAP requests.
6
- module Dispatcher
7
-
8
- def _generate_doc
9
- @document = WashoutBuilder::Document::Generator.new(
10
- :config => soap_config,
11
- :service_class => self.class,
12
- :soap_actions => self.class.soap_actions
13
- )
14
-
15
- render :template => "wash_with_html/doc", :layout => false,
16
- :content_type => 'text/html'
17
- end
18
-
19
- def self.included(controller)
20
- controller.send :helper,:washout_builder
21
- controller.send :before_filter, :_authenticate_wsse, :except => [
22
- :_generate_wsdl, :_generate_doc,:_invalid_action ]
23
- controller.send :before_filter, :_map_soap_parameters, :except => [
24
- :_generate_wsdl,:_generate_doc, :_invalid_action ]
25
- end
26
-
27
- end
28
- end
@@ -1,54 +0,0 @@
1
- #encoding:utf-8
2
-
3
- require 'spec_helper'
4
- mock_controller do
5
- soap_action 'dispatcher_method', :args => nil, :return => nil
6
-
7
- def dispatcher_method
8
- #nothing
9
- end
10
- end
11
-
12
- describe ApiController, :type => :controller do
13
-
14
- let(:document) { WashoutBuilder::Document::Generator.new}
15
-
16
- render_views(false)
17
-
18
- before(:each) do
19
- WashoutBuilder::Document::Generator.stubs(:new).returns(document)
20
- end
21
-
22
- it "inits the document generator" do
23
- WashoutBuilder::Document::Generator.expects(:new).with(
24
- :config => ApiController.soap_config,
25
- :service_class => ApiController,
26
- :soap_actions => {"dispatcher_method"=>{
27
- :args=>nil,
28
- :return=>nil,
29
- :in=>[],
30
- :out=>[],
31
- :to=>"dispatcher_method",
32
- :response_tag=>"tns:dispatcher_methodResponse",
33
- :builder_in=>[],
34
- :builder_out=>[]
35
- }
36
- }
37
- )
38
- get :_generate_doc
39
- end
40
-
41
- it "verifies render" do
42
- controller.expects(:render).with(nil)
43
- controller.expects(:render).with(:template => "wash_with_html/doc", :layout => false,
44
- :content_type => 'text/html')
45
- get :_generate_doc
46
- end
47
-
48
- it "renders the template" , :fails =>true do
49
- get :_generate_doc
50
- response.should render_template("wash_with_html/doc")
51
- end
52
-
53
-
54
- end