bundler-inject icon indicating copy to clipboard operation
bundler-inject copied to clipboard

[Feature Request] Allow config the gemfile directory instead of `bundler.d/`

Open Whirlwind opened this issue 2 years ago • 2 comments

I have some projects and they use same gemfiles, but other not. Now, the bundler-inject only search the gemfile in:

global - ~/.bundler.d/*.rb
project - $PROJECT_DIR/bundler.d/*.rb

I want to set a configuration to custom the bundler.d/, eg: ~/ios_project/gemfiles and ~/ruby_project/gemfiles.

Whirlwind avatar Mar 05 '24 04:03 Whirlwind

To solve this, we link the foreign Gemfile in our Gemfile. Example: https://github.com/ManageIQ/manageiq-api/blob/master/Gemfile#L12, though you can find this code in pretty much all the ManageIQ/manageiq-provider-* entries.

The correct link gets setup here: https://github.com/ManageIQ/manageiq-api/blob/master/bin/before_install#L16

$ cd project
$ MANAGEIQ_REPO=~/src/manageiq ./bin/setup # ln -s ~/src/manageiq spec/manageiq
$ tail -2 Gemfile

eval_gemfile(File.expand_path("spec/manageiq/Gemfile", __dir__))

It is stored in the before_install for use by travis. It has since been migrated to github actions.


not sure if git submodules or an ignored .bundler.d and a symbolic link / git checkout a single file from a common repository would work for you.

kbrock avatar Mar 05 '24 18:03 kbrock

@Whirlwind Yeah, I think eval_gemfile is more the way to go. bundler-inject is more about overriding things in existing Gemfiles, but it sounds like your request is more to completely use a different Gemfile base.

Fryguy avatar Mar 05 '24 19:03 Fryguy