From 15a3af8484a7a35c450637e657fa8185e93634dc Mon Sep 17 00:00:00 2001 From: John Mettraux Date: Wed, 25 Oct 2023 18:24:48 +0900 Subject: [PATCH] Add `the second extension` section to readme closes gh-91 --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 821dcb4..b8d8673 100644 --- a/README.md +++ b/README.md @@ -268,6 +268,18 @@ c.match?('2019-01-08') # => false, since (rweek + 1) % 2 == 1 `tue%x+y` matches if Tuesday and `current_date.rweek + y % x == 0` +### the second extension + +Fugit accepts cron strings with five elements, `minute hour day-of-month month day-of-week`, the standard cron format or six elements `second minute hour day-of-month month day-of-week`. + +```ruby +c = Fugit.parse('* * * * *') # every minute +c = Fugit.parse('5 * * * *') # every hour at minute 5 +c = Fugit.parse('* * * * * *') # every second +c = Fugit.parse('5 * * * * *') # every minute at second 5 +``` + + ## `Fugit::Duration` A class `Fugit::Duration` to parse duration strings (vanilla [rufus-scheduler](https://github.com/jmettraux/rufus-scheduler) ones and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) ones).