Created
February 25, 2012 20:34
-
-
Save davidrupp/1910463 to your computer and use it in GitHub Desktop.
Open a gem's installed source code in emacs.
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
#!/usr/bin/env ruby | |
if ARGV.empty? | |
puts "Usage: gemmacs <name-of-gem>" | |
else | |
src = `gem which #{ARGV[0]}`.split.last | |
lib_dir = src.slice 0, src.rindex("lib") | |
`emacs -nw '#{lib_dir}'` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment