Permalink
Browse files

mro

  • Loading branch information...
1 parent bf40a27 commit fefd2b9c3a3ed79c99891351903d9368aa6a85d7 @kazeburo committed Jul 12, 2010
Showing with 19 additions and 15 deletions.
  1. +2 −2 Makefile.PL
  2. +8 −8 lib/NoNoPaste.pm
  3. +7 −3 lib/Shirahata.pm
  4. +2 −2 nonopaste.psgi
View
4 Makefile.PL
@@ -17,11 +17,11 @@ requires 'Net::IP';
requires 'Plack::Middleware::Access';
requires 'Plack::Middleware::ReverseProxy';
requires 'Router::Simple';
-requires 'Text::Xslate', 0.1043;
+requires 'Text::Xslate', 0.1044;
requires 'HTML::FillInForm::Lite', 1.09;
requires 'Cwd';
requires 'File::Basename';
-requires 'Class::ISA';
+requires 'MRO::Compat';
requires 'DBI';
requires 'DBD::SQLite', 1.25;
View
16 lib/NoNoPaste.pm
@@ -81,7 +81,7 @@ get '/' => sub {
my ( $self, $c ) = @_;
my ($entries,$next) = $self->entry_list($c->req->param('offset'));
- $c->render('index.tx',
+ $c->render('index',
entries => $entries,
next => $next );
};
@@ -95,7 +95,7 @@ post '/add' => sub {
}
my ($entries,$next) = $self->entry_list;
- $c->render('index.tx',
+ $c->render('index',
entries => $entries,
next => $next);
};
@@ -105,13 +105,13 @@ get '/entry/{id:[0-9a-f]{16}}' => sub {
my $entry = $self->retrieve_entry($c->args->{id});
return $c->res->not_found() unless $entry;
- $c->render('entry.tx', entry => $entry );
+ $c->render('entry', entry => $entry );
};
1;
__DATA__
-@@ base.tx
+@@ base
<html>
<head>
<title>NoNoPaste: Yet Another NoPaste</title>
@@ -150,8 +150,8 @@ $(function() {
</html>
-@@ index.tx
-: cascade 'base.tx'
+@@ index
+: cascade 'base'
: around content -> {
<h2 class="subheader">New Entry</h2>
@@ -200,8 +200,8 @@ $(function() {
</script>
: } #block javascript
-@@ entry.tx
-: cascade 'base.tx'
+@@ entry
+: cascade 'base'
: around content -> {
<h2 class="subheader"><a href="<: $c.req.uri_for('/entry/' ~ $entry.id) :>"><: $c.req.uri_for('/entry/' ~ $entry.id) :></a></h2>
View
10 lib/Shirahata.pm
@@ -2,6 +2,9 @@ package Shirahata;
use strict;
use warnings;
+use MRO::Compat;
+use mro;
+
use Carp qw//;
use Scalar::Util qw/blessed/;
use base qw/Class::Accessor::Fast/;
@@ -11,7 +14,7 @@ use Cwd qw/realpath/;
use File::Basename qw/dirname/;
use Path::Class;
use Net::IP;
-use Class::ISA;
+
use Text::Xslate;
use Data::Section::Simple;
use HTML::FillInForm::Lite qw//;
@@ -34,6 +37,7 @@ sub import {
*{"$caller\::$func"} = \&$func;
}
}
+
}
strict->import;
warnings->import;
@@ -103,7 +107,7 @@ sub build_shirahata_psgi_app {
my $self = shift;
my @inheri;
- for my $parent ( Class::ISA::self_and_super_path(ref $self) ) {
+ for my $parent ( @{mro::get_linear_isa(ref $self)} ) {
next if ! $parent->can('build_shirahata_psgi_app');
next if $parent eq __PACKAGE__;
push @inheri, $parent;
@@ -125,6 +129,7 @@ sub build_shirahata_psgi_app {
}
#xslate
+ my $fif = HTML::FillInForm::Lite->new(layer => ':raw');
my $tx = Text::Xslate->new(
path => [ \%templates ],
cache => 2,
@@ -134,7 +139,6 @@ sub build_shirahata_psgi_app {
my $q = shift;
return sub {
my ($html) = @_;
- my $fif = HTML::FillInForm::Lite->new(layer => ':raw');
return Text::Xslate::mark_raw( $fif->fill( \$html, $q ) );
}
}
View
4 nonopaste.psgi
@@ -1,7 +1,7 @@
#!/usr/bin/perl
-use NoNoPaste;
+use NoNoPaste3;
-NoNoPaste->psgi();
+NoNoPaste3->psgi();

0 comments on commit fefd2b9

Please sign in to comment.