diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-09-18 12:19:38 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-09-18 12:19:38 -0500 |
commit | ff93e823b39afa1bb8ffd3cb0fb8d143994c76f6 (patch) | |
tree | dee2a51bd8338fd7b5f7b4009611e8081db17672 | |
parent | 5be97054c5277c52b9aa2141b2013c15e7723af6 (diff) | |
download | tozt.net-ff93e823b39afa1bb8ffd3cb0fb8d143994c76f6.tar.gz tozt.net-ff93e823b39afa1bb8ffd3cb0fb8d143994c76f6.zip |
use mx-getopt for rendering
-rw-r--r-- | bin/preview | 2 | ||||
-rw-r--r-- | bin/render | 2 | ||||
-rw-r--r-- | dist.ini | 1 | ||||
-rw-r--r-- | lib/Tozt.pm | 12 |
4 files changed, 11 insertions, 6 deletions
diff --git a/bin/preview b/bin/preview index 81bd292..af7bba7 100644 --- a/bin/preview +++ b/bin/preview @@ -10,7 +10,7 @@ use Plack::Response; use Plack::Runner; use Tozt; -my $site = Tozt->new; +my $site = Tozt->new_with_options; $site->render_all; $site->update_static; @@ -5,6 +5,6 @@ use lib 'lib'; use Tozt; -my $site = Tozt->new; +my $site = Tozt->new_with_options; $site->render_all; $site->update_static; @@ -9,6 +9,7 @@ dist = Tozt [Prereq] File::Copy::Recursive = 0 Moose = 0 +MooseX::Getopt = 0 MooseX::Types::Path::Class = 0 namespace::autoclean = 0 Path::Class = 0 diff --git a/lib/Tozt.pm b/lib/Tozt.pm index e8034b8..598c41a 100644 --- a/lib/Tozt.pm +++ b/lib/Tozt.pm @@ -7,6 +7,8 @@ use File::Copy::Recursive qw(rcopy); use Path::Class (); use Template; +with 'MooseX::Getopt'; + has output_dir => ( is => 'ro', isa => Dir, @@ -29,10 +31,12 @@ has static_dir => ( ); has templater => ( - is => 'ro', - isa => 'Template', - lazy => 1, - default => sub { + traits => ['NoGetopt'], + is => 'ro', + isa => 'Template', + lazy => 1, + init_arg => undef, + default => sub { Template->new( INCLUDE_PATH => shift->template_dir, ); |