-use Module::Build;
use strict;
+use warnings;
+
+use Module::Build;
my $build = Module::Build->new(
module_name => 'MooseX::Storage',
# and the ability to save the
# file to disk
'IO::File' => '0',
- # this if for the basic role with checksum
- 'Digest::MD5' => '0',
- 'Data::Dumper' => '0',
},
optional => {
'IO::AtomicFile' => '0',
# them on people :)
'Test::YAML::Valid' => '0',
'Test::JSON' => '0',
+ # this if for the basic role with checksum
+ 'Digest' => '0',
+ 'Digest::SHA1' => '0',
+ 'Data::Dumper' => '0',
},
build_requires => {
'Test::More' => '0.62',
'Test::Exception' => '0.21',
+ 'Test::Deep' => '0',
},
create_makefile_pl => 'traditional',
recursive_test_files => 1,
Revision history for MooseX-Storage
-0.02
+0.02 Fri. June 8, 2007
* MooseX::Storage::Base::WithChecksum
- added a simple base role which makes a checksum of
the data structure before packing, and checks the
IO::AtomicFile
Test::YAML::Valid
Test::JSON
+ Digest
+ Digest::SHA1
+ Data::Dumper
COPYRIGHT AND LICENCE
:NOTES:
---------------------------------------------------------------------
-purely functional means we don't have to reinstantiate Engine each time,
-and IMHO there's no need even without big changes.
-We can do something like this:
-
- sub collapse_object {
- my $self = shift;
- my %storage;
- $self->map_attributes(sub { $self->collapse_attribute(\%storage, @_) });
- }
-
-or we can make collapse_attribute return KVPs (I think that's nicer and more reusable):
-
- sub collapse_object {
- my $self = shift;
- return {
- $self->map_attributes('collapse_attribute'),
- __class__ => $self->object->meta->name,
- };
- }
-
-I 100% agree, the instantiation of Engine was actually a leftover from an
-early version, so I can make this more functional without too much trouble.
-
----------------------------------------------------------------------
-
-I am not going to do this quite yet, I think there might actually still be value to
-keeping it the way it is. I want to attempt an engine extension first, before i do this.
=head1 NAME
-MooseX::Storage::Base::WithChecksum
-
-=head1 SYNOPSIS
+MooseX::Storage::Base::WithChecksum
=head1 DESCRIPTION
+This is an early implementation of a more secure Storage role,
+which does integrity checks on the data. It is still being
+developed so I recommend using it with caution.
+
+Any thoughts, ideas or suggestions on improving our technique
+are very welcome.
+
=head1 METHODS
=over 4
use IO::AtomicFile;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
extends 'MooseX::Storage::Engine::IO::File';
use IO::File;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
has 'file' => (
is => 'ro',
use strict;
use warnings;
-use Test::More tests => 26;
+use Test::More;
use Test::Exception;
use Test::Deep;
BEGIN {
+ eval "use Digest";
+ plan skip_all => "Digest is required for this test" if $@;
+ plan tests => 26;
use_ok('MooseX::Storage');
}