opal/vienna — pull request #1 by francescoagati (2012-11-06 16:37:41+00:00)
Title: Router

This patch add a micro router, wrapping routie library (https://github.com/jgallen23/routie).

example:

routing

```
router=Vienna::Router.new

router.define do
page('/users/:id') { puts params[:id] }
end

router.goto('/users/1')

```

redirect

```
router=Vienna::Router.new

router.define do
page('/users/name/francesco') { redirect('/users/1') }
page('/users/:id') { puts params[:id] }
end

router.goto('/users/name/francesco')

```

filters

```

router=Vienna::Router.new

router.define do
before('/users/:id') { @auth = true }
page('/users/:id') { puts @auth }
end

router.goto('/users/1')

```