floraison / fugit

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

cron #previous_time loop breaker issue #18

Closed jmettraux closed 5 years ago

jmettraux commented 5 years ago

Issue description

A clear and concise description of what the issue is.

How to reproduce

require 'fugit'
c = Fugit.parse('0 9 29 feb *')
p c.previous_time

produces:

/Users/jmettraux/w/fugit/lib/fugit/cron.rb:225:in `block in previous_time': too many loops for "0 9 29 feb *" #previous_time, breaking, please fill an issue at https://git.io/fjJCQ (RuntimeError)
    from /Users/jmettraux/w/fugit/lib/fugit/cron.rb:223:in `loop'
    from /Users/jmettraux/w/fugit/lib/fugit/cron.rb:223:in `previous_time'
    from tst/iteration_count.rb:15:in `<main>'

Expected behaviour

Expected something like:

"2016-2-29 09:00:00 +09:00"

Context

111644 pollux 仁 ~/w/fugit (master) ダ uname -a
Darwin pollux.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Dec 20 21:47:19 PST 2018; root:xnu-4570.71.22~1/RELEASE_X86_64 x86_64
111752 pollux 仁 ~/w/fugit (master) ダ bundle exec ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-darwin17]
111752 pollux 仁 ~/w/fugit (master) ダ bundle exec ruby -r et-orbi -e "EtOrbi._make_info"
(secs:1553307474.76292,utc~:"2019-03-23 02:17:54.7629199028015137",ltz~:"JST")
(etz:nil,tnz:"JST",tziv:"2.0.0",tzidv:"1.2018.9",rv:"2.3.7",rp:"x86_64-darwin17",win:false,rorv:nil,astz:nil,eov:"1.1.7",eotnz:#<TZInfo::TimezoneProxy: Asia/Tokyo>,eotnfz:"+0900",eotlzn:"Asia/Tokyo",eotnfZ:"JST",debian:nil,centos:nil,osx:"zoneinfo/Asia/Tokyo")

Additional context

None.