File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -102,9 +102,14 @@ class MalformattedArgumentError < InvocationError
102102 end
103103
104104 if Correctable
105- DidYouMean ::SPELL_CHECKERS . merge! (
106- 'Thor::UndefinedCommandError' => UndefinedCommandError ::SpellChecker ,
107- 'Thor::UnknownArgumentError' => UnknownArgumentError ::SpellChecker
108- )
105+ if DidYouMean . respond_to? ( :correct_error )
106+ DidYouMean . correct_error ( Thor ::UndefinedCommandError , UndefinedCommandError ::SpellChecker )
107+ DidYouMean . correct_error ( Thor ::UnknownArgumentError , UnknownArgumentError ::SpellChecker )
108+ else
109+ DidYouMean ::SPELL_CHECKERS . merge! (
110+ 'Thor::UndefinedCommandError' => UndefinedCommandError ::SpellChecker ,
111+ 'Thor::UnknownArgumentError' => UnknownArgumentError ::SpellChecker
112+ )
113+ end
109114 end
110115end
You can’t perform that action at this time.
0 commit comments