diff options
| author | Zack Hobson | 2013-12-20 11:17:35 -0800 |
|---|---|---|
| committer | Zack Hobson | 2013-12-20 11:17:35 -0800 |
| commit | fd2bb13174bb2605fac838c666597f6f223e81dc (patch) | |
| tree | bdf8032e55d2ddd4ffafea60bbfd547942d723ac /lib | |
| parent | 33e5f975dc7690642097267ef926ff8ad06c86b7 (diff) | |
| download | hcl-fd2bb13174bb2605fac838c666597f6f223e81dc.tar.bz2 | |
log: check for a running timer.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hcl/commands.rb | 1 | ||||
| -rw-r--r-- | lib/hcl/utility.rb | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/hcl/commands.rb b/lib/hcl/commands.rb index da3b1f0..a725ad4 100644 --- a/lib/hcl/commands.rb +++ b/lib/hcl/commands.rb @@ -88,6 +88,7 @@ module HCl end def log *args + fail "There is already a timer running." if DayEntry.with_timer start *args stop end diff --git a/lib/hcl/utility.rb b/lib/hcl/utility.rb index 72b4842..fd01901 100644 --- a/lib/hcl/utility.rb +++ b/lib/hcl/utility.rb @@ -1,8 +1,8 @@ module HCl class CommandError < StandardError; end module Utility - def fail message - raise CommandError, message + def fail *message + raise CommandError, message.join(' ') end def get_task_ids ident, args |
