2005-09-29 08:33:48 -04:00
|
|
|
commands = Dir["#{File.dirname(__FILE__)}/commands/*.rb"].collect { |file_path| File.basename(file_path).split(".").first }
|
|
|
|
|
|
|
|
if commands.include?(ARGV.first)
|
|
|
|
require "#{File.dirname(__FILE__)}/commands/#{ARGV.shift}"
|
2005-09-29 08:18:51 -04:00
|
|
|
else
|
2005-10-05 22:05:36 -04:00
|
|
|
puts <<-USAGE
|
|
|
|
The 'run' provides a unified access point for all the default Rails' commands.
|
|
|
|
|
|
|
|
Usage: ./script/run <command> [OPTIONS]
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
./script/run generate controller Admin
|
|
|
|
./script/run process reaper
|
|
|
|
|
|
|
|
USAGE
|
2005-09-29 08:33:48 -04:00
|
|
|
puts "Choose: #{commands.join(", ")}"
|
2005-09-29 08:18:51 -04:00
|
|
|
end
|