--- trunk/lib/Frey/Designer.pm 2008/10/28 22:13:08 201 +++ trunk/lib/Frey/Designer.pm 2008/11/01 00:58:24 224 @@ -12,6 +12,7 @@ extends 'Frey'; with 'Frey::Web'; +with 'Frey::Path'; has 'uri' => ( is => 'rw', @@ -37,13 +38,12 @@ use HTML::Query; use File::Slurp; use LWP::Simple qw/get/; -use File::Path; use Data::Dump qw/dump/; use HTML::ResolveLink; sub path { my $self = shift; - my $path = 'templates/www.carnet.hr/' . $self->uri->path; + my $path = join('/', ( 'templates', $self->uri->host, $self->uri->path ) ); $path .= '.html' if $path !~ m/\.\w+$/; return $path; } @@ -56,9 +56,7 @@ if ( ! -e $path && $self->mirror ) { - my $base_path = $path; - $base_path =~ s{/[^/]+$}{}; - mkpath $base_path if ! -e $base_path; + $self->mkbasepath( $path ); my $url = $self->uri; warn ">> mirror $url -> $path\n"; @@ -81,7 +79,7 @@ return $body; } -sub html { +sub request { my ( $self, $req ) = @_; my $body = $self->get_page;