diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-09 06:14:06 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-09 06:14:06 -0700 |
commit | 37d1e48dfe1d120053ea71090cd52314990b4978 (patch) | |
tree | 33be3f8d406a8e03ec7deb81bd11d3ca81d84f2a /railties/lib/rails/commands | |
parent | 1b3873730b96035a238dbff7627bd5942e6dc4e7 (diff) | |
parent | 929e5b5b8ba4273ac3138c91c885d9f1843ce390 (diff) | |
download | rails-37d1e48dfe1d120053ea71090cd52314990b4978.tar.gz rails-37d1e48dfe1d120053ea71090cd52314990b4978.tar.bz2 rails-37d1e48dfe1d120053ea71090cd52314990b4978.zip |
Merge pull request #11378 from wangjohn/class_for_application_generator
Creating a class to handle preparing ARGV.
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/application.rb | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/railties/lib/rails/commands/application.rb b/railties/lib/rails/commands/application.rb index 2ff29418c6..678697f09b 100644 --- a/railties/lib/rails/commands/application.rb +++ b/railties/lib/rails/commands/application.rb @@ -1,30 +1,3 @@ -require 'rails/version' - -if ['--version', '-v'].include?(ARGV.first) - puts "Rails #{Rails::VERSION::STRING}" - exit(0) -end - -if ARGV.first != "new" - ARGV[0] = "--help" -else - ARGV.shift - unless ARGV.delete("--no-rc") - customrc = ARGV.index{ |x| x.include?("--rc=") } - railsrc = if customrc - File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, "")) - else - File.join(File.expand_path("~"), '.railsrc') - end - if File.exist?(railsrc) - extra_args_string = File.read(railsrc) - extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten - puts "Using #{extra_args.join(" ")} from #{railsrc}" - ARGV.insert(1, *extra_args) - end - end -end - require 'rails/generators' require 'rails/generators/rails/app/app_generator' @@ -40,4 +13,5 @@ module Rails end end +Rails::Generators::AppPreparer.new(ARGV).prepare! Rails::Generators::AppGenerator.start |