Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ext/io/console/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ extern VALUE rb_scheduler_timeout(struct timeval *timeout);
#define sys_fail_fptr(fptr) rb_sys_fail_str((fptr)->pathv)

#ifndef HAVE_RB_F_SEND
#ifndef RB_PASS_CALLED_KEYWORDS
# define rb_funcallv_kw(recv, mid, arg, argv, kw_splat) rb_funcallv(recv, mid, arg, argv)
#endif

static ID id___send__;

static VALUE
Expand All @@ -104,7 +108,7 @@ rb_f_send(int argc, VALUE *argv, VALUE recv)
else {
vid = id___send__;
}
return rb_funcallv(recv, vid, argc, argv);
return rb_funcallv_kw(recv, vid, argc, argv, RB_PASS_CALLED_KEYWORDS);
}
#endif

Expand Down
8 changes: 8 additions & 0 deletions test/io/console/test_io_console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ def test_close
assert_equal(["true"], run_pty("IO.console(:close); p IO.console(:tty?)"))
end

def test_console_kw
assert_equal(["File"], run_pty("IO.console.close; p IO.console(:clone, freeze: true).class"))
end

def test_sync
assert_equal(["true"], run_pty("p IO.console.sync"))
end
Expand Down Expand Up @@ -477,6 +481,10 @@ def test_close
IO.console(:close)
end

def test_console_kw
assert_kind_of(IO, IO.console(:clone, freeze: true))
end

def test_sync
assert(IO.console.sync, "console should be unbuffered")
ensure
Expand Down