{"id":13463315,"url":"https://github.com/preston/railroady","last_synced_at":"2025-10-07T00:32:30.023Z","repository":{"id":1187528,"uuid":"1090248","full_name":"preston/railroady","owner":"preston","description":"Ruby on Rails 3/4/5 model and controller UML class diagram generator. (`brew/port/apt-get install graphviz` before use!)","archived":false,"fork":true,"pushed_at":"2023-08-02T03:32:05.000Z","size":282,"stargazers_count":1716,"open_issues_count":31,"forks_count":142,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-09-25T22:48:33.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tobias/RailRoad","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/preston.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.rdoc","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-11-18T01:05:14.000Z","updated_at":"2024-09-14T13:31:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/preston/railroady","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preston%2Frailroady","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preston%2Frailroady/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preston%2Frailroady/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preston%2Frailroady/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preston","download_url":"https://codeload.github.com/preston/railroady/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219877435,"owners_count":16554878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T13:00:50.700Z","updated_at":"2025-10-07T00:32:24.718Z","avatar_url":"https://github.com/preston.png","language":"Ruby","funding_links":[],"categories":["Rails Plugins","Ruby","Data Visualization"],"sub_categories":["Rails Class Diagrams"],"readme":"# RailRoady\n\n[![Build Status](https://travis-ci.org/preston/railroady.svg?branch=master)](https://travis-ci.org/preston/railroady)\n\nRailRoady generates Rails model (ActiveRecord, Mongoid, Datamapper) and controller UML diagrams as cross-platform .svg files, as well as in the DOT language.\n\nCode is based on the original \"railroad\" gem, patched and maintained over the years. Lineage can be traced via GitHub.\n\nI (Preston Lee) am not trying to hijack Peter Hoeg or Javier's project, but rather create a dedicated, lean gem that can be used without major issue on Rails projects.\n\n# System Requirements\n\nYou MUST have the the following utilities available at the command line.\n  * `dot` and `neato`.\n\n  * `sed`, which should already be available on all sane UNIX systems.\n\n## Mac users\n\nBrew users can install via:\n\n    brew install graphviz\n\nMacPorts users can install in via\n\n    sudo port install graphviz\n\n\n## Ubuntu users\n\nUbuntu users can install in via\n\n    sudo apt-get install graphviz\n\n# Usage\n\nThe easiest (and recommend) usage is to include railroady as a development dependency with your Rails 3 Gemfile, like so...\n\n    group :development, :test do\n        gem 'railroady'\n    end\n\n...and then run the master rake task...\n\n    rake diagram:all\n\nThis should generate four doc/\\*.svg files that can be opened in (most) web browsers as well as dedicated document viewers supporting the Scalable Vector Graphics format.\n\n## Support for Engines\n\nGenerate diagram for models and controllers including those in the engines.\n\n    rake diagram:all_with_engines\n\n## Alternate Usage\n\nAlternatively, you may run the 'railroady' command-line program at the Rails application's root directory. You can redirect its output to a .dot file or pipe it to the dot or neato utilities to produce a graphic. Model diagrams are intended to be processed using dot and controller diagrams are best processed using neato.\n\n    railroady [options] command\n\n## Options\n\n  \tCommon options:\n      \t-b, --brief                      Generate compact diagram\n                                         (no attributes nor methods)\n      \t-s, --specify file1[,fileN]      Specify only given files\n      \t-e, --exclude file1[,fileN]      Exclude given files\n      \t-i, --inheritance                Include inheritance relations\n      \t-l, --label                      Add a label with diagram information\n                                         (type, date, migration, version)\n      \t-o, --output FILE                Write diagram to file FILE\n      \t-r, --root PATH                  Set PATH as the application root\n      \t-v, --verbose                    Enable verbose output\n                                         (produce messages to STDOUT)\n      \t-x, --xmi                        Produce XMI instead of DOT\n                                         (for UML tools)\n        --alphabetize                Sort methods alphabetically\n\n  \tModels diagram options:\n      \t-a, --all                        Include all models\n                                         (not only ActiveRecord::Base derived)\n          \t--show-belongs_to            Show belongs_to associations\n          \t--hide-through               Hide through associations\n          \t--all-columns                Show all columns (not just content columns)\n          \t--hide-magic                 Hide magic field names\n          \t--hide-types                 Hide attributes type\n      \t-j, --join                       Concentrate edges\n      \t-m, --modules                    Include modules\n      \t-p, --plugins-models             Include plugins models\n      \t-z, --engine-models              Include engine models\n          \t--include-concerns           Include models in concerns subdirectory\n      \t-t, --transitive                 Include transitive associations\n                                       \t(through inheritance)\n\n  \tControllers diagram options:\n          \t--hide-public                Hide public methods\n          \t--hide-protected             Hide protected methods\n          \t--hide-private               Hide private methods\n          \t--engine-controllers         Include engine controllers\n\n  \tOther options:\n      \t-h, --help                       Show this message\n          \t--version                    Show version and copyright\n\n      \t-c, --config FILE                File to load environment (defaults to config/environment)\n\n## Commands\n\nYou must supply one of these:\n\n    -M, --models                     Generate models diagram\n    -C, --controllers                Generate controllers diagram\n    -A, --aasm                       Generate \"acts as state machine\" diagram\n\n## Examples\n\n    railroady -o models.dot -M\n      Produces a models diagram to the file 'models.dot'\n    railroady -a -i -o full_models.dot -M\n      Models diagram with all classes showing inheritance relations\n    railroady -M | dot -Tsvg \u003e models.svg\n      Model diagram in SVG format\n    railroady -C | neato -Tpng \u003e controllers.png\n      Controller diagram in PNG format\n    railroady -h\n      Shows usage help\n\n\n# Processing DOT files\n\nTo produce a PNG image from model diagram generated by RailRoady you can\nissue the following command:\n\n    dot -Tpng models.dot \u003e models.png\n\nIf you want to do the same with a controller diagram, use neato instead of\ndot:\n\n    neato -Tpng controllers.dot \u003e controllers.png\n\nIf you want to produce SVG (vectorial, scalable, editable) files, you can do\nthe following:\n\n    dot -Tsvg models.dot \u003e models.svg\n    neato -Tsvg controllers.dot \u003e controllers.svg\n\nImportant: There is a bug in Graphviz tools when generating SVG files that\ncause a text overflow. You can solve this problem editing (with a text\neditor, not a graphical SVG editor) the file and replacing around line 12\n\"font-size:14.00;\" by \"font-size:11.00;\", or by issuing the following command\n(see \"man sed\"):\n\n    sed -i 's/font-size:14.00/font-size:11.00/g' file.svg\n\nNote: For viewing and editing SVG there is an excellent opensource tool\ncalled Inkscape (similar to Adobe Illustrator. For DOT processing you can\nalso use Omnigraffle (on Mac OS X).\n\n= Rake Tasks\n\nAs of Preston Lee's Rails 3/4/5 modifications, including RailRoady as a project development dependency will automatically add a set of rake tasks to your project. Sweet! (Run `rake -T` to check them out.)\n\n\n# Requirements\n\nRailRoady has been tested with the following Ruby and Rails versions\n\n## Ruby\n* 1.9.2+\n* 2.0.0+\n\n## Rails\n* 3.0.3+\n* 4.0.0+\n* 5.0.0+\n\nThere are no additional requirements (nevertheless, all your Rails application\nrequirements must be installed).\n\nIn order to view/export the DOT diagrams, you'll need the processing tools\nfrom Graphviz.\n\n= Website and Project Home\n\nhttp://railroady.prestonlee.com\n\n# License\n\nRailRoady is distributed under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2 of the\nLicense, or (at your option) any later version.\n\nSee LICENSE for details.\n\n## Copyright\n\nCopyright (c) 2007-2008 Javier Smaldone\nCopyright (c) 2009 Peter Hoeg\nCopyright (c) 2010-2016 Preston Lee\n\nSee LICENSE for details.\n\n## Authors\n\nAuthors/Contributors (in approximate order of appearance):\n\n* Javier Smaldone (javier |at| smaldone |dot| com |dot| ar)\n* Elliot Smith\n* Juan Ignacio Pumarino\n* Hajime Baba\n* Ana Nelson\n* Peter Hoeg\n* John McCaffrey\n* David Jones\n* Mike Dalessio\n* [Preston Lee](https://www.prestonlee.com) and [Lee Does](https://www.leedoes.com), the vendor providing maintenance.\n* Tim Harvey\n* Atli Christiansen\n* John Bintz (http://www.coswellproductions.com/)\n\nAnd of course, many thanks to the many patch submitters and testers that make this possible!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreston%2Frailroady","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreston%2Frailroady","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreston%2Frailroady/lists"}