class Autotest
def self.parse_options args = ARGV
def self.parse_options args = ARGV require 'optparse' options = { :args => args.dup } OptionParser.new do |opts| opts.banner = <<-BANNER.gsub(/^ /, '') Continuous testing for your ruby app. Autotest automatically tests code that has changed. It assumes the code is in lib, and tests are in test/test_*.rb. Autotest uses plugins to control what happens. You configure plugins with require statements in the .autotest file in your project base directory, and a default configuration for all your projects in the .autotest file in your home directory. Usage: autotest [options] BANNER opts.on "-d", "--debug", "Debug mode, for reporting bugs." do require "pp" options[:debug] = true end opts.on "-v", "--verbose", "Be annoyingly verbose (debugs .autotest)." do options[:verbose] = true end opts.on "-q", "--quiet", "Be quiet." do options[:quiet] = true end opts.on("-r", "--rc CONF", String, "Override path to config file") do |o| options[:rc] = Array(o) end opts.on("-w", "--warnings", "Turn on ruby warnings") do $-w = true end opts.on "-h", "--help", "Show this." do puts opts exit 1 end end.parse! args Autotest.options.merge! options options end