diff --git a/.gitignore b/.gitignore index 728456b5f2..0a7ed12aff 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ # Ignore Bundler files **/.bundle/bin **/.bundle/cache +**/vendor/bundle/ruby/*/bundler.lock **/vendor/bundle/ruby/*/bin **/vendor/bundle/ruby/*/build_info/ **/vendor/bundle/ruby/*/cache diff --git a/Library/Homebrew/dev-cmd/vendor-gems.rb b/Library/Homebrew/dev-cmd/vendor-gems.rb index 9f028e5dc7..9ff4e6ed52 100644 --- a/Library/Homebrew/dev-cmd/vendor-gems.rb +++ b/Library/Homebrew/dev-cmd/vendor-gems.rb @@ -18,17 +18,28 @@ module Homebrew Install and commit Homebrew's vendored gems. EOS + switch "--update", + description: "Update all vendored Gems to the latest version." + max_named 0 end end def vendor_gems - vendor_gems_args.parse + args = vendor_gems_args.parse Homebrew.install_bundler! ohai "cd #{HOMEBREW_LIBRARY_PATH}" HOMEBREW_LIBRARY_PATH.cd do + if args.update? + ohai "bundle update" + safe_system "bundle", "update" + + ohai "git add Gemfile.lock" + system "git", "add", "Gemfile.lock" + end + ohai "bundle install --standalone" safe_system "bundle", "install", "--standalone" diff --git a/docs/Manpage.md b/docs/Manpage.md index cb9af56786..8bc56518e8 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -1339,6 +1339,9 @@ If no options are passed, use `origin/master` as the start commit. Install and commit Homebrew's vendored gems. +* `--update`: + Update all vendored Gems to the latest version. + ## GLOBAL CASK OPTIONS These options are applicable to subcommands accepting a `--cask` flag and all `cask` commands. diff --git a/manpages/brew.1 b/manpages/brew.1 index 5dcb13e59f..ec68ae005e 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1851,6 +1851,10 @@ Use the commit at the specified \fIdate\fR as the start commit\. .SS "\fBvendor\-gems\fR" Install and commit Homebrew\'s vendored gems\. . +.TP +\fB\-\-update\fR +Update all vendored Gems to the latest version\. +. .SH "GLOBAL CASK OPTIONS" These options are applicable to subcommands accepting a \fB\-\-cask\fR flag and all \fBcask\fR commands\. .