diff options
author | Nobuyoshi Nakada <[email protected]> | 2025-06-29 16:50:09 +0900 |
---|---|---|
committer | git <[email protected]> | 2025-06-29 07:52:46 +0000 |
commit | 9598ed9d1c56e971e76d4bbbacef6ec9643e12dc (patch) | |
tree | 4443045e90e5925e37540d7c981618e441212b42 | |
parent | 259b0233d826104840d0b52ebb14e0a3435d4497 (diff) |
[ruby/optparse] JRuby does not have EXECUTABLE_EXTS in RbConfg::CONFIG
https://github.com/ruby/optparse/commit/15b2f00b6b
-rw-r--r-- | lib/optparse.rb | 2 | ||||
-rw-r--r-- | test/optparse/test_optparse.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb index 7838af7783..332aea2148 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -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 diff --git a/test/optparse/test_optparse.rb b/test/optparse/test_optparse.rb index ae12ae5677..ff334009a6 100644 --- a/test/optparse/test_optparse.rb +++ b/test/optparse/test_optparse.rb @@ -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 |