javan / javan/whenever

`bundle_command` changes surprisingly when using a different Gemfile location

Open
#855 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi 👋

I had some fun yesterday debugging why my rake commands in the schedule.rb somehow yielded different results than before without having changed anything to whenever.

It turns out, the bundle_command default is determined like so:

https://github.com/javan/whenever/blob/0687268046eaede8f1369a70870e04d3c0c83897/lib/whenever/setup.rb#L26

..which is tied to:

https://github.com/javan/whenever/blob/0687268046eaede8f1369a70870e04d3c0c83897/lib/whenever.rb#L31-L33

Well. My seemingly unrelated change of the day was to move the Gemfile into a different location (say something like Gemfile-ruby33) and point the BUNDLE_GEMFILE env variable to that location. That's not too common, but the standard way to do so (see https://bundler.io/v2.5/man/bundle-config.1.html#LIST-OF-AVAILABLE-KEYS and bundle config gemfile)

I suggest to adjust Whenever#bundler? in a way that works in that scenario as well.

Thanks!

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 lib/whenever/setup.rb and lib/whenever.rb, particularly the linked lines and Whenever#bundler?. Reproduce the issue with BUNDLE_GEMFILE pointing to a differently named Gemfile, then verify that bundle_command is determined correctly for that setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.