Skip to content

Commit 39e4435

Browse files
authored
Merge pull request #789 from deivid-rodriguez/fix-ci
Fix Ruby 3.2.0-dev CI
2 parents 5089c9b + 46d1422 commit 39e4435

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

lib/thor/error.rb

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ def initialize(dictionary)
1111
end
1212
end
1313

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
1523
end
1624

1725
# Thor::Error is raised when it's caused by wrong usage of thor classes. Those
@@ -100,16 +108,4 @@ class RequiredArgumentMissingError < InvocationError
100108

101109
class MalformattedArgumentError < InvocationError
102110
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
115111
end

0 commit comments

Comments
 (0)