Skip to content

Better support of pre-2.7 ruby#511

Merged
TApplencourt merged 1 commit into
develfrom
better-support-of-pre-2.6-ruby
Jun 23, 2026
Merged

Better support of pre-2.7 ruby#511
TApplencourt merged 1 commit into
develfrom
better-support-of-pre-2.6-ruby

Conversation

@TApplencourt

Copy link
Copy Markdown
Collaborator

iprof (xprof.rb) uses modern ruby syntax (endless ranges), so an old ruby fails to parse the whole file before the version check can run, giving a raw SyntaxError instead of a friendly message.

Split iprof into a tiny old-ruby-safe wrapper (xprof_wrapper.rb.in -> bin/iprof) that checks the ruby version, then requires the implementation (xprof.rb, now in DATADIR). The wrapper uses only old, plain syntax, so the version gate runs and prints a friendly message on old ruby.

Also add a configure-time ruby >= 2.7 check (single-sourced via RUBY_MIN_VERSION) and a bats regression test.

@TApplencourt TApplencourt force-pushed the better-support-of-pre-2.6-ruby branch 2 times, most recently from c91200b to de501a0 Compare June 23, 2026 16:31
iprof (xprof.rb) uses modern ruby syntax (endless ranges), so an old ruby
fails to *parse* the whole file before the version check can run, giving a
raw SyntaxError instead of a friendly message.

Split iprof into a tiny old-ruby-safe wrapper (xprof_wrapper.rb.in ->
bin/iprof) that checks the ruby version, then requires the implementation
(xprof.rb, now in DATADIR). The wrapper uses only old, plain syntax, so the
version gate runs and prints a friendly message on old ruby.

Also add a configure-time ruby >= 2.7 check (single-sourced via
RUBY_MIN_VERSION) and a bats regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TApplencourt TApplencourt force-pushed the better-support-of-pre-2.6-ruby branch from de501a0 to 73ac13e Compare June 23, 2026 16:53
@TApplencourt TApplencourt merged commit a3f1982 into devel Jun 23, 2026
27 checks passed
@TApplencourt

Copy link
Copy Markdown
Collaborator Author

Amazing PR Thomas!

@TApplencourt TApplencourt deleted the better-support-of-pre-2.6-ruby branch June 23, 2026 19:30
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.

1 participant