summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2018-03-04 16:04:02 -0800
committerAndre Arko <andre@arko.net>2018-03-04 16:04:02 -0800
commit776bdc0c79dacef75f114bbb2e469bff04da8cc4 (patch)
treeb9b0c4c5ea63bf5d9f71921d71db06acff3623e4
parent8d99173fae01ae226f2728f166a7d653bff41b69 (diff)
downloadbundler-776bdc0c79dacef75f114bbb2e469bff04da8cc4.tar.gz
Print major deprecations one major before removal.
-rw-r--r--lib/bundler/shared_helpers.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 45185209f1..1169343304 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -145,7 +145,7 @@ module Bundler
raise DeprecatedError, "[REMOVED FROM #{major_version}.0] #{message}"
end
- return unless prints_major_deprecations?
+ return unless prints_major_deprecations?(major_version)
@major_deprecation_ui ||= Bundler::UI::Shell.new("no-color" => true)
ui = Bundler.ui.is_a?(@major_deprecation_ui.class) ? Bundler.ui : @major_deprecation_ui
ui.warn("[DEPRECATED FOR #{major_version}.0] #{message}")
@@ -342,9 +342,9 @@ module Bundler
$LOAD_PATH.uniq!
end
- def prints_major_deprecations?
+ def prints_major_deprecations?(major_version)
require "bundler"
- deprecation_release = Bundler::VERSION.split(".").drop(1).include?("99")
+ deprecation_release = Bundler.bundler_major_version >= (major_version - 1)
return false if !deprecation_release && !Bundler.settings[:major_deprecations]
require "bundler/deprecate"
return false if Bundler::Deprecate.skip