diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2018-06-14 21:10:51 -0700 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2018-06-14 21:10:51 -0700 |
commit | bb0cc7c032fe0a814b1e8ec40c51e7307e78d1b1 (patch) | |
tree | 64d672340349eb555156689c153cfb499901bcad | |
parent | f358c36b580723a39c7dd72fafd883e59d9b05df (diff) | |
download | bundler-segiddins/softer-major-deprecations.tar.gz |
[SharedHelpers] Only hard-error on major deprecations in the following versionsegiddins/softer-major-deprecations
-rw-r--r-- | lib/bundler/shared_helpers.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 45185209f1..2b9fb8d6a7 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -140,12 +140,13 @@ module Bundler end def major_deprecation(major_version, message) - if Bundler.bundler_major_version >= major_version + bundler_major_version = Bundler.bundler_major_version + if bundler_major_version > major_version require "bundler/errors" - raise DeprecatedError, "[REMOVED FROM #{major_version}.0] #{message}" + raise DeprecatedError, "[REMOVED FROM #{major_version.succ}.0] #{message}" end - return unless prints_major_deprecations? + return unless bundler_major_version >= major_version || prints_major_deprecations? @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}") |