On 3 April 2016 at 12:52, Sam Ruby <ru...@intertwingly.net> wrote: > On Sat, Apr 2, 2016 at 10:10 PM, Sebastian Bazley <s...@apache.org> wrote: >> Commit 5a59778cec543ef7de0f9ea8bd501827836a082c: >> Initial draft of mirror checking page >> >> >> Branch: refs/heads/master >> Author: Sebb <s...@apache.org> >> Committer: Sebb <s...@apache.org> >> Pusher: sebb <s...@apache.org> >> >> ------------------------------------------------------------ >> tools/mirror_check.rb | +++++++++++ >> www/members/mirror_check.cgi | +++ >> ------------------------------------------------------------ >> 344 changes: 344 additions, 0 deletions. >> ------------------------------------------------------------ >> >> >> diff --git a/tools/mirror_check.rb b/tools/mirror_check.rb >> new file mode 100755 >> index 0000000..5fd443b > > [snip] > >> + >> +# Are we really running under a shell? >> +if __FILE__ == $0 and ENV['SHELL'] and ! ENV['REQUEST_METHOD'] > > As an alternative to checking ENV, consider moving the html view code > (_html below and methods like display above) to the cgi.
Unfortunately Eclipse Ruby editor does not display the code outline if the script is not named .rb. Nor can one run it except as a server app. The highlighting still works. So perhaps worth trying as the HTML part is not shown in outline anyway. > [snip] > >> +print "Status: 200 OK\r\n" > > Probably not a good idea; Wunderbar will output a status line if there > is a failure; I'm not sure how CGI servers handle having mutliple > status lines. This is taken from mlreq.cgi which I used as the basis ... I'll fix the Whimsy script. > - Sam Ruby