Pajk/rails-restapi — pull request #28 by iNecas (2012-07-12 22:34:42+00:00)
Title: Extractor

it watches requests and responses to your application and generates the
documentation from this data. It's also able to save the requests/responses to
the yml file to be used for example purposes.

Usage:

# record examples
RESTAPI_RECORD=examples rails s

# update params
RESTAPI_RECORD=params rails s

# both
RESTAPI_RECORD=all rails s

It can be also used with functional tests like this:

RESTAPI_RECORD=all rake test:functionals

The documentation generated with recorded will be kept updated by the script
only until the disclaimer line is above the generated code - once you remove it
it's on your own. It's recommended to run without any unstaged changes, since
it's rewriting the code at the end to add the documentation.

You can specify what controllers/actions should not be touched by the recording
using config e.g.:

config.ignored_by_recorder = %w[Api::PostsController#show Api::UsersController]

There is also new rake task to update apis from routes:

rake restapi:update_from_routes

This task updates the api's even when the disclaimer line isn't there. However
it keeps your custom comments.