summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZack Hobson2009-08-23 21:22:04 -0700
committerZack Hobson2009-08-23 21:22:04 -0700
commit3cb1969adcb82a81458b474c350d6045626d4ac2 (patch)
treedda7352de1d287981b06001204c6418eb3dd82a3 /lib
parentd82f777ee4e3e89cfab56afb92297a6330dd8199 (diff)
downloadhcl-3cb1969adcb82a81458b474c350d6045626d4ac2.tar.bz2
Allow start +decimal input without a dot, closes #29.
Diffstat (limited to 'lib')
-rw-r--r--lib/hcl/commands.rb2
-rw-r--r--lib/hcl/utility.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/hcl/commands.rb b/lib/hcl/commands.rb
index 5bc564f..fcf6939 100644
--- a/lib/hcl/commands.rb
+++ b/lib/hcl/commands.rb
@@ -34,7 +34,7 @@ module HCl
end
def start *args
- starting_time = args.detect {|x| x =~ /^\+\d*(\.|:)\d+$/ }
+ starting_time = args.detect {|x| x =~ /^\+\d*(\.|:)?\d+$/ }
if starting_time
args.delete(starting_time)
starting_time = time2float starting_time
diff --git a/lib/hcl/utility.rb b/lib/hcl/utility.rb
index bbd5065..7cf1bfb 100644
--- a/lib/hcl/utility.rb
+++ b/lib/hcl/utility.rb
@@ -17,7 +17,7 @@ module HCl
if time_string =~ /:/
hours, minutes = time_string.split(':')
hours.to_f + (minutes.to_f / 60.0)
- elsif time_string =~ /./
+ else
time_string.to_f
end
end