mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Refactor --rc option
This commit is contained in:
parent
9cb386d9d6
commit
784ed154c3
1 changed files with 1 additions and 6 deletions
|
@ -11,12 +11,7 @@ else
|
||||||
ARGV.shift
|
ARGV.shift
|
||||||
unless ARGV.delete("--no-rc")
|
unless ARGV.delete("--no-rc")
|
||||||
customrc = ARGV.index('--rc')
|
customrc = ARGV.index('--rc')
|
||||||
railsrc = if customrc
|
railsrc = customrc ? ARGV.slice!(customrc, 2).last : File.join(File.expand_path("~"), '.railsrc')
|
||||||
ARGV.delete_at(customrc)
|
|
||||||
ARGV.delete_at(customrc)
|
|
||||||
else
|
|
||||||
File.join(File.expand_path("~"), '.railsrc')
|
|
||||||
end
|
|
||||||
if File.exist?(railsrc)
|
if File.exist?(railsrc)
|
||||||
extra_args_string = File.read(railsrc)
|
extra_args_string = File.read(railsrc)
|
||||||
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
|
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
|
||||||
|
|
Loading…
Reference in a new issue