From daee6fd92ac16878f6806c3382a9e74592aa9656 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 7 Feb 2005 13:14:05 +0000 Subject: Added new generator framework that informs about its doings on generation and enables updating and destruction of generated artifacts. See the new script/destroy and script/update for more details #487 [bitsweat] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@518 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/bin/rails | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'railties/bin/rails') diff --git a/railties/bin/rails b/railties/bin/rails index 7b3eebea82..da9b2af041 100755 --- a/railties/bin/rails +++ b/railties/bin/rails @@ -1,28 +1,7 @@ -if ARGV[0] - ENV["RAILS_PKG_DESTINATION"] = File.expand_path(ARGV[0]) - if RUBY_PLATFORM =~ /mswin32/ - Dir.chdir File.dirname(__FILE__) - system %{rake.cmd fresh_gem_rails} - else - system %{ cd #{File.dirname(__FILE__)}; rake fresh_gem_rails } - end -else - puts <<-HELP +require File.dirname(__FILE__) + '/../lib/rails_generator' +require 'rails_generator/simple_logger' +require 'rails_generator/scripts/generate' -NAME - rails - creates a new Rails installation - -SYNOPSIS - rails [full path] - -DESCRIPTION - This generator will create a suggested directory structure, lots of minor helper - files, and a default configuration for creating a new Rails application. Once the - generator is done, you're advised to look at the README in the root of the folder. - -EXAMPLE - rails ~/Code/Ruby/weblog - - This will generate a new Rails installation in the ~/Code/Ruby/weblog folder. -HELP -end \ No newline at end of file +Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new(STDOUT) +Rails::Generator::Base.use_application_sources! +Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app') -- cgit v1.2.3