diff --git a/lib/fugit/nat.rb b/lib/fugit/nat.rb index 0b0969f..0a683b0 100644 --- a/lib/fugit/nat.rb +++ b/lib/fugit/nat.rb @@ -743,7 +743,7 @@ def parse_cron(hm, opts) c = Fugit::Cron.parse(s, opts) if opts[:strict] - restrict(a, c) + restrict(hm, c) else c end @@ -761,11 +761,11 @@ def parse_cron(hm, opts) # def restrict(a, cron) - if m = ((a[0] && a[0] != [ 0 ] && a[0][0]) || '').match(SLASH_REGEX) - return nil unless (1..60).include?(m[1].to_i) + if m = a[1].first.to_s.match(SLASH_REGEX) + return nil unless (1..60).include?(m[2].to_i) end - if m = ((a[1] && a[1][0]) || '').match(SLASH_REGEX) - return nil unless [ 1, 2, 3, 4, 5, 6, 8, 12 ].include?(m[1].to_i) + if m = a[0].first.to_s.match(SLASH_REGEX) + return nil unless [ 1, 2, 3, 4, 5, 6, 8, 12 ].include?(m[2].to_i) end cron