Allows you to add inline documentation to a Sinatra app and have a web-based documentation browser be available to you.
require "sinatra/croon"
class MyApp < Sinatra::Base
register Sinatra::Croon
end
# Create an application.
#
# @param <name> the name of the application to create
# @param [stack] the stack on which to create the application
#
# @request
# POST /apps.json
# name=example&stack=bamboo-ree-1.8.7
# @response
# {
# "id": 1,
# "name": "example",
# "owner": "[email protected]",
# "created_at": "Sat Jan 01 00:00:00 UTC 2000",
# "stack": "bamboo-ree-1.8.7",
# "slug_size": 1000000,
# "repo_size": 500000,
# "dynos": 1,
# "workers": 0
# }
post "/apps.json" do
# do something here
end
Sinatra::Croon will create a route at /docs
to display your documentation.
See an example at http://sinatra-croon-example.heroku.com