Skip to content

Commit

Permalink
fix unclosed identifier bug. javan#119
Browse files Browse the repository at this point in the history
  • Loading branch information
javan committed Mar 9, 2011
1 parent 8ef9e26 commit 96fc6eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
4 changes: 2 additions & 2 deletions lib/whenever/command_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def write_crontab(contents)

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
Expand Down
2 changes: 1 addition & 1 deletion lib/whenever/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Whenever
VERSION = '0.6.5'
VERSION = '0.6.6'
end

0 comments on commit 96fc6eb

Please sign in to comment.