Skip to content

Commit

Permalink
Send 'rails runner' help message to stdout instead of stderr.
Browse files Browse the repository at this point in the history
[#5661 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information
rohitarondekar authored and spastorino committed Sep 19, 2010
1 parent 164e3b6 commit 68034ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion railties/lib/rails/commands/runner.rb
Expand Up @@ -17,7 +17,7 @@
opts.separator ""

opts.on("-h", "--help",
"Show this help message.") { $stderr.puts opts; exit }
"Show this help message.") { $stdout.puts opts; exit }

if RbConfig::CONFIG['host_os'] !~ /mswin|mingw/
opts.separator ""
Expand Down
4 changes: 4 additions & 0 deletions railties/test/application/runner_test.rb
Expand Up @@ -18,6 +18,10 @@ def self.count
MODEL
end

def test_should_include_runner_in_shebang_line_in_help
assert_match "/rails runner", Dir.chdir(app_path) { `bundle exec rails runner --help` }
end

def test_should_run_ruby_statement
assert_match "42", Dir.chdir(app_path) { `bundle exec rails runner "puts User.count"` }
end
Expand Down

0 comments on commit 68034ef

Please sign in to comment.