Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A sample MacRuby application demonstrating how to connect Rack to a WebView.
Ruby Objective-C
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
English.lproj
MacOnRack.xcodeproj
.gitignore
Info.plist
README.markdown
application_controller.rb
main.m
rack_url_protocol.rb
rb_main.rb

README.markdown

MacOnRack Demo

A sample MacRuby application demonstrating how to connect Rack to a WebView.

require 'rack_url_protocol'

class ApplicationController
  attr_accessor :webView

  def awakeFromNib
    # Register your custom scheme.
    # This should be unique to your app.
    RackURLProtocol.register("rack", withRackApplication: self)

    # Load the root "/" page
    webView.mainFrameURL = "rack:///"
  end

  def call(env)
    [200, {"Content-Type" => "text/html"}, ["<h1>Hello, MacRuby!</h1>"]]
  end
end

Try it with Sinatra or any other rack application that runs on MacRuby.

See RackURLProtocol sstephenson/rack_url_protocol for the latest adapter.

Something went wrong with that request. Please try again.