Skip to content

Instantly share code, notes, and snippets.

@nuc
Last active December 15, 2015 02:19
Show Gist options
  • Select an option

  • Save nuc/5186231 to your computer and use it in GitHub Desktop.

Select an option

Save nuc/5186231 to your computer and use it in GitHub Desktop.
Coffeescript class hierarchy graph
# You'll need:
# - brew install ack
# - brew install graphviz
echo 'digraph G {' > coffee-class-hierarchy.gv
ack -h '\s+class.*extends' ./app/assets/javascripts | sed 's/.*[[:space:]]\([[:alpha:]]*\)[[:space:]]extends[[:space:]]\([[:alpha:]]*\)$/\"\1\" -> \"\2\";/g' >> coffee-class-hierarchy.gv
echo '}' >> coffee-class-hierarchy.gv
dot -Tpdf coffee-class-hierarchy.gv > coffee-class-hierarchy.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment