diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-09-28 23:49:11 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-09-28 23:49:11 -0700 |
commit | 09b2bb28fb799668fa54a0a6b3b3ecffe7b6376b (patch) | |
tree | 400f3a76e84de2fb1bfaa005713f121e8ccac4bc | |
parent | 07027c0dc9ecad7b40d10f166a42261c335c777d (diff) | |
download | lognotify-09b2bb28fb799668fa54a0a6b3b3ecffe7b6376b.tar.gz lognotify-09b2bb28fb799668fa54a0a6b3b3ecffe7b6376b.tar.xz |
Use a block-style statement when counting lines.
-rwxr-xr-x | lognotify.rb | 4 |
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. |