I recently added BUNDLE_ONLY
option to Bundler.
This is the long-awaited feature from 8+ years ago that allows you to install only the gem groups you need, available from bundler 2.3.19.
- https://github.com/rubygems/bundler-features/issues/59
- https://github.com/rubygems/bundler/pull/4907
- https://github.com/rubygems/rubygems/issues/4048
- https://github.com/rubygems/rubygems/pull/5759
For example, in our Rails app, we have a crazy number of gem groups (terrible I know). There is a workflow to run RuboCop with GitHub Actions, but this workflow only requires the gems in the rubocop gem group to be installed.
# .github/workflows/rubocop.yml
env:
- BUNDLE_WITHOUT: >
- danger
- default
- development
- feature1
- feature2
- feature3
- feature4
- feature5
- feature6
- feature7
- mobile
- production
- qa
- staging1
- staging2
- staging3
- test
+ BUNDLE_ONLY: rubocop
Previously, it was necessary to use BUNDLE_WITHOUT
to exclude unwanted gem groups one by one, but now BUNDLE_ONLY
allows us to write this way 😃
Top comments (0)