Print information about .railsrc to users

This commit is contained in:
Guillermo Iguaran 2011-10-02 01:06:39 -05:00
parent 7039def6e1
commit 101fb42106
2 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,7 @@ else
if File.exist?(railsrc) if File.exist?(railsrc)
extra_args_string = File.open(railsrc).read extra_args_string = File.open(railsrc).read
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
puts "Using #{extra_args.join(" ")} from #{railsrc}"
ARGV << extra_args ARGV << extra_args
ARGV.flatten! ARGV.flatten!
end end

View File

@ -2,6 +2,12 @@ Description:
The 'rails new' command creates a new Rails application with a default The 'rails new' command creates a new Rails application with a default
directory structure and configuration at the path you specify. 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: Example:
rails new ~/Code/Ruby/weblog rails new ~/Code/Ruby/weblog