washout_builder 1.0.5 → 1.0.6

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: 68cb0141260d3fc89155efb053c52aa7cf930884
4
- data.tar.gz: b825e32605a57ce23663a8a4f9bd195cab8df9af
3
+ metadata.gz: 1e702f0e9e4f763b5deffe0314155a86ddd682d6
4
+ data.tar.gz: 3f8af9a0673595dfda19fb26c8c13f2127fe15aa
5
5
  SHA512:
6
- metadata.gz: 570b1c3d47b9ec70b0c9a109a9522241a3e2540e97b68c04490b16c10add4c7310f0db39b0bcb73f7040fffffaf8d07d04d91e3eb8432f2f6453edb327cf0779
7
- data.tar.gz: 472a262dd70a473e9447b47b15fbeea6a358dbc2bae5241162af6f8c1ca57fefa601149d28d5c6a56003b38bd9216cb88598104a7bbb576b6c912ade8a71195b
6
+ metadata.gz: db067847f80138433cc00bb80d6fd47d59792bb7823041f9ebe4f059e5ec5442bafd904eccbff80f7b7984bd3f9496932ed8e0527f19333a817c88c672d4a691
7
+ data.tar.gz: 7d5ac46444d9e033e4a5c15a01f60e8e553f42dfbffb54bbcecb18217f9d4d0885bde9825b7bb130c91436a206bddb9b093e04b7ff0a6856c5bd933b13048927
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ Gemfile.lock
15
15
  /nbproject/
16
16
  /.git-rewrite/
17
17
  /bin/**
18
+ gemfiles
@@ -0,0 +1,162 @@
1
+ washout_builder
2
+ ===============
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/washout_builder.svg)](http://badge.fury.io/rb/washout_builder) [![Build Status](https://travis-ci.org/bogdanRada/washout_builder.png?branch=master,develop)](https://travis-ci.org/bogdanRada/washout_builder) [![Dependency Status](https://gemnasium.com/bogdanRada/washout_builder.svg)](https://gemnasium.com/bogdanRada/washout_builder) [![Documentation Status](http://inch-ci.org/github/bogdanRada/washout_builder.svg?branch=master)](http://inch-ci.org/github/bogdanRada/washout_builder) [![Coverage Status](https://coveralls.io/repos/bogdanRada/washout_builder/badge.svg?branch=master)](https://coveralls.io/r/bogdanRada/washout_builder?branch=master) [![Code Climate](https://codeclimate.com/github/bogdanRada/washout_builder/badges/gpa.svg)](https://codeclimate.com/github/bogdanRada/washout_builder) [![Repo Size](https://reposs.herokuapp.com/?path=bogdanRada/washout_builder)](https://github.com/bogdanRada/washout_builder) [![Gem Downloads](https://ruby-gem-downloads-badge.herokuapp.com/washout_builder?type=total)](https://github.com/bogdanRada/washout_builder) [![Maintenance Status](http://stillmaintained.com/bogdanRada/washout_builder.png)](https://github.com/bogdanRada/washout_builder)
5
+
6
+ Overview
7
+ --------
8
+
9
+ WashOutBuilder is a Soap Service Documentation generator (extends [WashOut](https://github.com/inossidabile/wash_out) /\)
10
+
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
+
13
+ Features
14
+ --------
15
+
16
+ - Provides way of seeing the available services with links to documentation, endpoint and namespace
17
+ - Provides a human-readable HTML documentation generated for each service that you write
18
+
19
+ Live DEMO
20
+ =========
21
+
22
+ - [Demo Application](http://washout-builder.herokuapp.com)
23
+
24
+ Demo Application Source Code
25
+ ----------------------------
26
+
27
+ - [Source Code](https://github.com/bogdanRada/washout_builder_demo)
28
+
29
+ Requirements
30
+ ------------
31
+
32
+ 1. [Ruby 1.9.x or Ruby 2.x](http://www.ruby-lang.org)
33
+ 2. [Ruby On Rails](http://rubyonrails.org)
34
+ 3. [WashOut gem version >= 0.9.1](https://github.com/inossidabile/wash_out)
35
+
36
+ Compatibility
37
+ -------------
38
+
39
+ - Rails >3.0 only. MRI 1.9, 2.0, .
40
+
41
+ - JRuby is not offically supported since 0.15.0.
42
+
43
+ - Ruby 1.8 is not officially supported since 0.5.3.
44
+
45
+ We will accept further compatibilty pull-requests but no upcoming versions will be tested against it.
46
+
47
+ Rubinius support temporarily dropped since 0.6.2 due to Rails 4 incompatibility.
48
+
49
+ Setup
50
+ -----
51
+
52
+ Type the following from the command line to install:
53
+
54
+ ```ruby
55
+ gem install washout_builder
56
+ ```
57
+
58
+ Add the following to your Gemfile:
59
+
60
+ ```ruby
61
+ gem "washout_builder"
62
+ ```
63
+
64
+ it will automatically install also [WashOut](https://github.com/inossidabile/wash_out) gem that is currently used
65
+
66
+ Or if you want this to be available only in development mode , you can do something like this inside the Gemfile:
67
+
68
+ ```ruby
69
+ gem 'wash_out' # The WashOut gem would be used also in production
70
+
71
+ group :development, :test do
72
+ gem 'washout_builder' # only available in development mode.
73
+ end
74
+ ```
75
+
76
+ Please read [Release Details]([https://github.com/bogdanRada/washout_builder/releases) if you are upgrading. We break backward compatibility between large ticks but you can expect it to be specified at release notes.
77
+
78
+ Usage
79
+ -----
80
+
81
+ The way soap_actions, or reusable types are defined or how the configuration is made using [WashOut](https://github.com/inossidabile/wash_out) haven't changed You can still do everything that gem does .
82
+
83
+ In order to see the documentation you must write something like this in the routes (exactly like you would do when using only WashOut)
84
+
85
+ In the following file **config/routes** you can put this configuration
86
+
87
+ ```ruby
88
+ WashOutSample::Application.routes.draw do
89
+ wash_out :rumbas wash_out :my_other_service
90
+
91
+ namespace :api do
92
+ wash_out :project_service
93
+ end
94
+
95
+ mount WashoutBuilder::Engine => "/washout"
96
+ end
97
+
98
+ ```
99
+
100
+ 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.
101
+
102
+ If you want to access directly the hml documentation that was generated for RumbasController you can do that by accessing url like this:
103
+
104
+ ```ruby
105
+ /washout/Rumbas # camelcase name
106
+ /washout/rumbas # without camelcase
107
+ /washout/Api::ProjectService # for namespaced services with camelcase
108
+ /washout/api/project_service # without camelcase
109
+ ```
110
+
111
+ When specifying the **soap_service** you can also pass a **option for description** . Here is an example
112
+
113
+ ```ruby
114
+ soap_service
115
+ namespace: 'http://my.app.com/my_service/wsdl',
116
+ description: 'here goes some description for your service'
117
+ ```
118
+
119
+ When specifying the **soap_action** you can also pass a **option for description**, **option for arguments description** and a **list of exceptions(need to be classes)** that the method can raise at a certain moment.
120
+
121
+ Here is an example :
122
+
123
+ ```ruby
124
+ soap_action "find",
125
+ args: { number: :integer },
126
+ args_description: { number: 'some description about this argument' },
127
+ return: :boolean,
128
+ raises: [MyCustomSoapError, MyOtherCustomSoapError ] ,
129
+ description: "some description about this method to show in the documentation"
130
+ ```
131
+
132
+ The exception classes used **must inherit** from **WashOut::Dispatcher::SOAPError**, which has by default a error code and a message as attributes .
133
+
134
+ Testing
135
+ -------
136
+
137
+ To test, do the following:
138
+
139
+ 1. cd to the gem root.
140
+ 2. bundle install
141
+ 3. bundle exec rake
142
+
143
+ Contributions
144
+ -------------
145
+
146
+ Please log all feedback/issues via [Github Issues](http://github.com/bogdanRada/washout_builder/issues). Thanks.
147
+
148
+ Contributing to washout_builder
149
+ -------------------------------
150
+
151
+ - Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
152
+ - Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
153
+ - Fork the project.
154
+ - Start a feature/bugfix branch.
155
+ - Commit and push until you are happy with your contribution.
156
+ - Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
157
+ - Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
158
+
159
+ Copyright
160
+ ---------
161
+
162
+ Copyright (c) 2013 bogdanRada. See LICENSE.txt for further details.
@@ -12,11 +12,13 @@ module WashoutBuilderComplexTypeHelper
12
12
  # @return [void]
13
13
  #
14
14
  # @api public
15
- def create_element_type_html(pre, element)
15
+ def create_element_type_html(pre, element, element_description)
16
16
  element.type = 'string' if element.type == 'text'
17
17
  element.type = 'integer' if element.type == 'int'
18
18
  if WashoutBuilder::Type::BASIC_TYPES.include?(element.type)
19
19
  pre << "<span class='blue'>#{element.type}</span>&nbsp;<span class='bold'>#{element.name}</span>"
20
+ pre << "&#8194;<span>#{element_description}</span>" unless element_description.nil?
21
+ pre
20
22
  else
21
23
  create_complex_element_type_html(pre, element)
22
24
  end
@@ -8,7 +8,7 @@ unless object.blank?
8
8
  xml.ul("class" => "pre") {
9
9
  object.map.each do |element|
10
10
  xml.li { |pre|
11
- create_element_type_html(pre, element)
11
+ create_element_type_html(pre, element, nil)
12
12
  }
13
13
  end
14
14
  }
@@ -13,7 +13,7 @@ xml.p "#{description}" unless description.blank?
13
13
  xml.ul {
14
14
  input.each do |element|
15
15
  xml.li("class" => "pre") { |pre|
16
- create_element_type_html(pre, element)
16
+ create_element_type_html(pre, element, args_description.nil? ? nil : args_description[element.name.to_sym])
17
17
  }
18
18
  end
19
19
  }
@@ -102,7 +102,14 @@ xml.html( "xmlns" => "http://www.w3.org/1999/xhtml" ) {
102
102
  @map = @document.sorted_operations
103
103
  unless @map.blank?
104
104
  @map.each { |operation, formats|
105
- xml << render(:partial => "wash_with_html/public_method", :locals => { :operation=> operation, :input => formats[:in], :output => formats[:out] , :exceptions => formats[:raises], :description => formats[:description]})
105
+ xml << render(:partial => "wash_with_html/public_method", :locals => {
106
+ :operation => operation,
107
+ :input => formats[:in],
108
+ :output => formats[:out] ,
109
+ :exceptions => formats[:raises],
110
+ :description => formats[:description],
111
+ :args_description => formats[:args_description]
112
+ })
106
113
  }
107
114
  end
108
115
 
@@ -43,8 +43,9 @@ WashoutBuilder::Type.all_soap_config_classes.each do |controller|
43
43
  end
44
44
 
45
45
  def self.config
46
- original_config.merge(description: nil)
46
+ original_config.merge(description: nil, args_description: nil)
47
47
  end
48
48
  end
49
49
  controller.soap_accessor(:description)
50
+ controller.soap_accessor(:args_description)
50
51
  end
@@ -70,6 +70,14 @@ module WashoutBuilder
70
70
  config.respond_to?(:description) ? config.description : nil
71
71
  end
72
72
 
73
+ # Returns the service arguments description if the service can respond to args_description method
74
+ #
75
+ # @return [String] Returns the service arguments description if the service can respond to args_description method
76
+ # @api public
77
+ def service_args_description
78
+ config.respond_to?(:args_description) ? config.args_description : nil
79
+ end
80
+
73
81
  # returns a collection of all operation that the service responds to
74
82
  #
75
83
  # @return [Array<String>] returns a collection of all operation that the service responds to
@@ -12,7 +12,7 @@ module WashoutBuilder
12
12
  # the minor version of the gem
13
13
  MINOR = 0
14
14
  # the tiny version of the gem
15
- TINY = 5
15
+ TINY = 6
16
16
  # if the version should be a e
17
17
  PRE = nil
18
18
 
@@ -14,14 +14,14 @@ describe WashoutBuilderComplexTypeHelper, type: :helper do
14
14
 
15
15
  def expect_included_type_result(pre, element)
16
16
  WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(element.type).returns(true)
17
- result = helper.create_element_type_html(pre, element)
17
+ result = helper.create_element_type_html(pre, element, nil)
18
18
  expect(result).to eq(["<span class='blue'>#{element.type}</span>&nbsp;<span class='bold'>#{element.name}</span>"])
19
19
  end
20
20
 
21
21
  def expect_excluded_type_result(pre, element)
22
22
  WashoutBuilder::Type::BASIC_TYPES.expects(:include?).with(element.type).returns(false)
23
23
  helper.expects(:create_complex_element_type_html).with(pre, element)
24
- helper.create_element_type_html(pre, element)
24
+ helper.create_element_type_html(pre, element, nil)
25
25
  end
26
26
 
27
27
  it 'returns the element of type text' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: washout_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-21 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wash_out
@@ -574,7 +574,7 @@ files:
574
574
  - Gemfile
575
575
  - Guardfile
576
576
  - LICENSE
577
- - README.rdoc
577
+ - README.md
578
578
  - Rakefile
579
579
  - app/controllers/washout_builder/washout_builder_controller.rb
580
580
  - app/helpers/washout_builder_complex_type_helper.rb
@@ -1,144 +0,0 @@
1
- = washout_builder {<img src="https://badge.fury.io/rb/washout_builder.png" alt="Gem Version" />}[http://badge.fury.io/rb/washout_builder]
2
- {<img src="https://travis-ci.org/bogdanRada/washout_builder.png?branch=master,develop" />}[https://travis-ci.org/bogdanRada/washout_builder]
3
- {<img src="https://gemnasium.com/bogdanRada/washout_builder.svg" alt="Dependency Status" />}[https://gemnasium.com/bogdanRada/washout_builder]
4
- {<img src="http://inch-ci.org/github/bogdanRada/washout_builder.svg?branch=master" alt="Inline docs" />}[http://inch-ci.org/github/bogdanRada/washout_builder]
5
- {<img src="https://coveralls.io/repos/bogdanRada/washout_builder/badge.png?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/bogdanRada/washout_builder?branch=master]
6
- {<img src="https://codeclimate.com/github/bogdanRada/washout_builder.png" />}[https://codeclimate.com/github/bogdanRada/washout_builder]
7
- {<img src="https://reposs.herokuapp.com/?path=bogdanRada/washout_builder" alt="Repo Size"/>}[https://github.com/bogdanRada/washout_builder]
8
- {<img src="https://ruby-gem-downloads-badge.herokuapp.com/washout_builder?type=total&style=dynamic" alt="Gem Downloads"/>}[https://rubygems.org/gems/washout_builder]
9
- {<img src="http://stillmaintained.com/bogdanRada/washout_builder.png" alt=""/>}[https://rubygems.org/gems/washout_builder]
10
-
11
- = Overview
12
- WashOutBuilder is a Soap Service Documentation generator (extends WashOut https://github.com/inossidabile/wash_out/)
13
-
14
- The way WashOut is used is not modified, it just extends its functionality by generating html documentation to your services that you write
15
-
16
- = Features
17
-
18
- * Provides way of seeing the available services with links to documentation, endpoint and namespace
19
- * Provides a human-readable HTML documentation generated for each service that you write
20
-
21
- = LIVE DEMO!!!
22
-
23
- * {Demo Application}[http://washout-builder.herokuapp.com/]
24
-
25
- = Demo app source code:
26
-
27
- * {Source code}[https://github.com/bogdanRada/washout_builder_demo]
28
-
29
- = Requirements
30
-
31
- 1. {Ruby 1.9.x or Ruby 2.0.x}[http://www.ruby-lang.org]
32
- 2. {Ruby on Rails}[http://rubyonrails.org].
33
- 3. {WashOut Gem version >= 0.9.1}[https://github.com/inossidabile/wash_out]
34
-
35
- = Compatibility
36
-
37
- Rails >3.0 only. MRI 1.9, 2.0, .
38
-
39
- JRuby is not offically supported since 0.15.0.
40
-
41
- Ruby 1.8 is not officially supported since 0.5.3.
42
-
43
- We will accept further compatibilty pull-requests but no upcoming versions will be tested against it.
44
-
45
- Rubinius support temporarily dropped since 0.6.2 due to Rails 4 incompatibility.
46
-
47
- = Setup
48
-
49
- Type the following from the command line to install:
50
-
51
- gem install washout_builder
52
-
53
- Add the following to your Gemfile:
54
-
55
-
56
- gem "washout_builder"
57
-
58
- it will automatically install also +wash_out+ gem that is currently used
59
-
60
- Or if you want this to be available only in development mode , you can do something like this inside the Gemfile:
61
-
62
- gem 'wash_out' # The WashOut gem would be used also in production
63
-
64
- group :development, :test do
65
- gem 'washout_builder' # only available in development mode.
66
- end
67
-
68
-
69
- Please read {release details}[https://github.com/bogdanRada/washout_builder/releases] if you are upgrading. We break backward compatibility between large ticks but you can expect it to be specified at release notes.
70
-
71
- = Usage
72
-
73
- The way soap_actions, or reusable types are defined or how the configuration is made using WashOut(https://github.com/inossidabile/wash_out) haven't changed
74
- You can still do everything that gem does .
75
-
76
- In order to see the documentation you must write something like this in the routes (exactly like you would do when using only WashOut)
77
-
78
- In the following file +config/routes.rb+ you can put this configuration
79
-
80
- WashOutSample::Application.routes.draw do
81
- wash_out :rumbas
82
- wash_out :my_other_service
83
-
84
- namespace :api do
85
- wash_out :project_service
86
- end
87
-
88
- mount WashoutBuilder::Engine => "/washout"
89
- end
90
-
91
- 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.
92
-
93
- If you want to access directly the hml documentation that was generated for RumbasController you can do that by accessing url like this:
94
-
95
- /washout/Rumbas #camelcase name
96
- /washout/rumbas #without camelcase
97
-
98
- /washout/Api::ProjectService # for namespaced services with camelcase
99
- /washout/api/project_service # without camelcase
100
-
101
- When specifying the <b>soap_service</b> you can also pass a <b>option for description</b> . Here is an example
102
-
103
- soap_service namespace: "http://my.app.com/my_service/wsdl",
104
- :description => "here goes some description for your service"
105
-
106
- When specifying the <b>soap_action</b> you can also pass a <b>option for description</b> and a <b>list of exceptions(need to be classes)</b> that the method can raise at a certain moment.
107
-
108
- Here is an example :
109
-
110
- soap_action "find",
111
- :args => {:number => :integer} ,
112
- :return => :boolean,
113
- :raises => [MyCustomSoapError, MyOtherCustomSoapError ] ,
114
- :description => "some description about this method to show in the documentation"
115
-
116
-
117
- The exception classes used <b>must inherit</b> from <tt>WashOut::Dispatcher::SOAPError</tt>, which has by default a error code and a message as attributes .
118
-
119
- = Testing
120
-
121
- To test, do the following:
122
-
123
- 1. cd to the gem root.
124
- 2. bundle install
125
- 3. bundle exec rake
126
-
127
- = Contributions
128
-
129
- Please log all feedback/issues via {GitHub Issues}[http://github.com/bogdanRada/washout_builder/issues]. Thanks.
130
-
131
- == Contributing to washout_builder
132
-
133
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
134
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
135
- * Fork the project.
136
- * Start a feature/bugfix branch.
137
- * Commit and push until you are happy with your contribution.
138
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
139
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
140
-
141
- == Copyright
142
-
143
- Copyright (c) 2013 bogdanRada. See LICENSE.txt for
144
- further details.