summaryrefslogtreecommitdiff
path: root/lognotify.rb
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-09-28 23:53:59 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-09-28 23:53:59 -0700
commit899ee539c5578b1f2fcbb34df2bb245ac90fbb38 (patch)
tree23d1043d7f1992e9eea92d15157f1cd441556195 /lognotify.rb
parent09b2bb28fb799668fa54a0a6b3b3ecffe7b6376b (diff)
downloadlognotify-899ee539c5578b1f2fcbb34df2bb245ac90fbb38.tar.gz
lognotify-899ee539c5578b1f2fcbb34df2bb245ac90fbb38.tar.xz
Ruby allows us to write pretty if statements.
Diffstat (limited to 'lognotify.rb')
-rwxr-xr-xlognotify.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lognotify.rb b/lognotify.rb
index 8ab9aa9..0f05bc9 100755
--- a/lognotify.rb
+++ b/lognotify.rb
@@ -74,7 +74,7 @@ end
# Retrieve new lines via SSH.
def retrieve_lines conf, lines
command = "cat #{conf[:path]}"
- command << " | sed '1,#{lines}d'" if lines > 0
+ command << " | sed '1,#{lines}d'" unless lines.zero?
return %x[ssh #{conf[:hostname]} "#{command}"]
end