2019-07-27 21:59:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
#--
|
|
|
|
# This file contains all sorts of little compatibility hacks that we've
|
|
|
|
# had to introduce over the years. Quarantining them into one file helps
|
|
|
|
# us know when we can get rid of them.
|
|
|
|
#
|
|
|
|
# Ruby 1.9.x has introduced some things that are awkward, and we need to
|
|
|
|
# support them, so we define some constants to use later.
|
2022-03-12 10:51:47 -05:00
|
|
|
#
|
|
|
|
# TODO remove at RubyGems 4
|
2019-07-27 21:59:07 -04:00
|
|
|
#++
|
|
|
|
|
|
|
|
module Gem
|
2022-03-12 10:51:47 -05:00
|
|
|
# :stopdoc:
|
|
|
|
|
2019-07-27 21:59:07 -04:00
|
|
|
RubyGemsVersion = VERSION
|
2019-07-30 23:46:09 -04:00
|
|
|
deprecate_constant(:RubyGemsVersion)
|
2019-07-27 21:59:07 -04:00
|
|
|
|
|
|
|
RbConfigPriorities = %w[
|
|
|
|
MAJOR
|
|
|
|
MINOR
|
|
|
|
TEENY
|
|
|
|
EXEEXT RUBY_SO_NAME arch bindir datadir libdir ruby_install_name
|
|
|
|
ruby_version rubylibprefix sitedir sitelibdir vendordir vendorlibdir
|
|
|
|
rubylibdir
|
|
|
|
].freeze
|
|
|
|
|
|
|
|
unless defined?(ConfigMap)
|
|
|
|
##
|
|
|
|
# Configuration settings from ::RbConfig
|
|
|
|
ConfigMap = Hash.new do |cm, key|
|
|
|
|
cm[key] = RbConfig::CONFIG[key.to_s]
|
|
|
|
end
|
2019-07-30 23:46:09 -04:00
|
|
|
deprecate_constant(:ConfigMap)
|
2019-07-27 21:59:07 -04:00
|
|
|
else
|
|
|
|
RbConfigPriorities.each do |key|
|
|
|
|
ConfigMap[key.to_sym] = RbConfig::CONFIG[key]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|