Skip to content

Rails-Crons is a scheduler-agnostic Ruby gem for safely binding cron expressions to job enqueues or shell commands in multi-node Rails environments. It offers human-readable cron translations, distributed locking via Redis or Postgres, and an intuitive CLI — all independent of any background job system.

License

Notifications You must be signed in to change notification settings

Code-Vedas/rails_cron

⏰ RailsCron — Distributed Cron Scheduler for Rails

First release 0.1.0 is empty gem. A scheduler-agnostic, multi-node-safe cron runner for Ruby and Rails.
Designed and maintained by Codevedas Inc.

Gem CI Maintainability Code Coverage License PostgreSQL Redis


🧭 Project Structure

This repository contains the RailsCron gem and its documentation site.


/repo-root
├── .github/              # CI workflows, issue templates
├── rails_cron/           # Gem source (lib/, bin/, gemspec)
├── docs/                 # Documentation site (Jekyll + Markdown)
└── README.md             # This file

🧩 What It Does

rails_cron lets you register, schedule, and safely run recurring tasks across multiple Rails instances.
It ensures exactly-once dispatching per cron tick using distributed locks via Redis or PostgreSQL advisory locks.

It’s scheduler-agnostic — works with any background job system (ActiveJob, Sidekiq, Resque, etc.)
and provides a clean Ruby API, CLI, and Rails tasks.


📚 Documentation

Comprehensive guides are published at:

👉 https://rails-cron.codevedas.com

Section Description
Overview & Motivation Why RailsCron exists
Installation & Setup Gem setup and initializer
Usage Registering jobs, CLI, and Rake tasks
FAQ / Troubleshooting Common issues and fixes

🛠️ Local Development

1. Clone and setup

git clone https://github.com/CodevedasInc/rails-cron.git
cd rails-cron
bundle install

2. Run specs

bin/rspec-unit

3. Lint and format

bin/rubocop

4. Reek

bin/Reek

🧪 Running the Gem Locally

You can load a local version of the gem in a test Rails app:

gem build rails_cron.gemspec
gem install ./rails_cron-0.1.0.gem

Or reference it directly in another app’s Gemfile:

gem "rails_cron", path: "../rails-cron/rails_cron"

🚀 Docs Site (Jekyll)

The docs/ directory is a Jekyll site used for GitHub Pages.

Run locally

cd docs
bundle install
bundle exec jekyll serve

Then open: 👉 http://localhost:4000


⚙️ Continuous Integration

GitHub Actions workflows include:

Workflow Purpose
ci.yml Runs tests (RSpec + RuboCop) on all Ruby versions
release.yml Builds and publishes gem to RubyGems
jekyll-gh-pages.yml Builds and deploys docs to GitHub Pages

Contributing, Security, Conduct


📄 License

Released under the MIT License © 2025 Codevedas Inc. — All rights reserved.

About

Rails-Crons is a scheduler-agnostic Ruby gem for safely binding cron expressions to job enqueues or shell commands in multi-node Rails environments. It offers human-readable cron translations, distributed locking via Redis or Postgres, and an intuitive CLI — all independent of any background job system.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •