這是Gemfile的rspec-expectations。爲什麼使用Gemfile作爲寶石
source "http://rubygems.org"
gemspec
%w[rspec rspec-core rspec-expectations rspec-mocks].each do |lib|
library_path = File.expand_path("../../#{lib}", __FILE__)
if File.exist?(library_path)
gem lib, :path => library_path
else
gem lib, :git => "git://github.com/rspec/#{lib}.git"
end
end
### deps for rdoc.info
gem 'yard', '0.8.0', :require => false
gem 'redcarpet', '2.1.1'
gem 'github-markup', '0.7.2'
platforms :jruby do
gem "jruby-openssl"
end
eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')
正如你可以看到.gemspec定義了diff-lcs
只有一個單一的依賴。這是更進一步validated by rubygems page。
我的問題是什麼是使用Gemfile。我知道捆綁商使用它。但爲了什麼?
定義依賴關係。 –
@DaveNewton,因爲我提到rubygems頁面顯示Gemfile依賴關係沒有聲明爲依賴關係。 –