http_router
http_router copied to clipboard
A kick-ass HTTP router for use in Rack
Addresses most of #44. Fixing `warning: URI.escape is obsolete` and `warning: URI.unescape is obsolete` required adding a dependency, on [`Addressable`](https://github.com/sporkmonger/addressable). I hope that's OK! All the tests pass (except for...
Why you made the change: I made this change so that SCRIPT_NAME and PATH_INFO would be set appropriately in the scenario where a partial match route is used. How the...
When I run `bundle exec rake test`, I get the following error: ``` running example ./examples/static/config.ru...rake aborted! undefined method `[]' for nil:NilClass /Users/sean/dev/http_router/Rakefile:99:in `block (4 levels) in ' (See full...
Rake 11 turns on Ruby warnings by default. By running the `hanami-router` test suite, I've ran into the following warnings: ``` /Users/luca/.gem/ruby/2.3.0/gems/http_router-0.11.2/lib/http_router.rb:113: warning: method redefined; discarding old options /Users/luca/.gem/ruby/2.3.0/gems/http_router-0.11.2/lib/http_router.rb:113: warning:...
Hey Josh, Any chance for updated sinatra support? Pete
If I use rack's env hash directly everything is ok: ``` ruby working_app = lambda do |env| router = HttpRouter.new router.add('/').to(:main) router.add('/foo').to(:foo) router.add('/foo/bar').to(:foobar) matching_routes = router.recognize(env) return Rack::Response.new('Not found', 400)...
If you add a route that includes a named variable and requires a specific HTTP method parameter, then requests that don't match will return a 405 instead of a 404...
NameError - uninitialized constant HttpRouter::Node::Path::AmbiguousVariableException: /Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing' /Users/user/.rvm/gems/ruby-1.9.2-p290/gems/http_router-0.10.2/lib/http_router/node/path.rb:8:in`initialize' /Users/user/.rvm/gems/ruby-1.9.2-p290/gems/http_router-0.10.2/lib/http_router/node.rb:56:in `new' /Users/user/.rvm/gems/ruby-1.9.2-p290/gems/http_router-0.10.2/lib/http_router/node.rb:56:in`add_destination' .... I get this error but I cannot see what duplicate variables are casuing the issue because AmbiguousVariableException is...
I have been trying to use a default 404 handling in my app, so I look in the source code / documentation and found that it is possible to pass...
... but I'm unable to follow the code to where its used (or why its there). `recognize` seems to do the same as well. In both cases, when a block...