Whenever is a Ruby gem that provides a clear syntax for writing and deploying cron jobs.
Whenever solves the problem of managing cron jobs in Ruby applications by replacing raw crontab syntax with a readable Ruby DSL. Instead of editing crontab files directly, developers write job definitions in a `config/schedule.rb` file using natural language expressions. The gem converts these definitions to standard cron syntax and can deploy them to the system crontab. The tool does not automatically read or modify crontab; it generates the cron syntax and requires an explicit command to write it, giving developers control over what gets deployed.
Whenever suits Rails applications and other Ruby projects that need scheduled tasks. It works well for teams that prefer managing infrastructure through code rather than manual crontab editing, and it integrates with Capistrano for automated crontab updates during deployments. The gem ships with three built-in job types—command, runner, and rake—covering common use cases, and developers can define custom job types for specialized needs. The tool uses the Chronic gem to parse human-readable time expressions, supporting flexible scheduling syntax. It handles environment setup by running jobs with bash login shells, which helps with RVM compatibility and environment variable loading. Developers can customize email recipients for job output via the MAILTO environment variable, configure logging, and add comments to crontab entries for documentation.
The project maintains active engagement with pull requests and issues, showing responsiveness to community contributions and bug reports. Development includes regular updates to keep the tool compatible with evolving Ruby and Rails versions. The codebase remains focused on its core purpose without feature creep, and documentation is comprehensive enough to cover common customization scenarios.