Created
October 10, 2012 05:03
-
-
Save compwron/3863263 to your computer and use it in GitHub Desktop.
finder for dead spring beans in a java codebase; if the usage is 0 or 1, it's probably dead.
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
`grep "bean id=" resources/*.xml`.split("\n").map{ |raw_bean| | |
raw_bean.split('"') | |
}.map {|bean_pieces| | |
bean_pieces[1] | |
}.map {|bean_name| | |
num = `find ./ -iname "*.java" -exec grep #{bean_name} '{}' \\; | wc -l` | |
puts "#{bean_name} #{num}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment