2017-09-08 04:45:41 -04:00
|
|
|
# frozen_string_literal: true
|
2017-11-01 19:29:38 -04:00
|
|
|
|
|
|
|
begin
|
|
|
|
require "rubygems/deprecate"
|
|
|
|
rescue LoadError
|
|
|
|
# it's fine if it doesn't exist on the current RubyGems...
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
2017-09-08 04:45:41 -04:00
|
|
|
module Bundler
|
2017-11-01 19:29:38 -04:00
|
|
|
if defined? Bundler::Deprecate
|
|
|
|
# nothing to do!
|
|
|
|
elsif defined? ::Deprecate
|
2017-09-08 04:45:41 -04:00
|
|
|
Deprecate = ::Deprecate
|
|
|
|
elsif defined? Gem::Deprecate
|
|
|
|
Deprecate = Gem::Deprecate
|
|
|
|
else
|
2017-11-01 19:29:38 -04:00
|
|
|
class Deprecate
|
|
|
|
end
|
2017-09-08 04:45:41 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
unless Deprecate.respond_to?(:skip_during)
|
|
|
|
def Deprecate.skip_during
|
|
|
|
original = skip
|
|
|
|
self.skip = true
|
|
|
|
yield
|
|
|
|
ensure
|
|
|
|
self.skip = original
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
unless Deprecate.respond_to?(:skip)
|
|
|
|
def Deprecate.skip
|
2017-11-01 19:29:38 -04:00
|
|
|
@skip ||= false
|
2017-09-08 04:45:41 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
unless Deprecate.respond_to?(:skip=)
|
|
|
|
def Deprecate.skip=(skip)
|
|
|
|
@skip = skip
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|