diff options
author | Brian Lopez <seniorlopez@gmail.com> | 2010-08-09 12:43:49 -0700 |
---|---|---|
committer | Brian Lopez <seniorlopez@gmail.com> | 2010-08-09 12:43:49 -0700 |
commit | ee9c950f2fe0c7953f0a9ad6a53439da7a4e89bc (patch) | |
tree | 1b3f6a3e49be0ebacb251de0c0fc12bf64e2e596 /railties/lib/rails/rack | |
parent | d8b90114ddd2a432280d114b9fe4ef1fdb38d132 (diff) | |
parent | 7171161124a2852ee7b40c5c632ba8e092c97409 (diff) | |
download | rails-ee9c950f2fe0c7953f0a9ad6a53439da7a4e89bc.tar.gz rails-ee9c950f2fe0c7953f0a9ad6a53439da7a4e89bc.tar.bz2 rails-ee9c950f2fe0c7953f0a9ad6a53439da7a4e89bc.zip |
bringing over latest from master
Diffstat (limited to 'railties/lib/rails/rack')
-rw-r--r-- | railties/lib/rails/rack/log_tailer.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/railties/lib/rails/rack/log_tailer.rb b/railties/lib/rails/rack/log_tailer.rb index 3fa45156c3..011ac6cecc 100644 --- a/railties/lib/rails/rack/log_tailer.rb +++ b/railties/lib/rails/rack/log_tailer.rb @@ -6,7 +6,6 @@ module Rails path = Pathname.new(log || "#{File.expand_path(Rails.root)}/log/#{Rails.env}.log").cleanpath @cursor = ::File.size(path) - @last_checked = Time.now.to_f @file = ::File.open(path, 'r') end @@ -20,11 +19,9 @@ module Rails def tail! @file.seek @cursor - mod = @file.mtime.to_f - if mod > @last_checked + if !@file.eof? contents = @file.read - @last_checked = mod - @cursor += contents.size + @cursor = @file.tell $stdout.print contents end end |