diff options
Diffstat (limited to 'railties/lib/rails/commands/plugin.rb')
-rw-r--r-- | railties/lib/rails/commands/plugin.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/lib/rails/commands/plugin.rb b/railties/lib/rails/commands/plugin.rb index 837fe0ec10..95bbdd4cdf 100644 --- a/railties/lib/rails/commands/plugin.rb +++ b/railties/lib/rails/commands/plugin.rb @@ -2,6 +2,20 @@ 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+/).flat_map {|l| l.split} + puts "Using #{extra_args.join(" ")} from #{railsrc}" + ARGV.insert(1, *extra_args) + end + end end require 'rails/generators' |