Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support older versions of ruby #77

Merged
merged 3 commits into from
Sep 1, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
engine: cruby
min_version: 2.6 # from `required_ruby_version` in io-console.gemspec

test:
needs: ruby-versions
Expand Down
10 changes: 4 additions & 6 deletions ext/io/console/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,10 +1538,8 @@ console_clear_screen(VALUE io)
static VALUE
io_open_descriptor_fallback(VALUE klass, int descriptor, int mode, VALUE path, VALUE timeout, void *encoding)
{
rb_update_max_fd(descriptor);

VALUE arguments[2] = {
INT2NUM(descriptor),
(rb_update_max_fd(descriptor), INT2NUM(descriptor)),
INT2FIX(mode),
};

Expand Down Expand Up @@ -1598,14 +1596,14 @@ console_dev_remove(VALUE klass)

static ID id_console;

static bool
static int
console_dev_get(VALUE klass, VALUE *dev)
{
if (rb_const_defined(klass, id_console)) {
*dev = rb_const_get(klass, id_console);
return true;
return 1;
}
return false;
return 0;
}

static void
Expand Down