diff options
| author | Neeraj Singh <neerajdotname@gmail.com> | 2010-11-22 17:32:27 -0500 |
|---|---|---|
| committer | Neeraj Singh <neerajdotname@gmail.com> | 2010-11-22 17:32:27 -0500 |
| commit | 5debc65c356c619bce20dcc10c0befc7c4204ef5 (patch) | |
| tree | dc32bab1eccd11bacdaff70f25696689a2b9dc66 /railties/lib/rails/commands.rb | |
| parent | 1c68e55ae5e90b7c072a1f6030ea3dd4becd8a07 (diff) | |
| parent | 818b366c3e3645b3375ee0b1d1023621dbeaede2 (diff) | |
| download | rails-5debc65c356c619bce20dcc10c0befc7c4204ef5.tar.gz rails-5debc65c356c619bce20dcc10c0befc7c4204ef5.tar.bz2 rails-5debc65c356c619bce20dcc10c0befc7c4204ef5.zip | |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/lib/rails/commands.rb')
| -rw-r--r-- | railties/lib/rails/commands.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb index e3aa6d7c3e..338565247f 100644 --- a/railties/lib/rails/commands.rb +++ b/railties/lib/rails/commands.rb @@ -12,14 +12,19 @@ command = aliases[command] || command case command when 'generate', 'destroy', 'plugin' - require APP_PATH - Rails.application.require_environment! + 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.application.railties.engines.find { |r| r.root.to_s == ENGINE_PATH } - Rails.application = engine + if defined?(ENGINE_PATH) + engine = Rails.application.railties.engines.find { |r| r.root.to_s == ENGINE_PATH } + Rails.application = engine + end + + require "rails/commands/#{command}" end - require "rails/commands/#{command}" when 'benchmarker', 'profiler' require APP_PATH |
