Created
October 1, 2013 17:33
-
-
Save mattetti/6782180 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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