gf3/secretary — pull request #10 by noprompt (2014-02-11 07:48:08+00:00)
Title: Full rewrite of routing code

This is a fat PR, I know, but I think this covers all the bases and then some. I borrowed the lexing technique from clout with a few differences. A few more tweaks could go into this but I wanted to get something committed for discussion.

Here's what's happening:

- Routes are now compiled as regular expressions
- `*routes*` is now a vector of `[compiled-route action-fn route-source]`
- Route globbing both named and unnamed is now supported (ie. `*/*`, `*a/*b`, `*x/*/*y`)
- Params which appear multiple times are stored with as vector in the param map (`/:x/:x/:x/` with `/1/2/3` will yield `{:x ["1" "2" "3"]}`)
- Encoded routes are properly decoded and matched (`/foo bar` will match `/foo%20bar`)
- Route renderer has been updated to interpolate values following the same rules as the compiler
- "Low level" route fns `add-route!`, `remove-route!`, `reset-routes!`

We could potentially add Sinatra's optional `:foo?` params but I'm not sure what that would look like yet. I'm setting the development version to `1.0.0-SNAPSHOT` here for obvious reasons.