washout_builder <img src=“https://badge.fury.io/rb/washout_builder.png” alt=“Gem Version” />

<img src=“https://travis-ci.org/bogdanRada/washout_builder.png?branch=master,develop” /> <img src=“https://gemnasium.com/bogdanRada/washout_builder.svg” alt=“Dependency Status” /> <img src=“http://inch-ci.org/github/bogdanRada/washout_builder.svg?branch=master” alt=“Inline docs” /> <img src=“https://coveralls.io/repos/bogdanRada/washout_builder/badge.png?branch=master” alt=“Coverage Status” /> <img src=“https://codeclimate.com/github/bogdanRada/washout_builder.png” /> <img src=“https://reposs.herokuapp.com/?path=bogdanRada/washout_builder” alt=“Repo Size”/> <img src=“https://ruby-gem-downloads-badge.herokuapp.com/washout_builder?type=total&style=dynamic” alt=“Gem Downloads”/> <img src=“http://stillmaintained.com/bogdanRada/washout_builder.png” alt=“”/>

Overview

WashOutBuilder is a Soap Service Documentation generator (extends WashOut github.com/inossidabile/wash_out/)

The way WashOut is used is not modified, it just extends its functionality by generating html documentation to your services that you write

Features

  • Provides way of seeing the available services with links to documentation, endpoint and namespace

  • Provides a human-readable HTML documentation generated for each service that you write

LIVE DEMO!!!

Demo app source code:

Requirements

  1. Ruby 1.9.x or Ruby 2.0.x

  2. Ruby on Rails.

  3. WashOut Gem version >= 0.9.1

Compatibility

Rails >3.0 only. MRI 1.9, 2.0, .

JRuby is not offically supported since 0.15.0.

Ruby 1.8 is not officially supported since 0.5.3.

We will accept further compatibilty pull-requests but no upcoming versions will be tested against it.

Rubinius support temporarily dropped since 0.6.2 due to Rails 4 incompatibility.

Setup

Type the following from the command line to install:

gem install washout_builder

Add the following to your Gemfile:

gem "washout_builder"

it will automatically install also wash_out gem that is currently used

Or if you want this to be available only in development mode , you can do something like this inside the Gemfile:

gem 'wash_out'       # The WashOut gem  would be used also  in production

group :development, :test do
  gem 'washout_builder'            # only  available in development mode.
end

Please read release details if you are upgrading. We break backward compatibility between large ticks but you can expect it to be specified at release notes.

Usage

The way soap_actions, or reusable types are defined or how the configuration is made using WashOut(github.com/inossidabile/wash_out) haven’t changed You can still do everything that gem does .

In order to see the documentation you must write something like this in the routes (exactly like you would do when using only WashOut)

In the following file config/routes.rb you can put this configuration

WashOutSample::Application.routes.draw do
 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 like this:

/washout/Rumbas    #camelcase name
/washout/rumbas    #without camelcase

/washout/Api::ProjectService   # for namespaced services with camelcase
/washout/api/project_service   # without camelcase

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

soap_service  namespace: "http://my.app.com/my_service/wsdl",
 :description => "here goes some description for your service"

When specifying the soap_action you can also pass a option for description and a list of exceptions(need to be classes) that the method can raise at a certain moment.

Here is an example :

soap_action "find",
 :args   => {:number => :integer} ,
 :return => :boolean,
 :raises => [MyCustomSoapError, MyOtherCustomSoapError ] ,
 :description => "some description about this method to show in the documentation"

The exception classes used must inherit from WashOut::Dispatcher::SOAPError, which has by default a error code and a message as attributes .

Testing

To test, do the following:

  1. cd to the gem root.

  2. bundle install

  3. bundle exec rake

Contributions

Please log all feedback/issues via GitHub Issues. Thanks.

Contributing to washout_builder

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • 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.

Copyright © 2013 bogdanRada. See LICENSE.txt for further details.