aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/deprecate.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/deprecate.rb')
-rw-r--r--lib/bundler/deprecate.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/bundler/deprecate.rb b/lib/bundler/deprecate.rb
index b978c0df6c..387f632a39 100644
--- a/lib/bundler/deprecate.rb
+++ b/lib/bundler/deprecate.rb
@@ -1,11 +1,22 @@
# frozen_string_literal: true
+
+begin
+ require "rubygems/deprecate"
+rescue LoadError
+ # it's fine if it doesn't exist on the current RubyGems...
+ nil
+end
+
module Bundler
- if defined? ::Deprecate
+ if defined? Bundler::Deprecate
+ # nothing to do!
+ elsif defined? ::Deprecate
Deprecate = ::Deprecate
elsif defined? Gem::Deprecate
Deprecate = Gem::Deprecate
else
- class Deprecate; end
+ class Deprecate
+ end
end
unless Deprecate.respond_to?(:skip_during)
@@ -20,7 +31,7 @@ module Bundler
unless Deprecate.respond_to?(:skip)
def Deprecate.skip
- @skip
+ @skip ||= false
end
end