aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/runner/runner_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/commands/runner/runner_command.rb')
-rw-r--r--railties/lib/rails/commands/runner/runner_command.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/runner/runner_command.rb b/railties/lib/rails/commands/runner/runner_command.rb
index 8db6da8759..4989a7837d 100644
--- a/railties/lib/rails/commands/runner/runner_command.rb
+++ b/railties/lib/rails/commands/runner/runner_command.rb
@@ -1,6 +1,6 @@
module Rails
module Command
- class RunnerCommand < Base
+ class RunnerCommand < Base # :nodoc:
class_option :environment, aliases: "-e", type: :string,
default: Rails::Command.environment.dup,
desc: "The environment for the runner to operate under (test/development/production)"
@@ -14,7 +14,7 @@ module Rails
"#{super} [<'Some.ruby(code)'> | <filename.rb>]"
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