Skip to content

Instantly share code, notes, and snippets.

@deevis
Last active December 19, 2015 18:58
Show Gist options
  • Save deevis/6002077 to your computer and use it in GitHub Desktop.
Save deevis/6002077 to your computer and use it in GitHub Desktop.
Print out all Gems and their descriptions
require 'prawn'
Prawn::Document.generate("gems.pdf") do
`bundle list`.split("\n")[1..-1].map{|s| s.gsub(" * ","")}.each do |g|
puts g
text "\n\n<b>#{g}</b>", inline_format: true
text "---------------------------"
s = `gem specification #{g.split.first}` rescue ""
description = s.scan( /.*\ndescription: (.*)\nemail.*/m ).last.first rescue nil
if !description || description.empty?
description = s.scan( /.*\nsummary: (.*)\ntest.*/m ).last.first rescue ""
end
text description
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment