Created
August 28, 2010 08:48
-
-
Save DanielVartanov/554909 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'http_router' | |
require 'http_router/interface/sinatra' | |
class Application < Sinatra::Base | |
register HttpRouter::Interface::Sinatra::Extension | |
params_inspect = lambda { params.inspect + "\n" } | |
# These routes will work | |
get("/:common_variable/:matched", :matching => { :matched => /abcde/ }, ¶ms_inspect) | |
get("/:common_variable/:unmatched", ¶ms_inspect) | |
# These routes will NOT work (just because of alternative delimiter) | |
get("/:common_variable\\(:matched", :matching => { :matched => /abcde/ }, ¶ms_inspect) | |
get("/:common_variable\\(:unmatched", ¶ms_inspect) | |
get("/:common_variable.:matched", :matching => { :matched => /abcde/ }, ¶ms_inspect) | |
get("/:common_variable.:unmatched", ¶ms_inspect) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment