4 |
use warnings; |
use warnings; |
5 |
|
|
6 |
use base qw(Jifty::Object Class::Accessor::Fast); |
use base qw(Jifty::Object Class::Accessor::Fast); |
7 |
__PACKAGE__->mk_accessors( qw(instance) ); |
__PACKAGE__->mk_accessors( qw(instance dir) ); |
8 |
use File::Slurp; |
use File::Slurp; |
9 |
use JSON::XS; |
use JSON::XS; |
10 |
use Carp qw/confess/; |
use Carp qw/confess/; |
23 |
|
|
24 |
=head2 new |
=head2 new |
25 |
|
|
26 |
my $cache = A3C::Cache->new({ instance => 'foobar' }); |
my $cache = A3C::Cache->new({ instance => 'foobar', dir => 'strix' }); |
27 |
|
|
28 |
=head2 cache_path |
=head2 cache_path |
29 |
|
|
40 |
|
|
41 |
#warn "# cache_path",dump( @_ ); |
#warn "# cache_path",dump( @_ ); |
42 |
|
|
43 |
my $path = Jifty::Util->absolute_path( 'var/strix' ); |
my $dir = $self->dir || 'strix'; |
44 |
|
|
45 |
|
my $path = Jifty::Util->absolute_path( "var/$dir" ); |
46 |
|
|
47 |
if ( ! -e $path ) { |
if ( ! -e $path ) { |
48 |
mkdir $path || die "can't create $path: $!"; |
mkdir $path || die "can't create $path: $!"; |