Skip to content

Instantly share code, notes, and snippets.

@kristjan
Created January 25, 2011 02:09
Show Gist options
  • Save kristjan/794397 to your computer and use it in GitHub Desktop.
Save kristjan/794397 to your computer and use it in GitHub Desktop.
Poor man's smart autotest
export FILE=file/to/test.rb
export MOD=$(stat -c %Y $FILE | cut -d ' ' -f1)
while sleep .1
do
NEWMOD=$(stat -c %Y $FILE | cut -d ' ' -f1)
if [ $NEWMOD -gt $MOD ]
then
echo Changed $MOD $NEWMOD
export MOD=$NEWMOD
ruby $FILE
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment