Created
February 13, 2015 04:10
-
-
Save rtomayko/4701b2750e8e7b9d3a2e to your computer and use it in GitHub Desktop.
Apply a patch to a bundle installed gem (not for the faint of heart)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#/ Usage: gem-apply <gem> <patchfile | |
#/ Apply a patch to a locally installed gem. | |
#/ | |
#/ Example: | |
#/ % curl https://github.com/jekyll/jekyll/pull/3452.patch | gem-apply jekyll | |
#/ patching file lib/jekyll/commands/serve.rb | |
#/ Hunk #1 succeeded at 39 (offset -1 lines). | |
#/ Hunk #2 succeeded at 125 (offset -6 lines). | |
#/ patching file lib/jekyll/commands/serve.rb | |
#/ Hunk #1 succeeded at 39 (offset -1 lines). | |
#/ Hunk #2 succeeded at 94 (offset -5 lines). | |
#/ Hunk #3 succeeded at 140 (offset -6 lines). | |
set -e | |
# Find location of gem and apply patch. | |
gemroot=$(bundle show "$1") | |
patch -d "$gemroot" -b -p1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment