Wednesday, December 28, 2011

railroady UML diagram generator for rails

by Sandip Ransing 0 comments

railroady is UML class diagram generator for rails.
First you need to install `graphviz` pkg in order to have `dot` , `neato` commands available
group :development, :test do gem railroady end
Run below command to generate MVC diagrams
bundle install rake diagram:all
Individual diagram generation
Model Diagram railroady -M | dot -Tpng > models.png Controller Diagram railroady -C | dot -Tpng > controllers.png AASM Diagram railroady -A | dot -Tpng > aasm.png Commands
-M, --models Generate models diagram -C, --controllers Generate controllers diagram -A, --aasm Generate "acts as state machine" diagram
Options
# Common options -b, --brief Generate compact diagram (no attributes nor methods) -s, --specify file1[,fileN] Specify given files only for the diagram (can take a glob pattern) -e, --exclude file1[,fileN] Exclude given files (can take a glob pattern) -i, --inheritance Include inheritance relations -l, --label Add a label with diagram information (type, date, migration, version) -o, --output FILE Write diagram to file FILE -v, --verbose Enable verbose output (produce messages to STDOUT)
Models diagram options:
-a, --all Include all models (not only ActiveRecord::Base derived) --all-columns Show all columns (not just content columns) --hide-magic Hide magic field names --hide-types Hide attributes type -j, --join Concentrate edges -m, --modules Include modules -p, --plugins-models Include plugins models -t, --transitive Include transitive associations (through inheritance)
Controllers diagram options: --hide-public Hide public methods --hide-protected Hide protected methods --hide-private Hide private methods
Other Options -h, --help Show this message --version Show version and copyright

blog comments powered by Disqus

About The Author

Sandip is a ruby on rails developer based in pune and also a blogger at funonrails. Opensource contributor and working with Josh software Private Limited. for more info read Follow Sandip on Twitter for updates.

Connect With Me...

Github Projects

@sandipransing Twitter