Skip to content

Conversation

deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Jun 16, 2022

Ruby 3.2 will introduce Exception#detailed_message and did_you_mean has been already updated in Ruby 3.2 to use that.

The new behaviour means not changing the original Exception#message. That means it is hard to get the previous error output, because Exception#detailed_message includes not only did_you_mean decorations, but also additional information like the exception class.

My fix is to change the Correctable module to essentially reimplement the old did_you_mean behavior, so that we can keep our behavior intact without getting affected by the above changes.

Fixes #781.

@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review June 16, 2022 06:35
@deivid-rodriguez deivid-rodriguez marked this pull request as draft June 16, 2022 07:38
@deivid-rodriguez
Copy link
Contributor Author

Marked as draft because I want to find a better way.

@deivid-rodriguez deivid-rodriguez changed the title Add support for new Exception#detailed_message behaviour Fix Ruby 3.2 CI Jun 16, 2022
@deivid-rodriguez deivid-rodriguez force-pushed the fix-ci branch 4 times, most recently from 670d4df to d9ec76b Compare June 16, 2022 08:16
Ruby 3.2 will introduce `Exception#detailed_message` and `did_you_mean`
has been already updated in Ruby 3.2 to use that.

The new behaviour means not changing the original `Exception#message`.
That means it is hard to get the previous error output, because
`Exception#detailed_message` includes not only `did_you_mean`
decorations, but also additional information like the exception class.

To fix this, I bring the old did_you_mean behavior into Thor, so that
the above changes do not affect us.
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review June 16, 2022 09:54
@deivid-rodriguez
Copy link
Contributor Author

Ok, I think the new approach is much cleaner, this should be ready!

@deivid-rodriguez deivid-rodriguez changed the title Fix Ruby 3.2 CI Fix Ruby 3.2.0-dev CI Jun 16, 2022
@rafaelfranca rafaelfranca merged commit 39e4435 into rails:main Jun 17, 2022
@deivid-rodriguez deivid-rodriguez deleted the fix-ci branch June 17, 2022 07:51
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.

CI not running clean
2 participants