我应该将非 Ruby 文件放在 gem 中的什么位置?

发布于 2024-12-27 19:45:34 字数 403 浏览 1 评论 0原文

我想将 Upstart 配置文件放入我的 Ruby gem 中。这是我目前的最佳猜测

Gem::Specification.new do |s|

  # ...

  s.files = %w(
    lib/rt_watchdog.rb
    lib/upstart/rt_watchdog.conf
    bin/rt_watchdog
  )
end

一般来说,配置文件和其他类型的脚本在 gem 中放在哪里?

更新:我将示例中的路径从 Upstart/rt_watchdog.conf 更改为 lib/upstart/rt_watchdog.conf,因为这就是我的路径现在决定继续,但我仍然感觉不太好。

I want to put an Upstart config file in my Ruby gem. Here's my current best guess

Gem::Specification.new do |s|

  # ...

  s.files = %w(
    lib/rt_watchdog.rb
    lib/upstart/rt_watchdog.conf
    bin/rt_watchdog
  )
end

In general, where do configuration files and other types of scripts go in a gem?

Update: I changed the path in my example from Upstart/rt_watchdog.conf to lib/upstart/rt_watchdog.conf as that's what I've decided to go with for now, but I still don't feel great about it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

咆哮 2025-01-03 19:45:34

Rails 在应用程序的根目录中使用一个 config 目录,并且 Rails 约定在整个 Ruby 社区中得到了很好的体现。

Rails uses a config directory in the root of the app and Rails conventions are pretty well represented throughout the Ruby community.

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