diff options
Diffstat (limited to 'vendor/rails-2.0.2/railties/lib/commands.rb')
-rw-r--r-- | vendor/rails-2.0.2/railties/lib/commands.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/rails-2.0.2/railties/lib/commands.rb b/vendor/rails-2.0.2/railties/lib/commands.rb new file mode 100644 index 000000000..841e98a0d --- /dev/null +++ b/vendor/rails-2.0.2/railties/lib/commands.rb @@ -0,0 +1,17 @@ +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}" +else + 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 + puts "Choose: #{commands.join(", ")}" +end
\ No newline at end of file |