floraison / fugit

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

strip before parsing? #74

Closed jjb closed 1 year ago

jjb commented 1 year ago

Issue description

it looks like a leading space makes the parser crash. works: "45 5 * * sun" breaks: " 45 5 * * sun". could fugit be changed to simply strip the string before parsing?

How to reproduce

c = Fugit.parse(" 45 5 * * sun")

Error and error backtrace (if any)

Message: invalid cron string " 45 5 * * sun"

Expected behaviour

cron string to parse without error

Context

ruby-clock (0.8.0.rc3) rufus-scheduler (3.8.0) fugit (1.5.2) et-orbi (1.2.5) raabro (1.4.0)

jmettraux commented 1 year ago

Could fugit be changed to simply strip the string before parsing?

OK, I will do it then.

jmettraux commented 1 year ago

Hello @jjb please tell me if those changes are OK and/or if you have further suggestions/feedback. Once it's all good, I'll release fugit 1.6.0.

Thanks for reporting this inconsistency!

jjb commented 1 year ago

Wow, nice! Sorry for not responding earlier, I need to adjust my github notifications apparently.

Thanks!

jmettraux commented 1 year ago

You're welcome!