Skip to content

Instantly share code, notes, and snippets.

@CrCs2O4
Last active June 4, 2018 19:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CrCs2O4/f52af1559ef1f74a4637b9d1795393ab to your computer and use it in GitHub Desktop.
Save CrCs2O4/f52af1559ef1f74a4637b9d1795393ab to your computer and use it in GitHub Desktop.
Get ruby gems homepages fo fast googling. Sometimes 'gem list' is not enough
#!/usr/bin/env ruby
# bundler exec ruby gems_homepages.rb
# based on http://stackoverflow.com/questions/5177634/list-of-installed-gems
require 'rubygems'
def local_gems
Gem::Specification.sort_by{ |g| [g.name.downcase, g.version] }.group_by{ |g| g.name }
end
puts local_gems.map{ |name, specs|
[ name,
specs.map{ |spec| spec.version.to_s }.join(','),
specs.map{ |spec| spec.homepage.to_s }.join(',')
].join(' ')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment