lib/rails/commands/application.rb in railties-3.2.22.5 vs lib/rails/commands/application.rb in railties-4.0.0.beta1
- old
+ new
@@ -7,26 +7,31 @@
if ARGV.first != "new"
ARGV[0] = "--help"
else
ARGV.shift
- railsrc = File.join(File.expand_path("~"), ".railsrc")
- if File.exist?(railsrc)
- extra_args_string = File.open(railsrc).read
- extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
- puts "Using #{extra_args.join(" ")} from #{railsrc}"
- ARGV << extra_args
- ARGV.flatten!
+ 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 'rubygems' if ARGV.include?("--dev")
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
module Rails
module Generators
- class AppGenerator
+ class AppGenerator # :nodoc:
# 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