aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/commands.rb')
-rw-r--r--railties/lib/rails/commands.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb
index 4a082aedb8..ada150ceec 100644
--- a/railties/lib/rails/commands.rb
+++ b/railties/lib/rails/commands.rb
@@ -4,6 +4,7 @@ ARGV << '--help' if ARGV.empty?
aliases = {
"g" => "generate",
+ "d" => "destroy",
"c" => "console",
"s" => "server",
"db" => "dbconsole",
@@ -15,15 +16,15 @@ command = aliases[command] || command
case command
when 'generate', 'destroy', 'plugin'
+ require 'rails/generators'
+
if command == 'plugin' && ARGV.first == 'new'
require "rails/commands/plugin_new"
else
require APP_PATH
Rails.application.require_environment!
- if defined?(ENGINE_PATH) && engine = Rails::Engine.find(ENGINE_PATH)
- Rails.application = engine
- end
+ Rails.application.load_generators
require "rails/commands/#{command}"
end
@@ -87,13 +88,13 @@ The most common rails commands are:
In addition to those, there are:
application Generate the Rails application code
- destroy Undo code generated with "generate"
+ destroy Undo code generated with "generate" (short-cut alias: "d")
benchmarker See how fast a piece of code runs
profiler Get profile information from a piece of code
plugin Install a plugin
- runner Run a piece of code in the application environment
+ runner Run a piece of code in the application environment (short-cut alias: "r")
-All commands can be run with -h for more information.
+All commands can be run with -h (or --help) for more information.
EOT
exit(1)
end