summaryrefslogtreecommitdiff
path: root/lognotify.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-09-28 23:49:11 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-09-28 23:49:11 -0700
commit09b2bb28fb799668fa54a0a6b3b3ecffe7b6376b (patch)
tree400f3a76e84de2fb1bfaa005713f121e8ccac4bc /lognotify.rb
parent07027c0dc9ecad7b40d10f166a42261c335c777d (diff)
downloadlognotify-09b2bb28fb799668fa54a0a6b3b3ecffe7b6376b.tar.gz
lognotify-09b2bb28fb799668fa54a0a6b3b3ecffe7b6376b.tar.xz
Use a block-style statement when counting lines.
Diffstat (limited to 'lognotify.rb')
-rwxr-xr-xlognotify.rb4
1 files changed, 3 insertions, 1 deletions
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.