Refactor ci task in Rakefile for better readibility #1772
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been thinking about this for a long time, and today I had a bit of time between meetings to do it.
This PR squashes the per-Ruby appraisal declarations and replaces them with a single string of Rubies to be enabled/disabled, thus massively simplifying the Rakefile.
The actual list of tasks was generated using code: I copy pasted the previous declaration, and implemented a few alternative methods that kept track of what was enabled per-Ruby. In a second pass, I manually reordered a few items, restored the previous comments, and marked the items that are not usable on JRuby.
Thus, I'm quite confident that the output is equivalent to what we had before.
(Note: We previously had huge blocks of "if RUBY_PLATFORM != 'java'" for Ruby 2.6, 2.7, and 3.0 but those were actually no-ops BECAUSE we still only test with JRuby 9.2, which is 2.5. I've replaced them with the settings we have for JRuby 9.2; we can revisit once we have 9.3 going)
I dedicate this to @marcotc ;)