Projects
Mega:23.03
rubygem-thor
_service:tar_scm:Support-latest-did_you_mean.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:Support-latest-did_you_mean.patch of Package rubygem-thor
From 98dbec75e4237fb8fb1b4190fd91cc22ad65068f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@riseup.net> Date: Wed, 22 Dec 2021 13:54:23 +0100 Subject: [PATCH] Support latest did_you_mean Using `DidYouMean::SPELL_CHECKERS.merge!` has been deprecated. --- lib/thor/error.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/thor/error.rb b/lib/thor/error.rb index c7c285906..893b135ec 100644 --- a/lib/thor/error.rb +++ b/lib/thor/error.rb @@ -102,9 +102,14 @@ class MalformattedArgumentError < InvocationError end if Correctable - DidYouMean::SPELL_CHECKERS.merge!( - 'Thor::UndefinedCommandError' => UndefinedCommandError::SpellChecker, - 'Thor::UnknownArgumentError' => UnknownArgumentError::SpellChecker - ) + if DidYouMean.respond_to?(:correct_error) + DidYouMean.correct_error(Thor::UndefinedCommandError, UndefinedCommandError::SpellChecker) + DidYouMean.correct_error(Thor::UnknownArgumentError, UnknownArgumentError::SpellChecker) + else + DidYouMean::SPELL_CHECKERS.merge!( + 'Thor::UndefinedCommandError' => UndefinedCommandError::SpellChecker, + 'Thor::UnknownArgumentError' => UnknownArgumentError::SpellChecker + ) + end end end
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2