diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-28 17:48:47 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-01 11:03:14 +0100 |
commit | 6b6d56111e3360eaf2bececb775ea34492753a42 (patch) | |
tree | 32bc71ebb4bce74ce94df9d0340835d6260ffccb /lib/bundler/shared_helpers.rb | |
parent | 39904ba9e655f5fed28d052f98e21444fdd716d9 (diff) | |
download | bundler-6b6d56111e3360eaf2bececb775ea34492753a42.tar.gz |
Lighther "prefer gems.rb" deprecation
The previous logic is unclear to me. It seemed to try to detect only
"multiple gemfile situations", but it was doing it incorrectly, I think.
The new message is printed _only_ if both gems.rb and Gemfile are
detected in the same project. And recommends sticking with gems.rb. But
we are not yet deprecating "Gemfile" other than that.
Diffstat (limited to 'lib/bundler/shared_helpers.rb')
-rw-r--r-- | lib/bundler/shared_helpers.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 996f7b3fd4..0f4f54dced 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -157,11 +157,16 @@ module Bundler multiple_gemfiles = search_up(".") do |dir| gemfiles = gemfile_names.select {|gf| File.file? File.expand_path(gf, dir) } next if gemfiles.empty? - break false if gemfiles.size == 1 + break gemfiles.size != 1 end - return unless multiple_gemfiles && Bundler.bundler_major_version == 1 - Bundler::SharedHelpers.major_deprecation 2, \ - "gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock." + return unless multiple_gemfiles + diagnosis = "Multiple gemfiles (gems.rb and Gemfile) detected." + advice = if Bundler.feature_flag.prefer_gems_rb? + "Make sure you remove Gemfile and Gemfile.lock since bundler is ignoring them in favor of gems.rb and gems.rb.locked." + else + "The gems.rb and gems.rb.locked files are currently ignored, but they will get used as soon as you delete your Gemfile and Gemfile.lock files." + end + Bundler.ui.warn [diagnosis, advice].join(" ") end def trap(signal, override = false, &block) |