diff options
author | Benoit Daloze <[email protected]> | 2019-08-04 14:39:55 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2019-08-05 18:45:24 +0900 |
commit | 86ac51c301e62abb4eb0962e04e587ba8298bf80 () | |
tree | ed6b883b4103e9fa965f322a2436f7413b5aa9a4 /lib | |
parent | 2ea2108a9fb1460342226f54cbf54ddd79ea1cc2 (diff) |
[rubygems/rubygems] Use the standard RUBY_ENGINE_VERSION instead of JRUBY_VERSION
* RUBY_ENGINE and RUBY_ENGINE_VERSION are defined on every modern Ruby. * There is no such constant as TRUFFLERUBY_VERSION or RBX_VERSION. https://.com/rubygems/rubygems/commit/431d0aefdd
-rw-r--r-- | lib/rubygems.rb | 12 | ||||
-rw-r--r-- | lib/rubygems/defaults.rb | 9 | ||||
-rw-r--r-- | lib/rubygems/request.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/request_set/gem_dependency_api.rb | 8 |
4 files changed, 10 insertions, 21 deletions
@@ -1395,14 +1395,12 @@ begin rescue LoadError end -if defined?(RUBY_ENGINE) - begin - ## - # Defaults the Ruby implementation wants to provide for RubyGems - require "rubygems/defaults/#{RUBY_ENGINE}" - rescue LoadError - end end ## @@ -129,15 +129,8 @@ module Gem end end - ## - # A wrapper around RUBY_ENGINE const that may not be defined - def self.ruby_engine - if defined? RUBY_ENGINE - RUBY_ENGINE - else - 'ruby' - end end ## @@ -285,7 +285,7 @@ class Gem::Request end ua << ")" - ua << " #{RUBY_ENGINE}" if defined?(RUBY_ENGINE) and RUBY_ENGINE != 'ruby' ua end @@ -782,7 +782,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta # You may also provide +engine:+ and +engine_version:+ options to restrict # this gem dependencies file to a particular ruby engine and its engine # version. This matching is performed by using the RUBY_ENGINE and - # engine_specific VERSION constants. (For JRuby, JRUBY_VERSION). def ruby(version, options = {}) engine = options[:engine] @@ -809,11 +809,9 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta end if engine_version - my_engine_version = Object.const_get "#{Gem.ruby_engine.upcase}_VERSION" - - if engine_version != my_engine_version message = - "Your Ruby engine version is #{Gem.ruby_engine} #{my_engine_version}, " + "but your #{gem_deps_file} requires #{engine} #{engine_version}" raise Gem::RubyVersionMismatch, message |