diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/rack/log_tailer.rb | 7 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 2 |
2 files changed, 3 insertions, 6 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 diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 21725a380c..08cfb585f9 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -114,7 +114,7 @@ class AppGeneratorTest < Rails::Generators::TestCase Rails.application.config.root = app_moved_root Rails.application.class.stubs(:name).returns("Myapp") - Rails.application.stubs(:instance_of?).returns(Rails::Application) + Rails.application.stubs(:is_a?).returns(Rails::Application) FileUtils.mv(app_root, app_moved_root) |