Skip to content

Commit bf20faa

Browse files
st0012nirvdrum
andcommitted
Don't check RUBY_ENGINE when deciding whether to accept kargs
Ruby implementations like JRuby and TruffleRuby already indicate their compatibility target with RUBY_VERSION. We don't need to exclude them from accepting keyword arguments as long as they target 2.7+. Co-authored-by: Kevin Menard <[email protected]>
1 parent 7de0234 commit bf20faa

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

lib/irb/cmd/nop.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def string_literal?(args)
3030
end
3131
end
3232

33-
if RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.7.0"
33+
if RUBY_VERSION >= "2.7.0"
3434
def self.execute(conf, *opts, **kwargs, &block)
3535
command = new(conf)
3636
command.execute(*opts, **kwargs, &block)

lib/irb/extend-command.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def self.def_extend_command(cmd_name, cmd_class, load_file = nil, *aliases)
256256
end
257257

258258
if load_file
259-
kwargs = ", **kwargs" if RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.7.0"
259+
kwargs = ", **kwargs" if RUBY_VERSION >= "2.7.0"
260260
line = __LINE__; eval %[
261261
def #{cmd_name}(*opts#{kwargs}, &b)
262262
Kernel.require_relative "#{load_file}"

test/irb/test_cmd.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,6 @@ def test_ls_instance
733733
end
734734

735735
def test_ls_grep
736-
pend if RUBY_ENGINE == 'truffleruby'
737736
out, err = execute_lines("ls 42\n")
738737
assert_empty err
739738
assert_match(/times/, out)
@@ -752,7 +751,6 @@ def test_ls_grep
752751
end
753752

754753
def test_ls_grep_empty
755-
pend if RUBY_ENGINE == 'truffleruby'
756754
out, err = execute_lines("ls\n")
757755
assert_empty err
758756
assert_match(/whereami/, out)

0 commit comments

Comments
 (0)