Load up any Gem into editor
Create an executable script calledfind_gem:
#!/usr/bin/env ruby
require 'rubygems'
if ARGV.first
gem_path = Gem.source_index.find_name(ARGV.first).last.full_gem_path
else
gem_path = Gem.source_index.find_name('sources').last.full_gem_path.split('sources').first
end
print gem_path
Now you can load up any gem’s source into your editor:
mate `find_gem hpricot`