Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Generate documentation for an API written in Sinatra

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 autotest
Octocat-spinner-32 example
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gems
Octocat-spinner-32 .gitignore initial commit July 21, 2010
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
Octocat-spinner-32 sinatra-croon.gemspec
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.