aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorStefan Sprenger <stefan.sprenger@dkd.de>2011-05-27 13:50:42 +0200
committerStefan Sprenger <stefan.sprenger@dkd.de>2011-05-27 13:50:42 +0200
commit0ac5c03f169b3e3055040e84ca088df134c2bfbb (patch)
treec3bf0f26bd1d4e4b9da516ac9069edee8b496531 /railties
parente38d3752c377b400aea1d0b854bebf3734664cd7 (diff)
downloadrails-0ac5c03f169b3e3055040e84ca088df134c2bfbb.tar.gz
rails-0ac5c03f169b3e3055040e84ca088df134c2bfbb.tar.bz2
rails-0ac5c03f169b3e3055040e84ca088df134c2bfbb.zip
Add destroy to engine's commands
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/engine/commands.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/engine/commands.rb b/railties/lib/rails/engine/commands.rb
index b77fef8ffd..59b7c4d67f 100644
--- a/railties/lib/rails/engine/commands.rb
+++ b/railties/lib/rails/engine/commands.rb
@@ -13,10 +13,10 @@ require ENGINE_PATH
engine = ::Rails::Engine.find(ENGINE_ROOT)
case command
-when 'generate'
+when 'generate', 'destroy'
require 'rails/generators'
engine.load_generators
- require 'rails/commands/generate'
+ require "rails/commands/#{command}"
when '--version', '-v'
ARGV.unshift '--version'
@@ -29,6 +29,7 @@ Usage: rails COMMAND [ARGS]
The common rails commands available for engines are:
generate Generate new code (short-cut alias: "g")
+ destroy Undo code generated with "generate"
All commands can be run with -h for more information.
EOT