Skip to content

Conversation

@eregon
Copy link
Member

@eregon eregon commented Jan 29, 2026

When I initially wrote this, I used `RUBY_VERSION` so it's easier to stub in tests
But turns out that doesn't work in CRuby tests
Copy link
Collaborator

@Earlopain Earlopain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified this a bit. Does this make sense to you? Initially I used RUBY_VERSION so it's possible to stub in tests but that didn't work out in CRuby tests so it doesn't really make sesne to keep around just for that.

Copy link
Collaborator

@kddnewton kddnewton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this approach!

@kddnewton kddnewton merged commit 7caa659 into ruby:main Feb 3, 2026
66 checks passed
@eregon
Copy link
Member Author

eregon commented Feb 3, 2026

@Earlopain Nice, I was thinking indeed there is probably a more direct way to access the value.

This is using https://github.com/ruby/ruby/blob/3237be163c313af0b6626b209e55bdb0b33c9f0f/include/ruby/version.h#L107-L113 for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants