Skip to content

Instantly share code, notes, and snippets.

@bak
Created October 6, 2009 04:33
Show Gist options
  • Save bak/202768 to your computer and use it in GitHub Desktop.
Save bak/202768 to your computer and use it in GitHub Desktop.
#
# Start a WEBrick server in the cwd (serves html, rhtml, assets)
#
# Usage:
# webrick_on
# webrick_on 8000
#
function webrick_on
{
ruby -e "require 'webrick';include WEBrick;s = HTTPServer.new(:Port => ${@:-9090},:DocumentRoot => Dir::pwd);trap('INT'){s.shutdown};s.start"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment