Skip to content
Generate documentation for an API written in Sinatra
Ruby CSS
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
autotest initial commit Jul 21, 2010
example initial commit Jul 21, 2010
lib/sinatra Correct tab/space issues on change to allow Croon to work on Windows Nov 24, 2014
spec initial commit Jul 21, 2010
.gems add .gems for heroku Jul 21, 2010
.gitignore
README.md add example to docs Jul 21, 2010
Rakefile
config.ru Updates to work with Sinatra >=1.1 Sep 15, 2011
sinatra-croon.gemspec Regenerated gemspec for version 0.2.1 Aug 6, 2010

README.md

Sinatra::Croon

Allows you to add inline documentation to a Sinatra app and have a web-based documentation browser be available to you.

Usage

require "sinatra/croon"

class MyApp < Sinatra::Base
  register Sinatra::Croon
end

Documentation Format

# 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":      "user@example.org",
#     "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

Web-based browser

Sinatra::Croon will create a route at /docs to display your documentation.

See an example at http://sinatra-croon-example.heroku.com

Something went wrong with that request. Please try again.