Forum: IronRuby Code Review: ironruby-rack

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E1deaac6561498a0e7472e6268ea9ccc?d=identicon&s=25 Jimmy Schementi (Guest)
on 2009-05-15 04:54
(Received via mailing list)
http://github.com/jschementi/ironruby/tree/f57b6ad...

ironruby-rack: Run Rack-based web applications on IIS with IronRuby
What it is:
http://blog.jimmy.schementi.com/2009/05/ironruby-a...

Uses ASP.NET's HttpHandlers to:

·         Registering IronRuby.Rack in the Rack-based application's
Web.config<http://github.com/jschementi/ironruby/blob/92932a6...

·         Load a Rack<http://rack.rubyforge.org/>-based application on
startup
(HttpHandlerFactory<http://github.com/jschementi/ironruby/blob/92932a6...
and
Application<http://github.com/jschementi/ironruby/blob/92932a6...
constructor).

o   Initializes Rack and runs the application's
config.ru<http://github.com/jschementi/ironruby/blob/92932a6...,
which tells Rack what application (any Ruby object that responds to
"call")

·         Intercept web requests
(HttpHandler.ProcessRequest<http://github.com/jschementi/ironruby/blob/92932a6...)

o   Creates a
Request<http://github.com/jschementi/ironruby/blob/92932a6...
and a
Response<http://github.com/jschementi/ironruby/blob/92932a6...,
and passes it off to
IIS.Handle<http://github.com/jschementi/ironruby/blob/92932a6...
which:

§  Set up the environment according to the Rack
specification<http://rack.rubyforge.org/doc/SPEC.html>

§  Calls
Application.Call<http://github.com/jschementi/ironruby/blob/92932a6...
with the prepared environment, which delegates to the Rack application's
"call" method (registered in the config.ru file). All C# <-> Ruby
interaction happens in the
RubyEngine<http://github.com/jschementi/ironruby/blob/92932a6...

§  Rack application does its thing (process Rails/Sinatra request, or
deal with things
itself<http://github.com/jschementi/ironruby/blob/92932a6...)
and returns a response according to the Rack
specification<http://rack.rubyforge.org/doc/SPEC.html>

§  Takes the Rack response and pass the appropriate data to the IIS
response (response body, status, headers)
This topic is locked and can not be replied to.