2010-02-02 18:50:56 -05:00
|
|
|
if File.exists?(Dir.getwd + '/script/rails')
|
|
|
|
exec(Dir.getwd + '/script/rails', *ARGV)
|
|
|
|
else
|
|
|
|
begin
|
|
|
|
require 'rails/ruby_version_check'
|
|
|
|
rescue LoadError
|
|
|
|
# If people are not using gems, the load path must still
|
|
|
|
# be correct.
|
|
|
|
# TODO: Remove the begin / rescue block somehow
|
|
|
|
$:.unshift File.expand_path('../../lib', __FILE__)
|
|
|
|
$:.unshift File.expand_path('../../../activesupport/lib', __FILE__)
|
|
|
|
$:.unshift File.expand_path('../../../actionpack/lib', __FILE__)
|
|
|
|
require 'rails/ruby_version_check'
|
|
|
|
end
|
2009-09-24 17:01:31 -04:00
|
|
|
|
2010-02-02 18:50:56 -05:00
|
|
|
Signal.trap("INT") { puts; exit }
|
2005-05-21 07:05:18 -04:00
|
|
|
|
2010-02-02 18:50:56 -05:00
|
|
|
require 'rails/version'
|
|
|
|
if %w(--version -v).include? ARGV.first
|
|
|
|
puts "Rails #{Rails::VERSION::STRING}"
|
|
|
|
exit(0)
|
|
|
|
end
|
2005-10-09 17:15:45 -04:00
|
|
|
|
2010-02-02 18:50:56 -05:00
|
|
|
ARGV << "--help" if ARGV.empty?
|
2009-06-17 12:26:08 -04:00
|
|
|
|
2010-02-02 18:50:56 -05:00
|
|
|
require 'rails/generators'
|
|
|
|
require 'generators/rails/app/app_generator'
|
2009-12-27 17:43:06 -05:00
|
|
|
|
2010-02-02 18:50:56 -05:00
|
|
|
Rails::Generators::AppGenerator.start
|
|
|
|
end
|