From 09b2bb28fb799668fa54a0a6b3b3ecffe7b6376b Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Tue, 28 Sep 2010 23:49:11 -0700 Subject: Use a block-style statement when counting lines. --- lognotify.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lognotify.rb') diff --git a/lognotify.rb b/lognotify.rb index 0ed0538..8ab9aa9 100755 --- a/lognotify.rb +++ b/lognotify.rb @@ -66,7 +66,9 @@ end # Count lines in cached log. def count_lines identifier - return File.open(identifier.to_cache_path).readlines.length + File.open(identifier.to_cache_path) do |file| + return file.readlines.length + end end # Retrieve new lines via SSH. -- cgit v1.2.3-70-g09d2