class Bundler::Standalone

def reverse_rubygems_kernel_mixin

def reverse_rubygems_kernel_mixin
  <<~END
  if Gem.respond_to?(:discover_gems_on_require=)
    Gem.discover_gems_on_require = false
  else
    [::Kernel.singleton_class, ::Kernel].each do |k|
      if k.private_method_defined?(:gem_original_require)
        private_require = k.private_method_defined?(:require)
        k.send(:remove_method, :require)
        k.send(:define_method, :require, k.instance_method(:gem_original_require))
        k.send(:private, :require) if private_require
      end
    end
  end
  END
end