diff --git a/CHANGELOG.md b/CHANGELOG.md index ddc358d..06aac6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ## fugit 1.11.0 not yet released +* Revert gh-86 ban on `every 27 hours` / `* */27 * * *` for gh-103 + ## fugit 1.10.1 released 2024-02-29 diff --git a/lib/fugit/cron.rb b/lib/fugit/cron.rb index c608248..47fa294 100644 --- a/lib/fugit/cron.rb +++ b/lib/fugit/cron.rb @@ -569,7 +569,10 @@ def expand(min, max, r) sta, edn, sla = r - return false if sla && sla > max + #return false if sla && sla > max + # + # let it go, "* */24 * * *" and "* */27 * * *" are okay + # gh-86 and gh-103 edn = max if sla && edn.nil? diff --git a/spec/cron_spec.rb b/spec/cron_spec.rb index 03cac6a..4e7f483 100644 --- a/spec/cron_spec.rb +++ b/spec/cron_spec.rb @@ -1250,6 +1250,12 @@ class Fugit::Cron::TimeCursor [ '10,,20 * 1,,11,,21, * *', '10,20 * 1,11,21 * *' ], [ ',,10,,22, * * * * Asia/Omsk', '10,22 * * * * Asia/Omsk' ], + [ '* */27 * * *', '* 0 * * *' ], + [ '* */24 * * *', '* 0 * * *' ], + [ '* */23 * * *', '* 0,23 * * *' ], + # + # gh-86 and gh-103, it's dumb but still valid... + ].each { |c, e| it "parses #{c}" do @@ -1371,9 +1377,13 @@ class Fugit::Cron::TimeCursor '* * * 00 *', # #'* */17 * * *', - '* */27 * * *', + #'* */27 * * *', # # gh-86 + #'* */24 * * *', + #'* */23 * * *', + # + # gh-103 ].each do |cron| diff --git a/spec/nat_spec.rb b/spec/nat_spec.rb index 419836a..0c1c08f 100644 --- a/spec/nat_spec.rb +++ b/spec/nat_spec.rb @@ -299,8 +299,11 @@ 'nada', 'every 2 years', 'every 2 weeks', - #'every 17 hours', # by default/strict:false --> "0 */17 * * *" - 'every 27 hours', + + #'every 17 hours', + # by default/strict:false --> "0 */17 * * *" + #'every 27 hours', + # by default/strict:false --> "0 */27 * * *" ].each do |input| @@ -316,6 +319,10 @@ 'every 17 hours', + 'every 27 hours', + 'every 2 years', + 'every 2 weeks', + ].each do |input| it "rejects (returns nil) for #{input.inspect}" do @@ -347,8 +354,11 @@ 'nada', 'every 2 years', 'every 2 weeks', - #'every 17 hours', # by default/strict:false --> "0 */17 * * *" - 'every 27 hours', + + #'every 17 hours', + # by default/strict:false --> "0 */17 * * *" + #'every 27 hours', + # by default/strict:false --> "0 */27 * * *" ].each do |input|