Last active
June 4, 2018 19:04
-
-
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
This file contains 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 | |
# 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