valid,invalid

関心を持てる事柄について

GitHub レポジトリを直接参照している gem を bundle update する時にシュッと gem の diff を見るための bookmarklet

Gemfile 内で gem 'rails', :git => 'git://github.com/rails/rails.git' のように GitHub レポジトリを直接参照している gem を更新するとき、bundle update 前後の diff を GitHub の compare ページで見たい。そんな時のためだけの bookmarklet

diff

https://github.com/user/repo/pull/1/files のようなページで実行すると https://github.com/another_user/gem/compare/[hash]...[hash] に遷移する。

アドホックだが気にしない...。

javascript:(function(){diff=document.querySelector("span[title='Gemfile.lock']").parentNode.parentNode.parentNode.innerText;revisions=diff.match(/[a-z0-9]{40}/g);repo=diff.match(/(https|git):\/\/.+/g)[0].split("github.com")[1].replace(".git","");url="https://github.com/"+repo+"/compare/"+revisions[0]+"..."+revisions[1];window.open(url)})();

github.com


複数のアプリケーションやバッチ間で DB を共有するために schema 定義を gem として切り出したりすると頻繁に bundle update --source [gem name] を含む、もしくはそれだけの Pull Request が作られる。

それらの review 時に目的に適った変更を含んでいるかどうか、ひと目でわかってよい。

ちょっといじれば shrinkwrap.json とか requirements.txt でも使えるのかな?