Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/bundler/shared_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,13 @@ def const_get_safely(constant_name, namespace)
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}")
Expand Down