Skip to content

Instantly share code, notes, and snippets.

@GPrimola
Created June 19, 2018 20:53
Show Gist options
  • Select an option

  • Save GPrimola/086683bd53d204706e23efdb1cc75291 to your computer and use it in GitHub Desktop.

Select an option

Save GPrimola/086683bd53d204706e23efdb1cc75291 to your computer and use it in GitHub Desktop.
Class usage in a Ruby project
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 | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment