diff options
Diffstat (limited to 'railties/lib/commands')
-rw-r--r-- | railties/lib/commands/destroy.rb | 12 | ||||
-rwxr-xr-x | railties/lib/commands/generate.rb | 12 | ||||
-rw-r--r-- | railties/lib/commands/update.rb | 12 |
3 files changed, 25 insertions, 11 deletions
diff --git a/railties/lib/commands/destroy.rb b/railties/lib/commands/destroy.rb index f4b81d6511..6e740bb754 100644 --- a/railties/lib/commands/destroy.rb +++ b/railties/lib/commands/destroy.rb @@ -1,6 +1,10 @@ +RAILS_ENV.replace "generators" require "#{RAILS_ROOT}/config/environment" -require 'rails_generator' -require 'rails_generator/scripts/destroy' -ARGV.shift if ['--help', '-h'].include?(ARGV[0]) -Rails::Generator::Scripts::Destroy.new.run(ARGV) +if ARGV.size == 0 + Rails::Generators.help + exit +end + +name = ARGV.shift +Rails::Generators.invoke name, ARGV, :behavior => :revoke diff --git a/railties/lib/commands/generate.rb b/railties/lib/commands/generate.rb index 3d3db3d856..5408e78157 100755 --- a/railties/lib/commands/generate.rb +++ b/railties/lib/commands/generate.rb @@ -1,6 +1,10 @@ +RAILS_ENV.replace "generators" require "#{RAILS_ROOT}/config/environment" -require 'rails_generator' -require 'rails_generator/scripts/generate' -ARGV.shift if ['--help', '-h'].include?(ARGV[0]) -Rails::Generator::Scripts::Generate.new.run(ARGV) +if ARGV.size == 0 + Rails::Generators.help + exit +end + +name = ARGV.shift +Rails::Generators.invoke name, ARGV, :behavior => :invoke diff --git a/railties/lib/commands/update.rb b/railties/lib/commands/update.rb index 83ef833300..5ce1068e1a 100644 --- a/railties/lib/commands/update.rb +++ b/railties/lib/commands/update.rb @@ -1,4 +1,10 @@ +RAILS_ENV.replace "generators" require "#{RAILS_ROOT}/config/environment" -require 'rails_generator' -require 'rails_generator/scripts/update' -Rails::Generator::Scripts::Update.new.run(ARGV) + +if ARGV.size == 0 + Rails::Generators.help + exit +end + +name = ARGV.shift +Rails::Generators.invoke name, ARGV, :behavior => :skip |