mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[ruby/optparse] JRuby does not have EXECUTABLE_EXTS in RbConfg::CONFIG
https://github.com/ruby/optparse/commit/15b2f00b6b
This commit is contained in:
parent
259b0233d8
commit
9598ed9d1c
@ -1300,7 +1300,7 @@ XXX
|
||||
private def strip_ext(name) # :nodoc:
|
||||
exts = /#{
|
||||
require "rbconfig"
|
||||
Regexp.union(RbConfig::CONFIG["EXECUTABLE_EXTS"])
|
||||
Regexp.union(*RbConfig::CONFIG["EXECUTABLE_EXTS"]&.split(" "))
|
||||
}\z/o
|
||||
name.sub(exts, "")
|
||||
end
|
||||
|
||||
@ -221,7 +221,7 @@ class TestOptionParser < Test::Unit::TestCase
|
||||
program = $0
|
||||
$0 = "rdbg3.5"
|
||||
assert_equal "rdbg3.5", OptionParser.new.program_name
|
||||
RbConfig::CONFIG["EXECUTABLE_EXTS"].split(" ") do |ext|
|
||||
RbConfig::CONFIG["EXECUTABLE_EXTS"]&.split(" ") do |ext|
|
||||
$0 = "rdbg3.5" + ext
|
||||
assert_equal "rdbg3.5", OptionParser.new.program_name
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user