Skip to content

Instantly share code, notes, and snippets.

@MadBomber
Last active September 27, 2015 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MadBomber/1317690 to your computer and use it in GitHub Desktop.
Save MadBomber/1317690 to your computer and use it in GitHub Desktop.
A Tool to List GEM Summaries
#!/bin/env ruby
############################################################################
## summarize_all_gems.rb
class NilClass
def split(*args)
[" "]
end
def strip
""
end
end
desc_start_col = 30
Gem::Specification.all.each do |gs|
print "#{gs.name} "
spacer_cnt = desc_start_col - gs.name.length
spacer_cnt = 1 if spacer_cnt <= 0
print " "*spacer_cnt
puts gs.summary.split("\n").first.strip
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment