Created
October 21, 2014 18:43
-
-
Save jonespm/cf87b61c4c117063e224 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env ruby | |
# Run like | |
# mvn com.ning.maven.plugins:maven-duplicate-finder-plugin:1.0.9:check > duplicates.txt | |
# cat duplicates.txt| ./duplicateparse.rb > parsedoutput.txt | |
tool="" | |
toolh=Hash.new | |
ARGF.each do |line| | |
#print line without the new line if line does not contain /--+/ | |
if (line =~ /\[INFO\] Building (.*)/) | |
#New tool | |
tool=Regexp.last_match(1) | |
toolh[tool] = Hash.new | |
end | |
if (line =~/\[WARNING\] Found duplicate/) | |
toolh[tool][line] = 1 | |
end | |
end | |
toolh.each do |hash,key| | |
if !key.empty? | |
puts hash | |
key.each do |h,k| | |
puts "\t#{h}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment