From 96fc6eb4dcb7e04f72afb1ae5d9f4cabc75081ba Mon Sep 17 00:00:00 2001 From: Javan Makhmali Date: Tue, 8 Mar 2011 19:47:43 -0600 Subject: [PATCH] fix unclosed identifier bug. #119 --- CHANGELOG.md | 5 +++++ lib/whenever/command_line.rb | 4 ++-- lib/whenever/version.rb | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 949df62..6836ae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/lib/whenever/command_line.rb b/lib/whenever/command_line.rb index d098f32..bf81845 100644 --- a/lib/whenever/command_line.rb +++ b/lib/whenever/command_line.rb @@ -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 diff --git a/lib/whenever/version.rb b/lib/whenever/version.rb index b4a419e..a3a537b 100644 --- a/lib/whenever/version.rb +++ b/lib/whenever/version.rb @@ -1,3 +1,3 @@ module Whenever - VERSION = '0.6.5' + VERSION = '0.6.6' end \ No newline at end of file