From ec55e59e993d6c39c6ba8d57d4ef6d270ee8c14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 2 Jul 2009 11:08:07 +0200 Subject: Updated commands. --- railties/lib/commands/destroy.rb | 12 ++++++++---- railties/lib/commands/generate.rb | 12 ++++++++---- railties/lib/commands/update.rb | 12 +++++++++--- 3 files changed, 25 insertions(+), 11 deletions(-) (limited to 'railties/lib/commands') diff --git a/railties/lib/commands/destroy.rb b/railties/lib/commands/destroy.rb index f4b81d6511..204477b738 100644 --- a/railties/lib/commands/destroy.rb +++ b/railties/lib/commands/destroy.rb @@ -1,6 +1,10 @@ require "#{RAILS_ROOT}/config/environment" -require 'rails_generator' -require 'rails_generator/scripts/destroy' +require 'generators' -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, :revoke diff --git a/railties/lib/commands/generate.rb b/railties/lib/commands/generate.rb index 3d3db3d856..7d133a179e 100755 --- a/railties/lib/commands/generate.rb +++ b/railties/lib/commands/generate.rb @@ -1,6 +1,10 @@ require "#{RAILS_ROOT}/config/environment" -require 'rails_generator' -require 'rails_generator/scripts/generate' +require 'generators' -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, :invoke diff --git a/railties/lib/commands/update.rb b/railties/lib/commands/update.rb index 83ef833300..0c14355f24 100644 --- a/railties/lib/commands/update.rb +++ b/railties/lib/commands/update.rb @@ -1,4 +1,10 @@ require "#{RAILS_ROOT}/config/environment" -require 'rails_generator' -require 'rails_generator/scripts/update' -Rails::Generator::Scripts::Update.new.run(ARGV) +require 'generators' + +if ARGV.size == 0 + Rails::Generators.help + exit +end + +name = ARGV.shift +Rails::Generators.invoke name, ARGV, :skip -- cgit v1.2.3 From 44633dc7a587424d21917413500b2d71fa3d31bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 3 Jul 2009 15:12:18 +0200 Subject: Add some tests for no_color! behavior. --- railties/lib/commands/destroy.rb | 2 +- railties/lib/commands/generate.rb | 2 +- railties/lib/commands/update.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/lib/commands') diff --git a/railties/lib/commands/destroy.rb b/railties/lib/commands/destroy.rb index 204477b738..075fe5bb12 100644 --- a/railties/lib/commands/destroy.rb +++ b/railties/lib/commands/destroy.rb @@ -7,4 +7,4 @@ if ARGV.size == 0 end name = ARGV.shift -Rails::Generators.invoke name, ARGV, :revoke +Rails::Generators.invoke name, ARGV, :behavior => :revoke diff --git a/railties/lib/commands/generate.rb b/railties/lib/commands/generate.rb index 7d133a179e..f6db965960 100755 --- a/railties/lib/commands/generate.rb +++ b/railties/lib/commands/generate.rb @@ -7,4 +7,4 @@ if ARGV.size == 0 end name = ARGV.shift -Rails::Generators.invoke name, ARGV, :invoke +Rails::Generators.invoke name, ARGV, :behavior => :invoke diff --git a/railties/lib/commands/update.rb b/railties/lib/commands/update.rb index 0c14355f24..50b7d73e0e 100644 --- a/railties/lib/commands/update.rb +++ b/railties/lib/commands/update.rb @@ -7,4 +7,4 @@ if ARGV.size == 0 end name = ARGV.shift -Rails::Generators.invoke name, ARGV, :skip +Rails::Generators.invoke name, ARGV, :behavior => :skip -- cgit v1.2.3 From 09c288f0c5b5f9da4473bb321cccb766d9f59d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 8 Jul 2009 12:55:50 +0200 Subject: Add the new generators environment and update commands. --- railties/lib/commands/destroy.rb | 2 +- railties/lib/commands/generate.rb | 2 +- railties/lib/commands/update.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/lib/commands') diff --git a/railties/lib/commands/destroy.rb b/railties/lib/commands/destroy.rb index 075fe5bb12..6e740bb754 100644 --- a/railties/lib/commands/destroy.rb +++ b/railties/lib/commands/destroy.rb @@ -1,5 +1,5 @@ +RAILS_ENV.replace "generators" require "#{RAILS_ROOT}/config/environment" -require 'generators' if ARGV.size == 0 Rails::Generators.help diff --git a/railties/lib/commands/generate.rb b/railties/lib/commands/generate.rb index f6db965960..5408e78157 100755 --- a/railties/lib/commands/generate.rb +++ b/railties/lib/commands/generate.rb @@ -1,5 +1,5 @@ +RAILS_ENV.replace "generators" require "#{RAILS_ROOT}/config/environment" -require 'generators' if ARGV.size == 0 Rails::Generators.help diff --git a/railties/lib/commands/update.rb b/railties/lib/commands/update.rb index 50b7d73e0e..5ce1068e1a 100644 --- a/railties/lib/commands/update.rb +++ b/railties/lib/commands/update.rb @@ -1,5 +1,5 @@ +RAILS_ENV.replace "generators" require "#{RAILS_ROOT}/config/environment" -require 'generators' if ARGV.size == 0 Rails::Generators.help -- cgit v1.2.3 From f68e7a3987adf2cffe0e48263d117839c2028185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 13 Jul 2009 18:18:08 +0200 Subject: Remove generator environment until we have a gem manifest. --- railties/lib/commands/destroy.rb | 2 +- railties/lib/commands/generate.rb | 2 +- railties/lib/commands/update.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/lib/commands') diff --git a/railties/lib/commands/destroy.rb b/railties/lib/commands/destroy.rb index 6e740bb754..5013d30b83 100644 --- a/railties/lib/commands/destroy.rb +++ b/railties/lib/commands/destroy.rb @@ -1,4 +1,4 @@ -RAILS_ENV.replace "generators" +require File.expand_path(File.join(File.dirname(__FILE__), '..', 'generators')) require "#{RAILS_ROOT}/config/environment" if ARGV.size == 0 diff --git a/railties/lib/commands/generate.rb b/railties/lib/commands/generate.rb index 5408e78157..32cabcab10 100755 --- a/railties/lib/commands/generate.rb +++ b/railties/lib/commands/generate.rb @@ -1,4 +1,4 @@ -RAILS_ENV.replace "generators" +require File.expand_path(File.join(File.dirname(__FILE__), '..', 'generators')) require "#{RAILS_ROOT}/config/environment" if ARGV.size == 0 diff --git a/railties/lib/commands/update.rb b/railties/lib/commands/update.rb index 5ce1068e1a..f3b3ad0775 100644 --- a/railties/lib/commands/update.rb +++ b/railties/lib/commands/update.rb @@ -1,4 +1,4 @@ -RAILS_ENV.replace "generators" +require File.expand_path(File.join(File.dirname(__FILE__), '..', 'generators')) require "#{RAILS_ROOT}/config/environment" if ARGV.size == 0 -- cgit v1.2.3