【问题标题】:Gem development with Bundler: include or exclude Gemfile?使用 Bundler 进行 Gem 开发:包含还是排除 Gemfile?
【发布时间】:2010-12-18 16:54:14
【问题描述】:

我正在本地开发 gem。它是一个只有测试依赖的命令行实用程序,我的 Gemfile 看起来像这样:

source :rubygems
gemspec

group :test do
  gem "cucumber"
  gem "aruba"
  gem "rspec"
end

我的 gemspec 如下所示:

Gem::Specification.new do |s|
  # authorship stuff...
  s.files = `git ls-files`.split("\n")
end

这是 Bundler 创建的默认 gemspec。我知道我们应该将 Gemfile 和 Gemfile.lock 保留在源代码控制中,但我想知道通过 Gem::Specification#files 属性将它们包含在打包的 gem 中。在分布式 gem 中是否存在支持/反对包含 Gemfile 和 Gemfile.lock 的论点?这对我来说似乎很奇怪,或者至少是不必要的。

【问题讨论】:

    标签: ruby rubygems bundler gemspecs


    【解决方案1】:

    Yehuda Katz 刚刚就这个主题发表了博客! :Clarifying the Roles of the .gemspec and Gemfile

    【讨论】:

    • 那篇文章实际上提出了我的问题,但我在他添加 TL;DR 之前阅读了它,澄清了 gem 开发的条件。谢谢你指点我回来。
    猜你喜欢
    • 2011-11-12
    • 1970-01-01
    • 2017-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-15
    • 2014-07-26
    • 1970-01-01
    相关资源
    最近更新 更多