Cgi adapter and trivial patch

Yesterday I observed a senior architect – an amazing software engineer
– evaluate Rails using a CGI adapter on shared hosting. The purpose
was to evaluate the functionality and architecture of Rails.
Performance is satisfactory for the purpose.

I think there will be some percentage of users to whom the CGI adapter
will be useful in initial evaluations. Having it work at all is a good
first step.

I’d like to fix the path translation issue as well – I think that an
example should be provided using Application.options ( which are passed
to WEBrick and should also be getting used in the MongrelAdapter ) to
control stripping SCRIPT_NAME from the incoming URI.

What I’m not sure about is which ENV variable to strip SCRIPT_NAME off
of to get URI generators working, e.g., how to get SCRIPT_NAME prepended
to the results of “redirect MyController, :foo_action”

Anyhow, here’s a trivial patch that gets the adapter to compile all —
the ‘end’ for Module Raw was missing at the end of raw/adapter/cgi.rb

What I’m not sure about is which ENV variable to strip SCRIPT_NAME off
of to get URI generators working, e.g., how to get SCRIPT_NAME prepended
to the results of “redirect MyController, :foo_action”

For URI generation it should hook into the EncodeURI module. Maybe a
hook
should be provided to more easily do this?

Anyhow, here’s a trivial patch that gets the adapter to compile all —
the ‘end’ for Module Raw was missing at the end of raw/adapter/cgi.rb

Oops, probably my bad, or something went wrong with the patching.

(ab)