summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-09-18 12:19:38 -0500
committerJesse Luehrs <doy@tozt.net>2010-09-18 12:19:38 -0500
commitff93e823b39afa1bb8ffd3cb0fb8d143994c76f6 (patch)
treedee2a51bd8338fd7b5f7b4009611e8081db17672
parent5be97054c5277c52b9aa2141b2013c15e7723af6 (diff)
downloadtozt.net-ff93e823b39afa1bb8ffd3cb0fb8d143994c76f6.tar.gz
tozt.net-ff93e823b39afa1bb8ffd3cb0fb8d143994c76f6.zip
use mx-getopt for rendering
-rw-r--r--bin/preview2
-rw-r--r--bin/render2
-rw-r--r--dist.ini1
-rw-r--r--lib/Tozt.pm12
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;
diff --git a/bin/render b/bin/render
index 859c5a1..8507bac 100644
--- a/bin/render
+++ b/bin/render
@@ -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;
diff --git a/dist.ini b/dist.ini
index d080eca..0921b80 100644
--- a/dist.ini
+++ b/dist.ini
@@ -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,
);