Safely update your gem dependencies, e.g. `bundle update` but safe :)
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
test
.gitignore
Gemfile
Gemfile.lock
Gemfile.lock.old
LICENSE
README.md
Rakefile
safe-bundle-update.gemspec

README.md

safe-bundle-update

Safely update your gem dependencies, e.g. bundle update but safe :) (e.g. by running tests between each gem update).

Why?

  • It updates each gem one by one and runs any command to make sure everything works (a subset of tests for instance)
  • It saves every update as a git commit and reverts to the previous commit when the tests fails

http://doma.io/2017/02/27/the-story-behind-safe-bundle-update.html

Usage

In a git-versioned directory with a Gemfile:

safe-bundle-update [cmd ...]

For instance: safe-bundle-update "rake db:reset" "rspec spec/features" will reset the database and run features specs to make sure every gem update succeds indepedently.

Install

gem install safe-bundle-update

# or in your Gemfile

gem 'safe-bundle-update'

TODO

  • File comparaison instead of relying on git
  • Dependency tree from rubygems api (update leafs first / update top dependencies first)
  • Log report of errors for each gem

Later

  • Same for removing lines to any file (e.g. config/routes.rb, db/schema.rb, etc.)