Skip to content

Instantly share code, notes, and snippets.

@davidrupp
Created February 25, 2012 20:34
Show Gist options
  • Save davidrupp/1910463 to your computer and use it in GitHub Desktop.
Save davidrupp/1910463 to your computer and use it in GitHub Desktop.
Open a gem's installed source code in emacs.
#!/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