aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/runner/runner_command.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-12-29 02:18:38 -0500
committerGitHub <noreply@github.com>2016-12-29 02:18:38 -0500
commiteb6a6141a66e052deb58580448d7c0fa6aa675ba (patch)
tree0017a57044ec8e466c97cc6b7879d39caa6c1ffa /railties/lib/rails/commands/runner/runner_command.rb
parent447e1a48811fa053e8bef954376d1ad47bdb5cef (diff)
parentfcec126eaa4f835c837bc75efa78008667b2ec5b (diff)
downloadrails-eb6a6141a66e052deb58580448d7c0fa6aa675ba.tar.gz
rails-eb6a6141a66e052deb58580448d7c0fa6aa675ba.tar.bz2
rails-eb6a6141a66e052deb58580448d7c0fa6aa675ba.zip
Merge branch 'master' into clear_all_environments_log_by_default
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