Skip to content

Instantly share code, notes, and snippets.

@mattwildig
Created July 17, 2012 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattwildig/3126013 to your computer and use it in GitHub Desktop.
Save mattwildig/3126013 to your computer and use it in GitHub Desktop.
Using Rack::Builder without eval-ing block in another context.
require 'rack'
require 'forwardable'
class MyApp
extend Forwardable
def_delegators :@builder, :use, :map, :run, :call
def initialize
@builder = Rack::Builder.new
map '/route1' do
run SampleApp.new
end
map '/route2' do
run SampleApp.new
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment