Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Print a list of licenses for gems in a bundle.
require 'bundler'
require 'yaml'
def format(hash)
Hash[hash.keys.map(&:to_s).zip(hash.values)].to_yaml
end
Bundler.load.specs.each do |spec|
puts format({
name: spec.name,
summary: spec.summary,
authors: spec.authors.join(', '),
license: spec.license,
version: spec.version.to_s
})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.