Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should I use to document my Sinatra routes?

Tags:

ruby

sinatra

I'm looking for something like RDoc that will work well with Sinatra. In addition to regular Sinatra routes, it needs to be able to handle routes that are loaded externally via 'register MyModule' and of the form:

Module MyModule
  def self.registered(app)
    # Description of someroute.
    app.get '/someroute' do
like image 811
Stephen Petschulat Avatar asked Nov 21 '25 20:11

Stephen Petschulat


1 Answers

Go with yard. from yard's homepage:

You can write all kinds of extensions in YARD, including ones that can understand all of the dynamic magic your framework does in its own little Doman Specific Languages (DSLs). Most importantly, it's really easy to do! There are already plugins that support frameworks like RSpec, DataMapper, Sinatra, and support for others are in the works.

There seems to be a plugin here: https://github.com/rkh/yard-sinatra that does at least some of what you want already.

Good luck!

like image 126
gunn Avatar answered Nov 23 '25 11:11

gunn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!