提交 5af5e778 编写于 作者: J José Valim

Merge pull request #2583 from guilleiguaran/railsrc

Read extra args for 'rails new' from ~/.railsrc
......@@ -9,6 +9,14 @@
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!
end
end
require 'rubygems' if ARGV.include?("--dev")
......
......@@ -2,6 +2,12 @@ Description:
The 'rails new' command creates a new Rails application with a default
directory structure and configuration at the path you specify.
You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory.
Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.
Example:
rails new ~/Code/Ruby/weblog
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册