File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,15 @@ def initialize(dictionary)
11
11
end
12
12
end
13
13
14
- DidYouMean ::Correctable
14
+ Module . new do
15
+ def to_s
16
+ super + DidYouMean . formatter . message_for ( corrections )
17
+ end
18
+
19
+ def corrections
20
+ @corrections ||= self . class . const_get ( :SpellChecker ) . new ( self ) . corrections
21
+ end
22
+ end
15
23
end
16
24
17
25
# Thor::Error is raised when it's caused by wrong usage of thor classes. Those
@@ -100,16 +108,4 @@ class RequiredArgumentMissingError < InvocationError
100
108
101
109
class MalformattedArgumentError < InvocationError
102
110
end
103
-
104
- if Correctable
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
114
- end
115
111
end
You can’t perform that action at this time.
0 commit comments