Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (11 sloc) 0.441 kb

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)
Jump to Line
Something went wrong with that request. Please try again.