Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rack-backed custom URL protocol for your MacRuby application

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 README.md
README.md

RackURLProtocol

Adds a Rack-backed custom URL protocol to your MacRuby application.

Example (hit rack://hello in a WebKit view):

require "rack_url_protocol"

app = Proc.new do |env|
  body = "Hello, #{env["PATH_INFO"]}!"
  [200, { "Content-Length" => body.length.to_s, 
          "Content-Type" => "text/plain" }, [body]]
end

RackURLProtocol.register("rack", withRackApplication: app)
Something went wrong with that request. Please try again.