From: mike@csa.net Date: Sat, 06 Oct 2007 17:29:49 GMT Subject: [PATCH 2/2] instaweb: support for Ruby's WEBrick server Message-ID: <1191691789249-git-send-email-mike@csa.net> In-Reply-To: <11916917892652-git-send-email-mike@csa.net> 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 --- Documentation/git-instaweb.txt | 2 +- git-instaweb.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletions(-) diff --git a/Documentation/git-instaweb.txt b/Documentation/git-instaweb.txt index cec60ee..735008c 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 42d9c34..859be4a 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" <