mattbrictson / bundle_update_interactive

A stylish interactive mode for Bundler, inspired by `yarn upgrade-interactive`
MIT License
137 stars 3 forks source link

`--exclusively` option to limit updates by Gemfile groups #15

Closed mattbrictson closed 1 month ago

mattbrictson commented 1 month ago

This PR adds two new command line options:

--exclusively=GROUP,... takes one or more Gemfile group names. When specified, update-interactive will only consider updating gems that are used exclusively by those groups. Indirect dependencies that are shared with other Gemfile groups will not be updated. For example, given --exclusively=test, capybara is a test dependency and can be updated, but nokogiri, which is an indirect dependency used in both test and in the default group would not be allowed to update.

-D is a shortcut for --exclusively=development,test (i.e. the most common use case for this feature).

This feature allows update-interactive to be used in a way that minimizes risk: you can update a subset of your lock file and be certain that these updates will not affect production.

I've divided the PR into two main commits:

f85a352 refactors the lockfile.rb implementation and adds much more test coverage. I also moved the report test out of bundle_update_interactive_test.rb and into report_test.rb where it belongs.

93b19b4 implements the --exclusively/-D feature on top of those refactors.

Remaining work: