This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| .. | |||
| |
Application.cs | ||
| |
HttpHandler.cs | Mon May 18 17:27:35 -0700 2009 | |
| |
HttpHandlerFactory.cs | Mon May 18 17:27:35 -0700 2009 | |
| |
IIS.cs | ||
| |
IronRuby.Rack.Example/ | ||
| |
IronRuby.Rack.csproj | ||
| |
IronRuby.Rack.sln | ||
| |
Properties/ | Mon May 18 17:27:35 -0700 2009 | |
| |
README.markdown | ||
| |
Request.cs | Mon May 18 17:27:35 -0700 2009 | |
| |
Response.cs | Tue May 26 13:29:07 -0700 2009 | |
| |
RubyEngine.cs | ||
| |
Utils.cs | ||
| |
test.bat | ||
| |
test.rb |
Merlin/Main/Hosts/IronRuby.Rack/README.markdown
ironruby-rack
Run Rack-based web applications on IIS with IronRuby
Setup
Install Rack
igem install rack
Install IIS (this set of features might be overkill)
- Control Panel -> Programs -> Turn Windows Features on or off
- Internet Information Services
- World Wide Web Services, enable:
- Application Development Features
- Common HTTP Features -> Default Document, Directory Browsing, HTTP Redirection and Static Content
- Performance features -> Static Content Compression
- Security -> Request Filtering and Windows Authentication
- Web Management Tools, enable:
- IIS 6 Management Compatibility -> IIS Metabase and IIS6 configuration compatibility
- IIS Management Console
- IIS Management Script and Tools
- IIS Management Service
- World Wide Web Services, enable:
Give permissions to IIS
- IIS needs to have permission to open files in this project, as well as in the Ruby standard library. Grant IIS_IUSER permission to this directory, as well as the Ruby standard library (usually C:\ruby\lib\ruby)
Open IronRack.sln in Visual Studio
- Click "OK" to prompts about creating virtual directories, otherwise not all the project files will load.
- Right-click on IronRuby.Rack.App and select "Set as StartUp Project".
Building
Simply build the solution in Visual Studio. It will build IronRuby, as well as IronRuby.Rack.dll.
Running
Click "Debug" -> "Start without Debugging" to run the Rack Application, which will just navigate to http://localhost/IronRuby.Rack.Example
How it works
- Uses ASP.NET's HttpHandlers to
- Registering IronRuby.Rack in the Rack-based application's Web.config
- Load a Rack-based application on startup (HttpHandlerFactory and
Application constructor).
- Initializes Rack and runs the application's config.ru, which tells Rack what application (any Ruby object that responds to 'call')
- Intercept web requests (HttpHandler.ProcessRequest)
- Creates a Request and a Response, and passes it off to IIS.Handle which:
- Set up the environment according to the Rack specification
- Calls Application.Call 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.
- Rack application does its thing (process Rails/Sinatra request, or deal with things itself) and returns a response according to the Rack specification.
- Takes the Rack response and pass the appropriate data to the IIS response (response body, status, headers)
- Creates a Request and a Response, and passes it off to IIS.Handle which:








