0.0
No commit activity in last 3 years
No release in over 3 years
self documentaion for your sinatra app's routes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

sinatra-doc

self documentaion for your sinatra app's routes

NOTE: this project is now longer being actively maintained. I recommend you check out a more active (and probably more well-written) project sinatra-docdsl

install

> gem install sinatra-doc 

usage

see the reference implementation app.rb

básicamente above any route you want documented, just add

doc "some description"

or

doc "some description", { hash of params to param descriptions }

afterward a new route /doc will be added to your app that renders these documented routes

an example

> your app.rb

class App < Sinatra::Base
  register Sinatra::Doc
  
  doc "gets a list of foos"
  get "foos" { ... }

  doc "gets a specific foo", { 
    :id => "identifier for a given foo"
  }
  get "foos/:id" { ... }
end

> GET /doc

sinatra doc

GET foos gets a list of foos

GET foos/:id gets a specific foo
  :id identifier for a given foo

Props

based on an idea @bmizerany proposed in a heroku talk in nyc

TODO

  • rake sinatra::doc #=> à la rails rake:routes
  • clean up rendering of docs

2009 softprops (doug tangren)