Skip to content

Commit

Permalink
This is valid Cron syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed May 28, 2016
1 parent 0fdff7e commit 9e22b01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/whenever/cron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Whenever
module Output
class Cron
KEYWORDS = [:reboot, :yearly, :annually, :monthly, :weekly, :daily, :midnight, :hourly]
REGEX = /^(@(#{KEYWORDS.join '|'})|(([\d\/,\-]+|\*)\s*){5})$/
REGEX = /^(@(#{KEYWORDS.join '|'})|((\*?[\d\/,\-]*)\s*){5})$/

attr_accessor :time, :task

Expand Down
2 changes: 1 addition & 1 deletion test/unit/cron_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class CronParseRawTest < Whenever::TestCase
end

should "return the same cron sytax" do
crons = ['0 0 27-31 * *', '* * * * *', '2/3 1,9,22 11-26 1-6 *',
crons = ['0 0 27-31 * *', '* * * * *', '2/3 1,9,22 11-26 1-6 *', '*/5 6-23 * * *',
"*\t*\t*\t*\t*",
'@reboot', '@yearly', '@annually', '@monthly', '@weekly',
'@daily', '@midnight', '@hourly']
Expand Down

0 comments on commit 9e22b01

Please sign in to comment.