Can bundler show me which gems in Gemfile have new

2019-01-22 01:45发布

Is there a way to run bundle update in pretend mode, similar to the -p (pretend) flag for Rails generators or cap's -n (dry-run) flag?

I'm imagining something like:

$> bundle update -p
Fetching source index for http://rubygems.org/
The following gems have updated versions:
...
list of gems
...

标签: ruby bundler
3条回答
三岁会撩人
2楼-- · 2019-01-22 01:59
$ bundle update
$ git diff Gemfile.lock
$ git checkout Gemfile.lock
查看更多
仙女界的扛把子
3楼-- · 2019-01-22 02:10

I was looking specifically for how to only show the outdated gems that are in my gemfile. Looks like this does it: bundle outdated --only-explicit

That will 'Only list gems specified in your Gemfile, not their dependencies'

Source: https://bundler.io/man/bundle-outdated.1.html

Hopefully this is helpful for someone else.

查看更多
Bombasti
4楼-- · 2019-01-22 02:12

Bundler 1.1 introduced a new 'outdated' feature, which is exactly what I was looking for. Pat Shaughnessy has a great write-up on the new features. In his words, bundle outdated:

displays the gems it would download and install, but without actually doing it. This gives me the freedom to inspect the list and update just the gems I would like to.

This should make it a snap to see what gems are due for an update without actually modifying your source and local gems. Thanks Bundler!

查看更多
登录 后发表回答