Module Mongrel::Command::Base
In: lib/mongrel/command.rb

A Command pattern implementation used to create the set of command available to the user from Mongrel. The script uses objects which implement this interface to do the user’s bidding.

Methods

Attributes

done_validating  [R] 
original_args  [R] 
valid  [R] 

Public Class methods

Called by the subclass to setup the command and parse the argv arguments. The call is destructive on argv since it uses the OptionParser#parse! function.

Public Instance methods

Just a simple method to display failure until something better is developed.

Returns a help message. Defaults to OptionParser#help which should be good.

Called by the implemented command to set the options for that command. Every option has a short and long version, a description, a variable to set, and a default value. No exceptions.

Runs the command doing it’s job. You should implement this otherwise it will throw a NotImplementedError as a reminder.

Validates the given expression is true and prints the message if not, exiting.

Validates that the given directory exists

Validates that a file exists and if not displays the message

Validates that the file is a file and not a directory or something else.

Returns true/false depending on whether the command is configured properly.

[Validate]