diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-02-17 18:57:19 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-02-17 18:57:19 -0600 |
commit | a7c37d5489611bf79889dd689abb0ac686d640c9 (patch) | |
tree | 68d9b965c581dcc049c36b5e6a5d9b877ff0312b /lib/Narwhal.pm | |
parent | 251066735d9b3392ba7ea35da2fc0d6cd896e3a1 (diff) | |
download | narwhal-a7c37d5489611bf79889dd689abb0ac686d640c9.tar.gz narwhal-a7c37d5489611bf79889dd689abb0ac686d640c9.zip |
refactor this a bit
Diffstat (limited to 'lib/Narwhal.pm')
-rw-r--r-- | lib/Narwhal.pm | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/Narwhal.pm b/lib/Narwhal.pm index 66aabb7..82ad0ab 100644 --- a/lib/Narwhal.pm +++ b/lib/Narwhal.pm @@ -1,5 +1,6 @@ package Narwhal; use OX; +use Narwhal::RouteBuilder::HTTPMethod; with 'OX::Role::WithAppRoot'; @@ -11,7 +12,12 @@ config template_root => sub { component Redirect => 'Narwhal::Component::Redirect'; -component Wiki => 'Narwhal::Component::Wiki', ( +component WikiPage => 'Narwhal::Component::Wiki::Page', ( + kioku => depends_on('/Component/Kioku'), + tt => depends_on('/Component/TT'), +); + +component WikiEdit => 'Narwhal::Component::Wiki::Edit', ( kioku => depends_on('/Component/Kioku'), tt => depends_on('/Component/TT'), ); @@ -30,15 +36,16 @@ router as { route '/' => 'redirect.permanent', ( to => '/page/main', ); - route '/page/:page_name' => 'wiki.page', ( + route '/page/:page_name' => 'page', ( page_name => { isa => 'Str' }, ); - route '/edit/:page_name' => 'wiki.edit', ( + route '/edit/:page_name' => 'edit', ( page_name => { isa => 'Str' }, ); }, ( redirect => depends_on('/Component/Redirect'), - wiki => depends_on('/Component/Wiki'), + page => depends_on('/Component/WikiPage'), + edit => depends_on('/Component/WikiEdit'), ); no OX; |