前提
~/binディレクトリが存在して、パスが通っている
スクリプトを作成
$ vim ~/bin/rhttpd
スクリプトの中身
ruby -run -e httpd -- --port 8000 .
実行権限をつける
$ chmod u+x ~/bin/rhttpd
起動する
$ rhttpd
以上で、例えばhttp://localhost:8000/index.htmlにアクセスすると、プロセスを起動したディレクトリ直下にあるindex.htmlファイルが表示される。