Skip to content

Commit

Permalink
Add flush by ensure in script/runner because no flush in production m…
Browse files Browse the repository at this point in the history
…ode [#803 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information
shingara authored and josh committed Nov 22, 2008
1 parent 20d6fdd commit 2144c0f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions railties/lib/commands/runner.rb
Expand Up @@ -38,11 +38,15 @@

require RAILS_ROOT + '/config/environment'

if code_or_file.nil?
$stderr.puts "Run '#{$0} -h' for help."
exit 1
elsif File.exist?(code_or_file)
eval(File.read(code_or_file), nil, code_or_file)
else
eval(code_or_file)
begin
if code_or_file.nil?
$stderr.puts "Run '#{$0} -h' for help."
exit 1
elsif File.exist?(code_or_file)
eval(File.read(code_or_file), nil, code_or_file)
else
eval(code_or_file)
end
ensure
RAILS_DEFAULT_LOGGER.flush if RAILS_DEFAULT_LOGGER
end

1 comment on commit 2144c0f

@jdevine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just bit me with:

/home/jd/ata/vendor/rails/railties/lib/commands/runner.rb:52: undefined method `flush’ for #Logger:0×7fd5d3a82ea0 (NoMethodError)

Please sign in to comment.