2006-03-19 13:55:31 -05:00
|
|
|
require File.dirname(__FILE__) + '/../lib/ruby_version_check'
|
2005-05-21 07:05:18 -04:00
|
|
|
Signal.trap("INT") { puts; exit }
|
|
|
|
|
2006-04-01 01:18:33 -05:00
|
|
|
require File.dirname(__FILE__) + '/../lib/rails/version'
|
2006-04-03 18:39:36 -04:00
|
|
|
if %w(--version -v).include? ARGV.first
|
|
|
|
puts "Rails #{Rails::VERSION::STRING}"
|
|
|
|
exit(0)
|
|
|
|
end
|
2005-10-09 17:15:45 -04:00
|
|
|
|
2006-04-01 01:29:32 -05:00
|
|
|
freeze = ARGV.any? { |option| %w(--freeze -f).include?(option) }
|
2008-12-02 11:22:27 -05:00
|
|
|
|
2006-04-01 01:29:32 -05:00
|
|
|
app_path = ARGV.first
|
|
|
|
|
2005-02-07 08:14:05 -05:00
|
|
|
require File.dirname(__FILE__) + '/../lib/rails_generator'
|
2005-10-09 17:15:45 -04:00
|
|
|
|
2005-02-07 08:14:05 -05:00
|
|
|
require 'rails_generator/scripts/generate'
|
|
|
|
Rails::Generator::Base.use_application_sources!
|
2005-05-21 07:05:18 -04:00
|
|
|
Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')
|
2006-04-01 01:29:32 -05:00
|
|
|
|
|
|
|
Dir.chdir(app_path) { `rake rails:freeze:gems`; puts "froze" } if freeze
|