Last active
August 29, 2015 13:58
-
-
Save dguzzo/10016670 to your computer and use it in GitHub Desktop.
easily open gem source directory in Textmate
This file contains hidden or 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
# change "bundler" to the name of any installed gem (run 'gem list' to see which gems are installed.) | |
# change "mate" to any prefered program that can open a directory. 'open' will open the file tree in Finder on OSX, for instance. | |
# the regex basically strips off the "/lib/<gem-name>.rb" from the "gem which" output. | |
gem which bundler | sed "s/\(.*\)\(.*\/.*\/.*\.rb\)$/\1/" | xargs mate | |
# alternate way | |
gem which bundler | ruby -e "puts gets.match(/(.*)\/lib\/.*/)[1]" | xargs mate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment