Rack-backed custom URL protocol for your MacRuby application
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
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)