From: Mike Dalessio Date: Sat, 6 Oct 2007 17:29:49 +0000 (-0400) Subject: instaweb: support for Ruby's WEBrick server X-Git-Tag: v1.5.4-rc0~371 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=425b78e886e80f3c9f845edebfb199719a8f2d87;p=git.git instaweb: support for Ruby's WEBrick server running the webrick server with git requires Ruby and Ruby's YAML and Webrick libraries (both of which come standard with Ruby). nice for single-user standalone invocations. the --httpd=webrick option generates a ruby script on the fly to read httpd.conf options and invoke the web server via library call. this script is placed in the .git/gitweb directory. it also generates a shell script in a feeble attempt to invoke ruby in a portable manner, which assumes that 'ruby' is in the user's $PATH. Signed-off-by: Mike Dalessio Signed-off-by: Lars Hjemli Signed-off-by: Shawn O. Pearce --- diff --git a/Documentation/git-instaweb.txt b/Documentation/git-instaweb.txt index cec60ee78..735008c1a 100644 --- a/Documentation/git-instaweb.txt +++ b/Documentation/git-instaweb.txt @@ -27,7 +27,7 @@ OPTIONS The HTTP daemon command-line that will be executed. Command-line options may be specified here, and the configuration file will be added at the end of the command-line. - Currently, lighttpd and apache2 are the only supported servers. + Currently lighttpd, apache2 and webrick are supported. (Default: lighttpd) -m|--module-path:: diff --git a/git-instaweb.sh b/git-instaweb.sh index 8eb7f3ed1..2e4eeccac 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -139,6 +139,43 @@ GIT_DIR="$fqgitdir" export GIT_EXEC_PATH GIT_DIR +webrick_conf () { + # generate a standalone server script in $fqgitdir/gitweb. + cat >"$fqgitdir/gitweb/$httpd.rb" <"$fqgitdir/gitweb/$httpd" <"$conf" <> "$conf" +} + lighttpd_conf () { cat > "$conf" <