Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save unicornrainbow/5219512 to your computer and use it in GitHub Desktop.
Save unicornrainbow/5219512 to your computer and use it in GitHub Desktop.
Generate class diagrams from a Rails 3.x project (Using Railroady)

Class Diagrams maya at time be over rated, but I find them useful to look at when first coming onto a project inorder to get a birds eye view. This is how to generate a class diagram for a Rails 3.x project on ruby 1.9.x.

Install graphviz, railroady uses it to generate the diagrams.

$ brew update && brew install graphviz

Add roadroady to your gem file. (Railroady is a follow-on to the orginal railroad gem. It works well with Rails 3.x and ruby 1.9.2. I could not get the railroad gem to work at all.)

gem "railroady"

Note: Make sure doc directory exists. For me the next step fails if it's missing.

Run rake tasks to generate diagrams and place them in the doc directory.

$ rake diagram:all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment