1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/bin/rails
Jeremy McAnally e8cc4b116c Add "-m/--template" option to Rails generator to apply template to generated application.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-12-02 19:39:11 +01:00

20 lines
No EOL
636 B
Text
Executable file

require File.dirname(__FILE__) + '/../lib/ruby_version_check'
Signal.trap("INT") { puts; exit }
require File.dirname(__FILE__) + '/../lib/rails/version'
if %w(--version -v).include? ARGV.first
puts "Rails #{Rails::VERSION::STRING}"
exit(0)
end
freeze = ARGV.any? { |option| %w(--freeze -f).include?(option) }
app_path = ARGV.first
require File.dirname(__FILE__) + '/../lib/rails_generator'
require 'rails_generator/scripts/generate'
Rails::Generator::Base.use_application_sources!
Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')
Dir.chdir(app_path) { `rake rails:freeze:gems`; puts "froze" } if freeze