Created
October 20, 2011 00:32
-
-
Save irohiroki/1300090 to your computer and use it in GitHub Desktop.
webrick oneliner function
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
function webrick { | |
if [ -z "$1" ] ; then | |
port=3333 | |
else | |
port=$1 | |
fi | |
ruby -rwebrick -e "WEBrick::HTTPServer.new(:DocumentRoot => './', :Port => ${port}).tap{|w| Signal.trap(:INT){w.shutdown()} }.start" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment