- Invoking without specifying a Clockfile was broken when one of the flags was implemented. This is fixed now.
- The way the rails app reloader is implemented is now compatible with both rails 6 and 7
- RUBY_CLOCK_SHUTDOWN_WAIT_SECONDS value is logged when starting
- DSL methods are now at the top-level namespace (
schedule.every
→every
,schedule.cron
→cron
) - Around callbacks now have a top-level namespace method.
def schedule.around_trigger
→around_action do
- Multiple around callbacks can be consecutively assigned - no need to put all behavior into one method
- Error handler definition is now at the top-level namespace (
def schedule.on_error
→on_error do
) - Errors encountered when loading Clockfile (such as incorrect cron syntax) will be reported to the error handler
- The automatic identifier generator will now ignore
}
andend
lines - posix-spawn is no longer used. In ruby
32.2, nativeProcess.spawn
is more performant. See posix-spawn#90 and terrapin#19 for more info. - ability to load multiple clockfiles with one invocation
- job slugs based on job identifier, e.g. "Widget Co. Weekly Reports" -> "widget-co-weekly-reports"
--check-slug-uniqueness
--environment-and-syntax-check
--generate-dummy-crontab
to facilitate visualization with cronv
- ruby 3.0 is now the minimum version
- The code which implements the rails reloader/executor is now less complicated
- Code reorganization so there are no unnecessary methods in top-level
Kernel
namespace - top-level DSL methods are now implemented with refinements, so they don't polute other code
-
The minimum ruby version is 3.0
-
The top of every Clockfile must begin with
using RubyClock::DSL
-
If you have an existing
def schedule.around_trigger
, you will need to change it to use the newaround_action
method. -
Your existing Clockfile with
schedule.foo
invocations will still work, but you now have the option to useevery
,cron
, andon_error
at the top-level, without referencingschedule
. -
You now have the option of catching and reporting errors encountered when parsing the Clockfile.
-
remove the
posix-spawn
gem from your project -
There is no longer a need to have a binstub in rails. You can delete bin/clock from your app.
-
The invocations (in Procfile, or wherever else you start ruby-clock) should change from
bundle exec rails runner bin/clock
to
bundle exec clock
- make terrapin and posix-spawn gems optional
- fix detection of Rails constant, for non-rails apps
- automatically wrap jobs with rails reloader
- ability to run rake tasks
- ability to run shell commands
- nicer shutdown logging, indicating when shutdown process begins and ends
- fix approach for error fallbacks when when calculating job identifier (probably never encountered)
- ability to specify the name of the file with job definitions, e.g.
bundle exec clock clocks/MyClockfile
- ability to specify the amount of time ruby-clock will wait before forcing threads to shut down
- job identifiers