Created
March 31, 2015 17:55
-
-
Save ipoval/b30d4313a9af74ddc9f2 to your computer and use it in GitHub Desktop.
rails find unused libs
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
# | |
find lib/ -name "*.rb" | xargs grep -h --color -e ^class | cut -d ' ' -f 2 | sort | uniq | egrep -v "^Time" | egrep -v "^Hash" | egrep -v "^UserMailer" | while read k; do echo lib class: "$k"; grep -r -l -w -m 1 --color "$k" ./app ./config ./lib ./script --exclude-dir=*assets* | head -n 2 | wc -l | grep 1; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment