diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-12 19:05:26 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-03 09:30:00 +0900 |
commit | 7255f55dba83aacbde76184aff965162e339ba2a (patch) | |
tree | 3ea69fd5c7a4883fe934ab15206b1861c76ff0d2 /lib/bundler | |
parent | d2d6d5c988b66cb110dbb07f92e08f231a31d6bc (diff) | |
download | ruby-7255f55dba83aacbde76184aff965162e339ba2a.tar.gz |
[bundler/bundler] RUBY_ENGINE should always be defined after 1.8.7
https://github.com/bundler/bundler/commit/d6c9196d18
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/current_ruby.rb | 13 | ||||
-rw-r--r-- | lib/bundler/installer/standalone.rb | 3 | ||||
-rw-r--r-- | lib/bundler/ruby_version.rb | 7 |
3 files changed, 8 insertions, 15 deletions
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb index ae5fae841e..6c8ad72ee3 100644 --- a/lib/bundler/current_ruby.rb +++ b/lib/bundler/current_ruby.rb @@ -38,28 +38,27 @@ module Bundler ].freeze def ruby? - !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || - RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby") + !mswin? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby") end def mri? - !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") + !mswin? && RUBY_ENGINE == "ruby" end def rbx? - ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx" + ruby? && RUBY_ENGINE == "rbx" end def jruby? - defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby" + RUBY_ENGINE == "jruby" end def maglev? - defined?(RUBY_ENGINE) && RUBY_ENGINE == "maglev" + RUBY_ENGINE == "maglev" end def truffleruby? - defined?(RUBY_ENGINE) && RUBY_ENGINE == "truffleruby" + RUBY_ENGINE == "truffleruby" end def mswin? diff --git a/lib/bundler/installer/standalone.rb b/lib/bundler/installer/standalone.rb index ce0c9df1eb..e1beb25ad1 100644 --- a/lib/bundler/installer/standalone.rb +++ b/lib/bundler/installer/standalone.rb @@ -12,8 +12,7 @@ module Bundler end File.open File.join(bundler_path, "setup.rb"), "w" do |file| file.puts "require 'rbconfig'" - file.puts "# ruby 1.8.7 doesn't define RUBY_ENGINE" - file.puts "ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'" + file.puts "ruby_engine = RUBY_ENGINE" file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]" file.puts "path = File.expand_path('..', __FILE__)" paths.each do |path| diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb index 80dc444f93..b981cba21d 100644 --- a/lib/bundler/ruby_version.rb +++ b/lib/bundler/ruby_version.rb @@ -102,12 +102,7 @@ module Bundler end def self.system - ruby_engine = if defined?(RUBY_ENGINE) && !RUBY_ENGINE.nil? - RUBY_ENGINE.dup - else - # not defined in ruby 1.8.7 - "ruby" - end + ruby_engine = RUBY_ENGINE.dup # :sob: mocking RUBY_VERSION breaks stuff on 1.8.7 ruby_version = ENV.fetch("BUNDLER_SPEC_RUBY_VERSION") { RUBY_VERSION }.dup ruby_engine_version = case ruby_engine |