module Preek::DefaultCommand
Lets monkey patch to have a default action with arguments!
Public Instance Methods
dispatch(meth, given_args, given_opts, config)
click to toggle source
Calls superclass method
# File lib/preek/default_command.rb, line 4 def dispatch(meth, given_args, given_opts, config) meth = retrieve_command_name(given_args) command = all_commands[normalize_command_name(meth)] unless command given_args.unshift meth meth = default_command command = all_commands[meth] end if given_args.empty? && command.name == default_command handle_argument_error(command, nil, given_args, nil) end super end