|
Revision 2469, 494 bytes
(checked in by david, 3 years ago)
|
Backed out of script/run portal idea. Muscle memory too deep
|
| Line | |
|---|
| 1 |
commands = Dir["#{File.dirname(__FILE__)}/commands/*.rb"].collect { |file_path| File.basename(file_path).split(".").first } |
|---|
| 2 |
|
|---|
| 3 |
if commands.include?(ARGV.first) |
|---|
| 4 |
require "#{File.dirname(__FILE__)}/commands/#{ARGV.shift}" |
|---|
| 5 |
else |
|---|
| 6 |
puts <<-USAGE |
|---|
| 7 |
The 'run' provides a unified access point for all the default Rails' commands. |
|---|
| 8 |
|
|---|
| 9 |
Usage: ./script/run <command> [OPTIONS] |
|---|
| 10 |
|
|---|
| 11 |
Examples: |
|---|
| 12 |
./script/run generate controller Admin |
|---|
| 13 |
./script/run process reaper |
|---|
| 14 |
|
|---|
| 15 |
USAGE |
|---|
| 16 |
puts "Choose: #{commands.join(", ")}" |
|---|
| 17 |
end |
|---|