Skip to content

Instantly share code, notes, and snippets.

@k2052
Created June 8, 2011 02:27
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 k2052/1013668 to your computer and use it in GitHub Desktop.
Save k2052/1013668 to your computer and use it in GitHub Desktop.
class Everything
@@match = Struct.new(:captures)
def initialize(*exceptions)
@exceptions = exceptions
@captures = @@match.new([])
end
def match(str)
@captures
end
end
def everything(*args)
Everything.new(*args)
end
TestingRoutes.controllers :main do
before everything(:index) do
@test = 'cow'
puts 'hi'
end
get :index, :map => "/example" do
puts @test
"Hello world!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment