return requirement if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('2.7.0')
requirement += '.a' if bundler_gem_version.prerelease?
requirement
end
def load_bundler!
ENV['BUNDLE_GEMFILE'] ||= gemfile
activate_bundler
end
def activate_bundler
gem_error = activation_error_handling do
gem 'bundler', bundler_requirement
end
return if gem_error.nil?
require_error = activation_error_handling do
require 'bundler/version'
end
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"