Skip to content

Instantly share code, notes, and snippets.

@dkoprov
Created April 19, 2012 16:24
Show Gist options
  • Select an option

  • Save dkoprov/2422108 to your computer and use it in GitHub Desktop.

Select an option

Save dkoprov/2422108 to your computer and use it in GitHub Desktop.
Counts usages of the classes in the project
# stolen from the destroyallsoftware screencast
find app lib -iname '*.rb' | xargs grep -h '^[[:space:]]*class\|module\b' | sed 's/^[[:space:]]*//' | cut -d ' ' -f 2 | while read class; do echo `grep -rl "\b$class\b" app lib --include '*.rb' | wc -l` $class ; done | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment