[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: error.rb
File is not writable. Editing disabled.
class Bundler::Thor Correctable = if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable) # In order to support versions of Ruby that don't have keyword # arguments, we need our own spell checker class that doesn't take key # words. Even though this code wouldn't be hit because of the check # above, it's still necessary because the interpreter would otherwise be # unable to parse the file. class NoKwargSpellChecker < DidYouMean::SpellChecker # :nodoc: def initialize(dictionary) @dictionary = dictionary end end DidYouMean::Correctable end # Bundler::Thor::Error is raised when it's caused by wrong usage of thor classes. Those # errors have their backtrace suppressed and are nicely shown to the user. # # Errors that are caused by the developer, like declaring a method which # overwrites a thor keyword, SHOULD NOT raise a Bundler::Thor::Error. This way, we # ensure that developer errors are shown with full backtrace. class Error < StandardError end # Raised when a command was not found. class UndefinedCommandError < Error class SpellChecker attr_reader :error def initialize(error) @error = error end def corrections @corrections ||= spell_checker.correct(error.command).map(&:inspect) end def spell_checker NoKwargSpellChecker.new(error.all_commands) end end attr_reader :command, :all_commands def initialize(command, all_commands, namespace) @command = command @all_commands = all_commands message = "Could not find command #{command.inspect}" message = namespace ? "#{message} in #{namespace.inspect} namespace." : "#{message}." super(message) end prepend Correctable if Correctable end UndefinedTaskError = UndefinedCommandError class AmbiguousCommandError < Error end AmbiguousTaskError = AmbiguousCommandError # Raised when a command was found, but not invoked properly. class InvocationError < Error end class UnknownArgumentError < Error class SpellChecker attr_reader :error def initialize(error) @error = error end def corrections @corrections ||= error.unknown.flat_map { |unknown| spell_checker.correct(unknown) }.uniq.map(&:inspect) end def spell_checker @spell_checker ||= NoKwargSpellChecker.new(error.switches) end end attr_reader :switches, :unknown def initialize(switches, unknown) @switches = switches @unknown = unknown super("Unknown switches #{unknown.map(&:inspect).join(', ')}") end prepend Correctable if Correctable end class RequiredArgumentMissingError < InvocationError end class MalformattedArgumentError < InvocationError end if Correctable DidYouMean::SPELL_CHECKERS.merge!( 'Bundler::Thor::UndefinedCommandError' => UndefinedCommandError::SpellChecker, 'Bundler::Thor::UnknownArgumentError' => UnknownArgumentError::SpellChecker ) end end
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium171.web-hosting.com
Server IP: 162.0.209.115
PHP Version: 8.0.30
Server Software: LiteSpeed
System: Linux premium171.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 70.85 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: aircyknj
User ID (UID): 2056
Group ID (GID): 2052
Script Owner UID: 2056
Current Dir Owner: N/A