X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStorage%2FIO%2FStorableFile.pm;h=f53bd4413c3a5c3f59c8be2386d5ab01c16e5faf;hb=f4ffa4ef5e4cb4a1a43caf932db1b3478abe7b87;hp=eb5d5af76529a606f57c4d63a14dd9c96ce355ab;hpb=124c2ba5bd480a26d5ae91767b7943024ba4ea15;p=gitmo%2FMooseX-Storage.git diff --git a/lib/MooseX/Storage/IO/StorableFile.pm b/lib/MooseX/Storage/IO/StorableFile.pm index eb5d5af..f53bd44 100644 --- a/lib/MooseX/Storage/IO/StorableFile.pm +++ b/lib/MooseX/Storage/IO/StorableFile.pm @@ -4,26 +4,26 @@ use Moose::Role; use Storable (); -our $VERSION = '0.01'; +our $VERSION = '0.17'; our $AUTHORITY = 'cpan:STEVAN'; requires 'pack'; requires 'unpack'; sub load { - my ( $class, $filename ) = @_; + my ( $class, $filename, @args ) = @_; # try thawing - return $class->thaw( Storable::retrieve($filename) ) + return $class->thaw( Storable::retrieve($filename), @args ) if $class->can('thaw'); # otherwise just unpack - $class->unpack( Storable::retrieve($filename) ); + $class->unpack( Storable::retrieve($filename), @args ); } sub store { - my ( $self, $filename ) = @_; + my ( $self, $filename, @args ) = @_; Storable::nstore( # try freezing, otherwise just pack - ($self->can('freeze') ? $self->freeze() : $self->pack()), + ($self->can('freeze') ? $self->freeze(@args) : $self->pack(@args)), $filename ); } @@ -36,7 +36,7 @@ __END__ =head1 NAME -MooseX::Storage::IO::StorableFile +MooseX::Storage::IO::StorableFile - An Storable File I/O role =head1 SYNOPSIS @@ -106,7 +106,7 @@ Stevan Little Estevan.little@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Infinity Interactive, Inc. +Copyright 2007-2008 by Infinity Interactive, Inc. L