floraison / fugit

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

Problem parsing 'every day at 8:30' #42

Closed jeromedalbert closed 3 years ago

jeromedalbert commented 3 years ago

Issue description

How to reproduce

require 'fugit'

Fugit::Nat.parse('every day at 8:30')&.to_cron_s
#=> nil

Fugit::Nat.parse('every day at 8:30 pm')&.to_cron_s
#=> nil

Fugit::Nat.parse('every day at 08:30 pm')&.to_cron_s
#=> nil

Expected behaviour

require 'fugit'

Fugit::Nat.parse('every day at 8:30')&.to_cron_s
#=> "30 8 * * *"

Fugit::Nat.parse('every day at 8:30 pm')&.to_cron_s
#=> "30 20 * * *"

Fugit::Nat.parse('every day at 08:30 pm')&.to_cron_s
#=> "30 20 * * *"

Context

Darwin Jeromes-2017-MBP.local 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul  5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
(secs:1596594797.9150012,utc~:"2020-08-05 02:33:17.9150011539459229",ltz~:"PDT")
(etz:nil,tnz:"PDT",tziv:"2.0.2",tzidv:nil,rv:"2.7.1",rp:"x86_64-darwin19",win:false,rorv:nil,astz:nil,eov:"1.2.4",eotnz:#<TZInfo::TimezoneProxy: America/Ensenada>,eotnfz:"-0700",eotlzn:"America/Ensenada",eotnfZ:"PDT",debian:nil,centos:nil,osx:"zoneinfo/America/Los_Angeles")
jmettraux commented 3 years ago

Hello, I think I fixed it. Tell me if you need a 1.3.8 release. Merci beaucoup et meilleures salutations!

jeromedalbert commented 3 years ago

Super, j'ai vérifié tous mes cas d'utilisation et tout devrait marcher maintenant, so if you can cut a 1.3.8 release that would be perfect. I shouldn't have anything more to report in the near future. Thanks again

jmettraux commented 3 years ago

Hello, I've just pushed 1.3.8 to https://rubygems.org/gems/fugit It should be available soon.

Merci encore !