README.md in fugit-1.10.1 vs README.md in fugit-1.11.0
- old
+ new
@@ -32,17 +32,18 @@
* ...
### Projects using fugit
* [arask](https://github.com/Ebbe/arask) - "Automatic RAils taSKs" uses fugit to parse cron strings
-* [sidekiq-cron](https://github.com/ondrejbartas/sidekiq-cron) - recent versions of Sidekiq-Cron use fugit to parse cron strings
+* [sidekiq-cron](https://github.com/ondrejbartas/sidekiq-cron) - uses fugit to parse cron strings since version 1.0.0, it was using rufus-scheduler previously
* [rufus-scheduler](https://github.com/jmettraux/rufus-scheduler) - as seen above
* [flor](https://github.com/floraison/flor) - used in the [cron](https://github.com/floraison/flor/blob/master/doc/procedures/cron.md) procedure
* [que-scheduler](https://github.com/hlascelles/que-scheduler) - a reliable job scheduler for [que](https://github.com/chanks/que)
* [serial_scheduler](https://github.com/grosser/serial_scheduler) - ruby task scheduler without threading
* [delayed_cron_job](https://github.com/codez/delayed_cron_job) - an extension to Delayed::Job that allows you to set cron expressions for your jobs
* [GoodJob](https://github.com/bensheldon/good_job) - a multithreaded, Postgres-based, Active Job backend for Ruby on Rails
+* [Solid Queue](https://github.com/rails/solid_queue) - a DB-based queuing backend for Active Job, designed with simplicity and performance in mind
* ...
## `Fugit.parse(s)`
The simplest way to use fugit is via `Fugit.parse(s)`.
@@ -138,10 +139,12 @@
c = Fugit.parse_cron('0 12 * * mon#2')
# `#next` and `#prev` return Enumerable instances
#
+ # These two methods are available since fugit 1.10.0.
+ #
c.next(Time.parse('2024-02-16 12:00:00'))
.take(3)
.map(&:to_s)
# => [ '2024-03-11 12:00:00',
# '2024-04-08 12:00:00',
@@ -155,10 +158,12 @@
# `#within` accepts a time range and returns an array of Eo::EoTime
# instances that correspond to the occurrences of the cron within
# the time range
#
+ # This method is available since fugit 1.10.0.
+ #
c.within(Time.parse('2024-02-16 12:00')..Time.parse('2024-08-01 12:00'))
.map(&:to_s)
# => [ '2024-03-11 12:00:00',
# '2024-04-08 12:00:00',
# '2024-05-13 12:00:00',
@@ -249,10 +254,12 @@
### the hash extension
Fugit understands `0 5 * * 1#1` or `0 5 * * mon#1` as "each first Monday of the month, at 05:00".
+The hash extension can only be used in the day-of-week field.
+
```ruby
'0 5 * * 1#1' #
'0 5 * * mon#1' # the first Monday of the month at 05:00
'0 6 * * 5#4,5#5' #
@@ -270,9 +277,11 @@
```
### the modulo extension
Fugit, since 1.1.10, also understands cron strings like "`9 0 * * sun%2`" which can be read as "every other Sunday at 9am".
+
+The modulo extension can only be used in the day-of-week field.
For odd Sundays, one can write `9 0 * * sun%2+1`.
It can be combined, as in `9 0 * * sun%2,tue%3+2`