diff options
Diffstat (limited to 'railties/lib/rails/commands/runner/runner_command.rb')
-rw-r--r-- | railties/lib/rails/commands/runner/runner_command.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/railties/lib/rails/commands/runner/runner_command.rb b/railties/lib/rails/commands/runner/runner_command.rb index 27666c76b7..056ad980b9 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) + def perform(code_or_file = nil, *file_argv) unless code_or_file help exit 1 @@ -27,6 +29,7 @@ module Rails if File.exist?(code_or_file) $0 = code_or_file + ARGV.replace(file_argv) Kernel.load code_or_file else begin |