README


INSTALLATION
gem install warning_shot


USAGE
WarningShot can be used from the command line or in a capistrano script via the 'warning-shot' binary.

Options are:

--environment=RAILS_ENV Environment to test in.
Default: development
-s, --strict URL Testing is only successful on 200 instead of 2xx
-f, --flush Flush log before running
-g, --gems Install/update all missing OR outdated gems
--dir=DIR The root directory of the application to check.
Default: .
--log=LOG Path of log file.
Default: (--dir path)/logs/warning_shot_(--environment).log
--configs=PATH Path to config files to use.
Default: (--dir path)/config/warning_shot/
-v, --verbose Output verbose information.
-n, --growl Output final results via growlnotify (Requires growlnotify)
--templates=[PATH] Generates template files
Default: Not Generated! (If specified, default is '.')
-h, --help Show this help message.


CONFIGURATION FILES
(Additional details are in each individual config file)
Configuration files can be generated with 'warning-shot --templates=/PATH/TO/TEMPLATES'. This will
generate five configuration files:
- binaries.yml (Binary applications or scripts)
- classes.yml (Classes your application is dependent on, generally anything after 'requires')
- filesystem.yml (Specific files or directories to test existance of)
- gems.yml (Required gems and their versions)
- preload.yml (These are files that are needed for testing, they will be loaded with 'requires' before testing starts.)
A failed preload is fatal and will stop testing.
- urls.yml (Required URLs)

Each config file contains a list of application environments as well as a 'global' environment. Dependency
requirements can be placed in the applicable environment where the dependency exists, or can be added to the
'global' environment, which will use the dependency in all cases.

Template generation will also create a 'scripts' directory for ruby and shell scripts (discussed next).


SCRIPTS
Scripts are available for more complex dependency testing, like testing web services, verifying network interfaces, etc.

Currently only ruby scripts are supported (bash will be supported soon). All scipts should extend "RippleNetworks::WarningShot::TestScript"
and implement a "run" method. "run" should return whether the test passed or failed (true or false).

Test scripts are run in a natural sort order with the exception of "pre" and "post" scripts.

A master pre and post script exists (pre.rb and post.rb respectively) that will run before and after all other scripts.
This can be used to set up and tear down additional aspects of the test environment.

Each script that you create can also have a pre and post script run by creating an additional script with the
prefix "pre_" or "post_" in the script directory.

The scripts should return a TRUE of FALSE value to let WarningShot know if the test was considered a pass or not. An array
can be returned [Boolean,String] of the result and message. The message will be display if provided.