git-merge-pr is now released as a gem:

https://github.com/parkr/git-merge-pr