[Catalyst-commits] r12383 - in
trunk/examples/CatalystAdvent/lib/CatalystAdvent: . Controller
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Tue Dec 15 01:47:51 GMT 2009
Author: t0m
Date: 2009-12-15 01:47:50 +0000 (Tue, 15 Dec 2009)
New Revision: 12383
Modified:
trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm
trunk/examples/CatalystAdvent/lib/CatalystAdvent/Pod.pm
Log:
Push the default settings down, removing duplicate code
Modified: trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm
===================================================================
--- trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm 2009-12-15 01:44:32 UTC (rev 12382)
+++ trunk/examples/CatalystAdvent/lib/CatalystAdvent/Controller/Calendar.pm 2009-12-15 01:47:50 UTC (rev 12383)
@@ -29,6 +29,10 @@
=head1 METHODS
+=head2 base
+
+Base action for this controller that all other actions are attached to.
+
=head2 index
Detaches to the "year" display for the current year.
@@ -87,12 +91,7 @@
my $mtime = ( stat $file )->mtime;
my $cached_pod = $c->cache->get("$file $mtime");
if ( !$cached_pod ) {
- my $parser = CatalystAdvent::Pod->new(
- StringMode => 1,
- FragmentOnly => 1,
- MakeIndex => 0,
- TopLinks => 0
- );
+ my $parser = CatalystAdvent::Pod->new();
open my $fh, '<:utf8', $file or die "Failed to open $file: $!";
$parser->parse_from_filehandle($fh);
@@ -171,12 +170,7 @@
);
for my $day ( @entry ) {
- my $parser = CatalystAdvent::Pod->new(
- StringMode => 1,
- FragmentOnly => 1,
- MakeIndex => 0,
- TopLinks => 0
- );
+ my $parser = CatalystAdvent::Pod->new();
my $file = q{}. $path{$day};
open my $fh, '<:utf8', $file or die "Failed to open $file: $!";
Modified: trunk/examples/CatalystAdvent/lib/CatalystAdvent/Pod.pm
===================================================================
--- trunk/examples/CatalystAdvent/lib/CatalystAdvent/Pod.pm 2009-12-15 01:44:32 UTC (rev 12382)
+++ trunk/examples/CatalystAdvent/lib/CatalystAdvent/Pod.pm 2009-12-15 01:47:50 UTC (rev 12383)
@@ -6,7 +6,13 @@
my $class = shift;
$Pod::Xhtml::SEQ{L} = \&seqL;
- $class->SUPER::new(@_);
+ $class->SUPER::new(
+ StringMode => 1,
+ FragmentOnly => 1,
+ MakeIndex => 0,
+ TopLinks => 0,
+ @_
+ );
}
sub textblock {
More information about the Catalyst-commits
mailing list