Bundler::Interactive
A Bundler plugin that turns updating your gems into a quick, interactive pass —
think [yarn upgrade-interactive], but for your Gemfile. Instead of guessing
which gems are behind and editing version numbers by hand, you get a list you
can walk through and pick exactly what to bump.
Installation
$ bundle plugin install bundler-interactive
Usage
From a project with a Gemfile, run:
$ bundle update-interactive
(bundle upgrade-interactive works too — it's an alias, for muscle memory
either way.)
You'll see one row per outdated gem, showing its group (development, test, …) and the versions you can move to:
Select gems and target versions to update:
* = newer version held by cooldown
❯ rake (default) 12.0.0 [12.3.3] 13.4.2
rexml (development,test) 3.4.0 [3.4.1] 3.4.4*
Each row offers up to three targets:
- current — what's installed now
- in-range — the newest version your Gemfile constraint already allows
- latest — the newest version published, even if it's beyond your constraint
Keys
| Key | Action |
|---|---|
↑ / ↓ |
move between gems |
← / → |
choose a target version for the highlighted gem |
space |
skip a gem (or restore it) |
enter |
apply your selections |
q / Ctrl-C |
cancel without changing anything |
The selected version is shown in [brackets]. By default each gem is set to its
in-range latest; gems where the only newer option is beyond your constraint
start out skipped, so pressing enter never changes your Gemfile unless you ask
it to.
When you hit enter, Bundler updates the lockfile for everything you picked. If
you chose a version that's outside the current constraint, the matching line in
your Gemfile is rewritten to allow it first.
Cooldown
If you've enabled Bundler's cooldown setting (Bundler 4.0.13+), which holds
back gem versions for a few days after release as a supply-chain safeguard,
bundle update-interactive respects it: the versions you can pick are the ones
Bundler will actually install. A version that's newer but still inside the
cooldown window is shown with an asterisk (*) so you know an update is coming
once it clears.
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/wesrich/bundler-interactive.