如何更好地可视化 Rails 模型和应用程序?
是否有 RailRoad 替代品或为 Rails 3.x 提供类似图表的东西?目前,您必须编辑 app_diagram.rb 的第 54 行:
(旧) STDOUT.reopen(PLATFORM =~ /mswin/ ? "NUL" : "/dev/null") 到 (新)STDOUT.reopen(RUBY_PLATFORM =~ /mswin/ ? "NUL" : "/dev/null")
最后我在他们的论坛上发现,如果您使用 this 之类的东西运行它:
RUBYLIB=. railroad -o models.dot -M
它将实际上运行了,但在 OmniGraffle 中打开 .dot 文件后,我并没有真正获得任何应该出现在 .dot 文件中的输出。此外,它似乎只是对 Hobo 等更复杂的增强功能感到厌恶。
有人熟悉这个仍在开发中的项目的新东西或分支吗?
PS - 我发现了另外两个项目,但是它们的维护状态似乎比 RailRoad 还要少:
Is there a RailRoad replacement or something that provides diagrams like unto it for Rails 3.x? Presently you have to edit line 54 of app_diagram.rb from:
(OLD) STDOUT.reopen(PLATFORM =~ /mswin/ ? "NUL" : "/dev/null") to (NEW) STDOUT.reopen(RUBY_PLATFORM =~ /mswin/ ? "NUL" : "/dev/null")
Finally I found on their Forums that if you run it with something like this:
RUBYLIB=. railroad -o models.dot -M
It will actually run, but I didn't really get any output as per what should have appeared in the .dot file after opening it in OmniGraffle. Further, it seems to just simply gag on more complex enhancements like Hobo.
Is anyone familiar with something new or a fork of this project that's still in development?
PS - I found two other projects, however they seem to be in less maintained states than even RailRoad:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看来 Rails ERD 可能是我目前真正在寻找的东西。似乎完全符合我原来的问题。
与 Rails 3 和 Hobo 配合使用,这更多的是我的目的是根据我在概念化项目时组合在一起的初始设计对模型进行“健全性检查”。
It appears that Rails ERD may be what I'm really looking for at the moment. Seems to fit the bill precisely for my original question.
Works with Rails 3 and Hobo, which was more of my intention for "sanity checking" my models against initial designs I put together when conceptualizing projects.
RailRoady 是针对 Rails 3 的更新版 RailRoad。
但请注意,最新版本 (v1.0.2) 有一个已知已知问题会破坏
rails生成脚手架
。我倾向于仅在需要生成图表时在 Gemfile 中启用它,然后禁用它。RailRoady is the updated RailRoad, for Rails 3.
BUT note that the latest version (v1.0.2) has a known known issue that breaks
rails generate scaffold
. I tend to only enable it in my Gemfile when I need to generate the diagram(s), and then I disable it.您还可以查看 Schemapper for Rails 3.0+
You could also checkout Schemapper for Rails 3.0+