简体   繁体   English

如何更好地可视化 Rails 模型和应用程序?

[英]How to better visualize Rails Models and Applications?

Is there a RailRoad replacement or something that provides diagrams like unto it for Rails 3.x?是否有RailRoad替代品或提供类似 Rails 3.x 的图表的东西? Presently you have to edit line 54 of app_diagram.rb from:目前,您必须从以下位置编辑 app_diagram.rb 的第 54 行:

 (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.它实际上会运行,但我并没有真正得到任何 output 在 OmniGraffle 中打开它后应该出现在 .dot 文件中的内容。 Further, it seems to just simply gag on more complex enhancements like Hobo.此外,它似乎只是简单地扼杀了像 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: PS - 我发现了另外两个项目,但是它们的维护状态似乎比 RailRoad 还要少:

It appears that Rails ERD may be what I'm really looking for at the moment.看来Rails ERD可能是我目前真正在寻找的东西。 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.与 Rails 3 和 Hobo 一起工作,这更多是我的意图,即根据我在概念化项目时放在一起的初始设计对我的模型进行“健全性检查”。

在此处输入图像描述

RailRoady is the updated RailRoad, for Rails 3. RailRoady是 Rails 3 的更新 RailRoad。

BUT note that the latest version (v1.0.2) has a known known issue that breaks rails generate scaffold .但请注意,最新版本 (v1.0.2) 有一个已知的已知问题,即会破坏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.当我需要生成图表时,我倾向于只在我的 Gemfile 中启用它,然后我禁用它。

You could also checkout Schemapper for Rails 3.0+您还可以查看 Schemapper for Rails 3.0+

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM