LoginSignup
19

More than 5 years have passed since last update.

bundler-auto-updateの紹介

Last updated at Posted at 2012-12-16

こんにちは @sonots @サンフランシスコ出張中です。今回私は bundler-auto-update という gem の紹介をしてみようと思います。

bundler-auto-update とは

bundler-auto-update を使うことでシステムを壊さずに Gemfile に記述してある gem のバージョンをアップデートすることができます。

Gemfile に記述されている gem のバージョンを1つあげてテストを実施し、システムが壊れないバージョンまで gem のバージョンをあげてくれます。

使い方

gem install bundler-auto-update
bundle-auto-update -c bundle exec rspec

実行すると、gem を1つバージョンアップしてテストを実行、git に自動 commit、以降この動作を限界まで繰り返します。全部終わって git log を実行すると

$ git log
02cfb8c Auto update parallel to version 0.5.9 (16 hours ago)
ff39287 Auto update cucumber to version 1.1.0 (16 hours ago)
3502a14 Auto update cucumber to version 0.10.7 (16 hours ago)
2ff938c Auto update cucumber to version 0.9.4 (17 hours ago)
800ad84 Auto update hpricot to version 0.8.4 (17 hours ago)
5c92bf0 Auto update whenever to version 0.6.8 (17 hours ago)
d83172d Auto update addressable to version 2.2.6 (17 hours ago)
7dc3b72 Auto update fastercsv to version 1.5.4 (18 hours ago)
08ae945 Auto update compass to version 0.11.5 (19 hours ago)
fe17166 Auto update hoptoad_notifier to version 2.4.11 (20 hours ago)
5875d1a Auto update hoptoad_notifier to version 2.3.12 (21 hours ago)
4388e07 Auto update activeadmin to version 0.3.2 (21 hours ago)
4cd1d0e Auto update haml to version 3.1.3 (22 hours ago)

みたいになっていたりします。あ、もちろん Gemfile の中でバージョンを絞っている場合は、その範囲内でしかバージョンアップが働かないので、場合によっては外して実行してください。

応用

これを Jenkins に仕込んでおくと、毎日 gem のバージョンアップをチェックしてもらえたりして良いのではないでしょうか?
hub コマンドを使うなどして自動で Jenkins 氏に github に pull request を送ってもらう、なんてこともできるでしょうね。

まとめ

テストが壊れない範囲で gem のバージョンをアップデートしてくれる bundler-auto-update gem の紹介でした。
Jenkins に仕込んでおいたりすると楽しそうなので、気が向いたら是非トライしてみてください!

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19