Created
February 10, 2011 20:18
-
-
Save squarism/821247 to your computer and use it in GitHub Desktop.
A watchr one-liner shell script, perfect for single .rb projects
This file contains hidden or 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
#!/usr/bin/env bash | |
# wtchr shell script - @squarism | |
# INSTALL | |
# gem install watchr | |
# cp wtchr ~/bin | |
# chmod u+x ~/bin/wtchr | |
# Run with: wtchr foo.rb | |
################## | |
# Main, as it were | |
# the file passed in as argument 1 | |
FILE=$1 | |
# horrifying formatting for bash and gist | |
watchr -e "system('clear'); \ | |
puts 'Watchr is watching ${FILE}. O_o (wtchr)'; \ | |
puts '-' * 52; \ | |
watch('${FILE}') \ | |
{ system('clear'); \ | |
p=\`pwd\`.strip; \ | |
cmd = 'ruby ' << p << '/${FILE}'; \ | |
o = \`#{cmd}\`; \ | |
puts o }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment