diff options
author | Leonel Galán <leonel@getstealz.com> | 2017-04-03 22:59:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-03 22:59:43 -0400 |
commit | 8648f289f01656b2258687126108c389127108e0 (patch) | |
tree | 1ccb15f72f00d8c30497ad4e48f203545dd3383b /railties/lib/rails/commands/runner | |
parent | 28b3582aa2cd6007c708134b911b3f360ad5d659 (diff) | |
parent | e8c33349bfabca28996ac74d344d69c7aaffec50 (diff) | |
download | rails-8648f289f01656b2258687126108c389127108e0.tar.gz rails-8648f289f01656b2258687126108c389127108e0.tar.bz2 rails-8648f289f01656b2258687126108c389127108e0.zip |
Merge branch 'master' into bug/filtered_parameters_class
Diffstat (limited to 'railties/lib/rails/commands/runner')
-rw-r--r-- | railties/lib/rails/commands/runner/runner_command.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/railties/lib/rails/commands/runner/runner_command.rb b/railties/lib/rails/commands/runner/runner_command.rb index 4989a7837d..6864a9726b 100644 --- a/railties/lib/rails/commands/runner/runner_command.rb +++ b/railties/lib/rails/commands/runner/runner_command.rb @@ -5,16 +5,18 @@ module Rails default: Rails::Command.environment.dup, desc: "The environment for the runner to operate under (test/development/production)" - def help - super - puts self.class.desc + no_commands do + def help + super + puts self.class.desc + end end def self.banner(*) "#{super} [<'Some.ruby(code)'> | <filename.rb>]" end - def perform(code_or_file = nil, *file_argv) + def perform(code_or_file = nil, *command_argv) unless code_or_file help exit 1 @@ -25,9 +27,10 @@ module Rails require_application_and_environment! Rails.application.load_runner + ARGV.replace(command_argv) + if File.exist?(code_or_file) $0 = code_or_file - ARGV.replace(file_argv) Kernel.load code_or_file else begin |