Method not available on this version
This method is only available on newer versions.
The first available version (v2_6_3) is shown here.
run(instance, args = [])
public
By default, a command invokes a method in the thor class. You can change
this implementation to create custom commands.
# File lib/bundler/vendor/thor/lib/thor/command.rb, line 20
def run(instance, args = [])
arity = nil
if private_method?(instance)
instance.class.handle_no_command_error(name)
elsif public_method?(instance)
arity = instance.method(name).arity
instance.__send__(name, *args)
elsif local_method?(instance, :method_missing)
instance.__send__(:method_missing, name.to_sym, *args)
else
instance.class.handle_no_command_error(name)
end
rescue ArgumentError => e
handle_argument_error?(instance, e, caller) ? instance.class.handle_argument_error(self, e, args, arity) : (raise e)
rescue NoMethodError => e
handle_no_method_error?(instance, e, caller) ? instance.class.handle_no_command_error(name) : (raise e)
end