Bootylicious
view release on metacpan or search on metacpan
lib/Bootylicious/Comment.pm view on Meta::CPAN
141516171819202122232425262728293031323334
my
%params
=
@_
;
foreach
my
$method
(
qw/author email url content/
) {
$self
->
$method
(
$params
{
$method
})
if
defined
$params
{
$method
};
}
return
$self
;
}
sub
created {
Bootylicious::Timestamp->new(
epoch
=>
stat
(
shift
->path)->mtime);
}
sub
email {
shift
->metadata(
=>
@_
) }
sub
url {
shift
->metadata(
url
=>) }
sub
content {
shift
->inner(
content
=>
@_
) }
sub
number {
my
$self
=
shift
;
my
$path
=
$self
->path;
lib/Bootylicious/Document.pm view on Meta::CPAN
35363738394041424344454647484950515253545556575859
my
$self
=
shift
;
my
$path
=
shift
;
return
unless
-e
$path
;
$self
->path(
$path
);
return
$self
;
}
sub
name {
shift
->
stat
(
name
=>
@_
) }
sub
format
{
shift
->
stat
(
format
=>
@_
) }
sub
filename {
shift
->
stat
(
filename
=>
@_
) }
sub
created {
shift
->
stat
(
created
=>
@_
) }
sub
modified {
shift
->
stat
(
modified
=>
@_
) }
sub
author {
shift
->metadata(
author
=>
@_
) }
sub
content {
shift
->inner(
content
=>
@_
) }
sub
stat
{
shift
->_group(
stat
=>
@_
) }
sub
metadata {
shift
->_group(
metadata
=>
@_
) }
sub
inner {
shift
->_group(
inner
=>
@_
) }
sub
_group {
lib/Bootylicious/DocumentStatLoader.pm view on Meta::CPAN
252627282930313233343536373839404142434445
Carp::croak
qq/Bad file $path/
unless
$name
&&
$format
;
my
$filename
=
join
'.'
=>
$name
,
$format
;
my
$created
;
if
(
$name
=~ s/^(
$TIMESTAMP_RE
)-//) {
$created
= Bootylicious::Timestamp->new(
timestamp
=> $1)->epoch;
return
unless
defined
$created
;
}
my
$modified
=
stat
(
$path
)->mtime;
$created
||=
$modified
;
return
{
name
=>
$name
,
filename
=>
$filename
,
format
=>
$format
,
created
=> Bootylicious::Timestamp->new(
epoch
=>
$created
),
modified
=> Bootylicious::Timestamp->new(
epoch
=>
$modified
)
};
}
lib/Bootylicious/Plugin/PageCache.pm view on Meta::CPAN
525354555657585960616263646566676869707172
return
unless
my
$booty
=
$c
->stash(
'booty'
);
my
$last_modified
=
$booty
->modified->epoch;
return
unless
$last_modified
;
my
$path
= _cache_path(
$c
,
$conf
->{root});
my
$file
= _cache_file(
$c
,
$path
);
return
unless
$file
;
if
(-r
$file
&&
stat
(
$file
)->mtime >=
$last_modified
) {
$c
->app->
log
->debug(
'Serving cached version'
);
return
$c
->render_static(
$path
);
}
$c
->stash(
page_cache
=> 1);
return
;
}
sub
_cache_response {
( run in 0.593 second using v1.01-cache-2.11-cpan-49f99fa48dc )