floraison / fugit

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

Fugit::Nat.parse with multi: :fail returns an array #28

Closed shaicoleman closed 4 years ago

shaicoleman commented 4 years ago

When specifying multi: :fail, the expected behaviour is not to return an array

puts Fugit::Nat.parse('every 1 hour').inspect
#<Fugit::Cron:0x0000560b30bce300 @original="0 * * * *", @cron_s=nil, @seconds=[0], @minutes=[0], @hours=nil, @monthdays=nil, @months=nil, @weekdays=nil, @zone=nil, @timezone=nil>

puts Fugit::Nat.parse('every 1 hour', multi: :fail).inspect
[#<Fugit::Cron:0x0000560b30c028a8 @original="0 * * * *", @cron_s=nil, @seconds=[0], @minutes=[0], @hours=nil, @monthdays=nil, @months=nil, @weekdays=nil, @zone=nil, @timezone=nil>]

Thanks again for everything

jmettraux commented 4 years ago

Oh, excellent! Thanks, I will fix that.

jmettraux commented 4 years ago

Closing. Please tell me if there is anything wrong with the fix. Thanks again!