Last active
August 29, 2015 14:03
-
-
Save itchyny/248ec28c432deb35f4d6 to your computer and use it in GitHub Desktop.
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
#!/bin/zsh | |
dotfile=mikutter.dot | |
outfile=mikutter.png | |
mikutterdir=../mikutter/core | |
echo "digraph mikutter {" > "$dotfile" | |
for file in $mikutterdir/*.rb; do | |
name=$(basename "$file" | sed 's/\.rb//') | |
for dependon in $(grep "^miquire :core" "$file" | sed 's/miquire.*:[a-z]*, //' | tr ',' '\n' | tr -d " '\""); do | |
echo " \"$name\" -> \"$dependon\"" >> "$dotfile" | |
done | |
done | |
echo "}" >> "$dotfile" | |
dot -Tpng "$dotfile" -o "$outfile" | |
open "$outfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment