aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-09-24 14:01:31 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-09-24 16:11:41 -0700
commitf0dd77c6be6a86fe384bb0015151e0a497973d39 (patch)
treead81bb4c807c39edeaa37035882a16d9d95ebaa9 /railties/lib/rails/commands.rb
parent610b81beca461a6fa4f00c7023e0e4315eb2b8be (diff)
downloadrails-f0dd77c6be6a86fe384bb0015151e0a497973d39.tar.gz
rails-f0dd77c6be6a86fe384bb0015151e0a497973d39.tar.bz2
rails-f0dd77c6be6a86fe384bb0015151e0a497973d39.zip
Move railties/lib/* into railties/lib/*
Diffstat (limited to 'railties/lib/rails/commands.rb')
-rw-r--r--railties/lib/rails/commands.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb
new file mode 100644
index 0000000000..841e98a0dc
--- /dev/null
+++ b/railties/lib/rails/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