a237cee6bc68f2c1226d37f63e17020712c0fed7
4 EnvironmentLog
= "#{File.expand_path(Rails.root)}/log/#{Rails.env}.log"
6 def initialize(app
, log
= nil)
9 path
= Pathname
.new(log
|| EnvironmentLog
).cleanpath
10 @cursor = ::File.size(path
)
11 @last_checked = Time
.now
.to_f
13 @file = ::File.open(path
, 'r')
17 response
= @app.call(env)
25 mod
= @file.mtime
.to_f
26 if mod
> @last_checked
29 @cursor += contents
.size
30 $stdout.print contents