{"thread":{"id":"9892","subject":"Re: [PATCH] instaweb: support for Ruby's WEBrick server","startedAt":"2007-09-17T11:55:18Z","lastAt":"2007-09-17T13:55:35Z","messageCount":4,"participants":["Eric Wong","Thomas Adam","Florian Weimer","Mike Dalessio"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"53297","messageId":"20070917115518.GA26815@soma","threadId":"9892","inReplyTo":"618c07250709161935g333f0536q31b453bd58f2d75d@mail.gmail.com","subject":"Re: [PATCH] instaweb: support for Ruby's WEBrick server","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-09-17T11:55:18Z","receivedAt":"2007-09-17T11:55:18Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Mike Dalessio <mike@csa.net> wrote:\n> running the webrick server with git requires Ruby and Ruby's YAML and\n> Webrick libraries (both of which come standard with Ruby). nice for\n> single-user standalone invocations.\n> \n> the --httpd=webrick option generates a (short!) ruby script on the fly to\n> read httpd.conf options and invoke the web server via library call. this\n> script is placed in the .git/gitweb directory.\n\nNice.  I'm in favor of adding WEBrick since it's fairly commonly\ninstalled on developer boxes and is more consistently available\nif available at all.  Apache and lighttpd may not be compiled\nwith some modules we need.\n\nI'm having trouble applying this patch, however.  It's\nwhitespace-mangled and using long lines doesn't help mailers much.\n\n> Signed-off-by: Mike Dalessio <mike.dalessio@gmail.com>\n> ---\n>  Documentation/git-instaweb.txt |    3 ++-\n>  git-instaweb.sh                |   29 ++++++++++++++++++++++++++++-\n>  2 files changed, 30 insertions(+), 2 deletions(-)\n> \n> +webrick_conf () {\n> +    # generate a standalone server script in $fqgitdir/gitweb.\n> +        cat > \"$fqgitdir/gitweb/$httpd\" <<EOF\n> +#! /usr/bin/ruby\n\nCould we make the shebang dynamic? (capturing the output of `which ruby`\nmaybe, or just breaking down and using /usr/bin/env ruby).  The ruby\nbinary seems to appear all over the place on the filesystem from my\nexperience, especially with its popularity amongst OSX users.\n\n-- \nEric Wong\n"},{"id":"53298","messageId":"18071eea0709170502s397331c5j7d77aa9531f73704@mail.gmail.com","threadId":"9892","inReplyTo":"20070917115518.GA26815@soma","subject":"Re: [PATCH] instaweb: support for Ruby's WEBrick server","fromName":"Thomas Adam","fromEmail":"thomas.adam22@gmail.com","sentAt":"2007-09-17T12:02:24Z","receivedAt":"2007-09-17T12:02:24Z","isPatch":true,"sender":{"key":"thomas.adam22@gmail.com","avatar":"https://gravatar.com/avatar/137f9858bc6bfd5b2f743aefd988c81ce0cbd306248889df80e269519cfc8741?d=mp&s=160"},"body":"On 17/09/2007, Eric Wong <normalperson@yhbt.net> wrote:\n> Could we make the shebang dynamic? (capturing the output of `which ruby`\n> maybe, or just breaking down and using /usr/bin/env ruby).  The ruby\n> binary seems to appear all over the place on the filesystem from my\n> experience, especially with its popularity amongst OSX users.\n\nThis is what /usr/bin/env is useful for, but it's not that portable.\n\n-- Thomas Adam\n"},{"id":"53299","messageId":"823axd32dz.fsf@mid.bfk.de","threadId":"9892","inReplyTo":"18071eea0709170502s397331c5j7d77aa9531f73704@mail.gmail.com","subject":"Re: [PATCH] instaweb: support for Ruby's WEBrick server","fromName":"Florian Weimer","fromEmail":"fweimer@bfk.de","sentAt":"2007-09-17T12:25:12Z","receivedAt":"2007-09-17T12:25:12Z","isPatch":true,"sender":{"key":"fweimer@bfk.de","avatar":null},"body":"* Thomas Adam:\n\n> This is what /usr/bin/env is useful for, but it's not that portable.\n\nYeah, it's /bin/env exclusively on some systems. 8-(\n\n-- \nFlorian Weimer                <fweimer@bfk.de>\nBFK edv-consulting GmbH       http://www.bfk.de/\nKriegsstraße 100              tel: +49-721-96201-1\nD-76133 Karlsruhe             fax: +49-721-96201-99\n"},{"id":"53315","messageId":"618c07250709170655p649a71fdwcfaaa4d5bfcd06ff@mail.gmail.com","threadId":"9892","inReplyTo":"823axd32dz.fsf@mid.bfk.de","subject":"Re: [PATCH] instaweb: support for Ruby's WEBrick server","fromName":"Mike Dalessio","fromEmail":"mike@csa.net","sentAt":"2007-09-17T13:55:35Z","receivedAt":"2007-09-17T13:55:35Z","isPatch":true,"sender":{"key":"mike@csa.net","avatar":"https://gravatar.com/avatar/c2938a5c3b56507c507ab95ea79d8655737fa78bf1ad0ea383bf03a3858bc5f9?d=mp&s=160"},"body":"I could generate a second /bin/sh script to run\n  \"ruby .../webrick.rb\"\nThis would assume that 'ruby' was in the user's $PATH, but that seems\nlike a reasonable expectation.\n\nThe drawback is that we'd be generating TWO scripts, one ruby script\nto invoke the server, and one shell script to run the ruby\nscript. This seems a little ... circuitous.\n\nAnother idea is to hack the $httpd variable to contain a command\nstring like \"ruby .../webrick.rb\", with the drawback then being a lack\nof obviousness, since the convention is that the variable contains the\nsame command as the --httpd argument, and is named the same as\nthe <webserver>_conf() functions.\n\nOn 9/17/07, Florian Weimer <fweimer@bfk.de> wrote:\n> * Thomas Adam:\n>\n> > This is what /usr/bin/env is useful for, but it's not that portable.\n>\n> Yeah, it's /bin/env exclusively on some systems. 8-(\n>\n> --\n> Florian Weimer                <fweimer@bfk.de>\n> BFK edv-consulting GmbH       http://www.bfk.de/\n> Kriegsstraße 100              tel: +49-721-96201-1\n> D-76133 Karlsruhe             fax: +49-721-96201-99\n>\n\n\n-- \nmike dalessio\nmike@csa.net\n"}]}