fix unclosed identifier bug. #119

This commit is contained in:
Javan Makhmali 2011-03-08 19:47:43 -06:00
parent 8ef9e26109
commit 96fc6eb4dc
3 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
### 0.6.6 / March 8th, 2011
* Fix unclosed identifier bug. #119 [Javan Makhmali]
### 0.6.5 / March 8th, 2011
* Preserve whitespace at the end of crontab file. #95 [Rich Meyers]

View File

@ -89,10 +89,10 @@ module Whenever
def updated_crontab
# Check for unopened or unclosed identifier blocks
if read_crontab =~ Regexp.new("^#{comment_open}$") && (read_crontab =~ Regexp.new("^#{comment_close}$")).nil?
if read_crontab =~ Regexp.new("^#{comment_open}$") && (read_crontab =~ Regexp.new("^#{comment_close}")).nil?
warn "[fail] Unclosed indentifier; Your crontab file contains '#{comment_open}', but no '#{comment_close}'"
exit(1)
elsif (read_crontab =~ Regexp.new("^#{comment_open}$")).nil? && read_crontab =~ Regexp.new("^#{comment_close}$")
elsif (read_crontab =~ Regexp.new("^#{comment_open}$")).nil? && read_crontab =~ Regexp.new("^#{comment_close}")
warn "[fail] Unopened indentifier; Your crontab file contains '#{comment_close}', but no '#{comment_open}'"
exit(1)
end

View File

@ -1,3 +1,3 @@
module Whenever
VERSION = '0.6.5'
VERSION = '0.6.6'
end