Skip to content

Instantly share code, notes, and snippets.

@mattetti
Created October 1, 2013 17:33
Show Gist options
  • Select an option

  • Save mattetti/6782180 to your computer and use it in GitHub Desktop.

Select an option

Save mattetti/6782180 to your computer and use it in GitHub Desktop.
gems = []
`bundle list`.split("\n").each do |line|
gem = line[/\*\s(.*)\s\(/, 1]
gems << gem
end
`bundle exec ruby -e "puts Gem.path"`.split("\n").each do |path|
gems.each do |gem|
licenses = Dir.glob("#{path}/gems/#{gem}*/LICEN*")
if licenses.empty?
readmes = Dir.glob("#{path}/gems/#{gem}*/README*")
if !readmes.empty?
if File.read(readmes.last) =~ /MIT/i
puts "#{gem} is MIT"
end
end
else
if File.read(licenses.last) =~ /MIT/i
puts "#{gem} is MIT"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment