From 5aea0952e7cb445e614652e3cd9aba71a836eed0 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sun, 20 Nov 2016 16:02:39 +0100 Subject: Pass `rails runner` args onto file again. When making the new command insfrastructure I had missed that `bin/rails runner some_file.rb some args` would pass the extra args onto the file in `ARGV`. Now fixed by allowing the command to take extra args again, and make sure to remove the file name from `ARGV`. --- railties/lib/rails/commands/runner/runner_command.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails/commands/runner/runner_command.rb') diff --git a/railties/lib/rails/commands/runner/runner_command.rb b/railties/lib/rails/commands/runner/runner_command.rb index 27666c76b7..4989a7837d 100644 --- a/railties/lib/rails/commands/runner/runner_command.rb +++ b/railties/lib/rails/commands/runner/runner_command.rb @@ -14,7 +14,7 @@ module Rails "#{super} [<'Some.ruby(code)'> | ]" end - def perform(code_or_file = nil) + def perform(code_or_file = nil, *file_argv) unless code_or_file help exit 1 @@ -27,6 +27,7 @@ module Rails if File.exist?(code_or_file) $0 = code_or_file + ARGV.replace(file_argv) Kernel.load code_or_file else begin -- cgit v1.2.3