floraison / fugit

time tools (cron, parsing, durations, ...) for Ruby, rufus-scheduler, and flor
MIT License
384 stars 34 forks source link

Tighten `Fugit.parse` #69

Closed jmettraux closed 2 years ago

jmettraux commented 2 years ago

As seen indirectly in gh-68:

Fugit.parse("0 13 * * 3#2#0")
# => => #<EtOrbi::EoTime:0x000009991c9cc9d0 ...>
Fugit::Cron.do_parse("0 13 * * 3#2#0")
# => ArgumentError (invalid cron string "0 13 * * 3#2#0")

Fugit.parse should reject "0 13 * * 3#2#0" and return nil. Fugit.do_parse should raise an error.

jmettraux commented 2 years ago

Forget it. Don't rock the boat.

require 'time'

Time.parse('0 13 * * *')
  # => 2022-04-13 00:00:00 +0900