Last active
July 18, 2020 10:28
-
-
Save ernie/3c4a92dc507f373ce9fd to your computer and use it in GitHub Desktop.
Here's a little something to run in your Rails app's directory
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
#!/bin/sh | |
echo $( | |
find app/controllers -path app/controllers/concerns -prune -o -type f | wc -l | |
) / $(( | |
$(egrep -r -l '<\s*ActiveRecord::Base' app/models | wc -l) | |
+ $( | |
( | |
[ -d app/models/concerns ] && | |
find app/models/concerns -type f | wc -l | |
) || echo 0 | |
) | |
+ $( | |
( | |
[ -d app/controllers/concerns ] && | |
find app/controllers/concerns -type f | wc -l | |
) || echo 0 | |
) | |
)) | bc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment