rails / thor

Thor is a toolkit for building powerful command-line interfaces.
http://whatisthor.com/
MIT License
5.12k stars 552 forks source link

Fix Ruby 3.2.0-dev CI #789

Closed deivid-rodriguez closed 2 years ago

deivid-rodriguez commented 2 years ago

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 commented 2 years ago

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

deivid-rodriguez commented 2 years ago

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