javan / javan/whenever

Define custom job class from another gem

Open
#569 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Ruby
Stars
8.9k
Forks
715
PR merge metrics
No merged PRs in 30d

Description

I'm using Rollbar for error tracking and they have a wrapper for the rails runner command which I would like to use via Whenever. Right now I define my own job type in schedule.rb:

job_type :rollbar_runner, "cd :path && :environment_variable=:environment bundle exec rollbar-rails-runner :task --silent :output"

It would be great if the Rollbar gem could detect whether Whenever is present on load and define this job type itself. I tried to get it to work with Whenever::JobList.singleton_class but wasn't successful.

Would this be possible/advisable?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the custom job_type in schedule.rb and the attempted Whenever::JobList.singleton_class integration. Inspect how Whenever defines and loads job types, then consider whether the Rollbar rails runner command can be registered without requiring an unsafe gem coupling. Done means a supported integration path or a documented reason it is not advisable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.