From: Eric Wong Date: Mon, 17 Sep 2007 11:55:18 GMT Subject: Re: [PATCH] instaweb: support for Ruby's WEBrick server Message-ID: <20070917115518.GA26815@soma> In-Reply-To: <618c07250709161935g333f0536q31b453bd58f2d75d@mail.gmail.com> Mike Dalessio wrote: > 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 (short!) 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. Nice. I'm in favor of adding WEBrick since it's fairly commonly installed on developer boxes and is more consistently available if available at all. Apache and lighttpd may not be compiled with some modules we need. I'm having trouble applying this patch, however. It's whitespace-mangled and using long lines doesn't help mailers much. > Signed-off-by: Mike Dalessio > --- > Documentation/git-instaweb.txt | 3 ++- > git-instaweb.sh | 29 ++++++++++++++++++++++++++++- > 2 files changed, 30 insertions(+), 2 deletions(-) > > +webrick_conf () { > + # generate a standalone server script in $fqgitdir/gitweb. > + cat > "$fqgitdir/gitweb/$httpd" < +#! /usr/bin/ruby Could we make the shebang dynamic? (capturing the output of `which ruby` maybe, or just breaking down and using /usr/bin/env ruby). The ruby binary seems to appear all over the place on the filesystem from my experience, especially with its popularity amongst OSX users. -- Eric Wong