![](/img/trans.png)
[英]Why 'bundler gem' adds 'rake' and 'rspec' to Gemfile and not to .gemspec file as a development dependencies?
[英]Gem development with Bundler: include or exclude Gemfile?
我在當地開發一種寶石。 它是一個只有測試依賴項的命令行實用程序,我的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的參數? 這對我來說似乎很奇怪或至少是不必要的。
Yehuda Katz剛剛在這個主題上寫過博客! : 澄清.gemspec和Gemfile的角色
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.