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

发布于 2024-11-10 02:11:36 字数 850 浏览 3 评论 0原文

是否有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

紫轩蝶泪 2024-11-17 02:11:36

看来 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.

enter image description here

梦亿 2024-11-17 02:11:36

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.

凉风有信 2024-11-17 02:11:36

您还可以查看 Schemapper for Rails 3.0+

You could also checkout Schemapper for Rails 3.0+

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文