2010-02-02 18:50:56 -05:00
|
|
|
require 'rails/version'
|
2011-04-10 12:52:42 -04:00
|
|
|
|
2011-04-11 09:25:39 -04:00
|
|
|
if ['--version', '-v'].include?(ARGV.first)
|
2010-02-02 18:50:56 -05:00
|
|
|
puts "Rails #{Rails::VERSION::STRING}"
|
|
|
|
exit(0)
|
|
|
|
end
|
|
|
|
|
2010-07-04 11:41:08 -04:00
|
|
|
if ARGV.first != "new"
|
2010-06-03 09:47:44 -04:00
|
|
|
ARGV[0] = "--help"
|
|
|
|
else
|
|
|
|
ARGV.shift
|
|
|
|
end
|
|
|
|
|
2010-02-04 08:05:13 -05:00
|
|
|
require 'rubygems' if ARGV.include?("--dev")
|
2010-02-02 18:50:56 -05:00
|
|
|
|
|
|
|
require 'rails/generators'
|
2010-03-23 09:12:58 -04:00
|
|
|
require 'rails/generators/rails/app/app_generator'
|
2010-02-02 18:50:56 -05:00
|
|
|
|
2011-01-28 21:59:29 -05:00
|
|
|
module Rails
|
|
|
|
module Generators
|
|
|
|
class AppGenerator
|
|
|
|
# We want to exit on failure to be kind to other libraries
|
|
|
|
# This is only when accessing via CLI
|
|
|
|
def self.exit_on_failure?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-04-29 19:45:45 -04:00
|
|
|
Rails::Generators::AppGenerator.start
|