Fix parsing of regex route within namespace #41

merged 1 commit into from May 17, 2012


None yet
2 participants

abackstrom commented May 9, 2012

Modify parsing of regex routes within namespaces:

  1. Prepend the namespace to all regexes
  2. Interpret circumflex (^) anchor appropriately in relation to namespace
  3. Ensure that negation only matches hits within the namespace

See #40 for original issue and test code.

Slightly wonky aspect of this: the prepending slash.


with( '/path', function(){
    respond( '@foo', $cb ); // matches /path/foo, /pathfoo, /pathfood, /path/hoofoot
    respond( '@^foo', $cb ); // matches /pathfoo, /pathfood
    respond( '@^/foo', $cb ); // matches /path/foo, /path/food

abackstrom commented on klein.php in 5cb2bb5 May 9, 2012

== should have been ===, per code already in dispatch().


chriso commented May 17, 2012

Thanks. The namespace functionality was a tad rushed.

@chriso chriso added a commit that referenced this pull request May 17, 2012

@chriso chriso Merge pull request #41 from abackstrom/route-namespace-regex
Fix parsing of regex route within namespace

@chriso chriso merged commit 8b7adac into klein:master May 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment