From: Stevan Little Date: Fri, 8 Jun 2007 19:36:41 +0000 (+0000) Subject: 0.02 X-Git-Tag: 0_02^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c86a46cc54baef2a5738176a70288db5f3f1376f;p=gitmo%2FMooseX-Storage.git 0.02 --- diff --git a/Build.PL b/Build.PL index 9c850ec..ddb1700 100644 --- a/Build.PL +++ b/Build.PL @@ -1,6 +1,8 @@ -use Module::Build; use strict; +use warnings; + +use Module::Build; my $build = Module::Build->new( module_name => 'MooseX::Storage', @@ -14,9 +16,6 @@ my $build = Module::Build->new( # 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', @@ -26,10 +25,15 @@ my $build = Module::Build->new( # 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, diff --git a/Changes b/Changes index c60ca1c..0f90c1e 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,6 @@ 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 diff --git a/README b/README index e8a2a3e..8b26945 100644 --- a/README +++ b/README @@ -28,6 +28,9 @@ OPTIONAL DEPENDENCIES IO::AtomicFile Test::YAML::Valid Test::JSON + Digest + Digest::SHA1 + Data::Dumper COPYRIGHT AND LICENCE diff --git a/TODO b/TODO index a1e5226..a6b6072 100644 --- a/TODO +++ b/TODO @@ -2,34 +2,7 @@ :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. diff --git a/lib/MooseX/Storage/Base/WithChecksum.pm b/lib/MooseX/Storage/Base/WithChecksum.pm index fb40bcf..1772d6f 100644 --- a/lib/MooseX/Storage/Base/WithChecksum.pm +++ b/lib/MooseX/Storage/Base/WithChecksum.pm @@ -88,12 +88,17 @@ __END__ =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 diff --git a/lib/MooseX/Storage/Engine/IO/AtomicFile.pm b/lib/MooseX/Storage/Engine/IO/AtomicFile.pm index 5f891d8..2978b10 100644 --- a/lib/MooseX/Storage/Engine/IO/AtomicFile.pm +++ b/lib/MooseX/Storage/Engine/IO/AtomicFile.pm @@ -4,7 +4,7 @@ use Moose; use IO::AtomicFile; -our $VERSION = '0.01'; +our $VERSION = '0.02'; extends 'MooseX::Storage::Engine::IO::File'; diff --git a/lib/MooseX/Storage/Engine/IO/File.pm b/lib/MooseX/Storage/Engine/IO/File.pm index defa4c8..b87f6a3 100644 --- a/lib/MooseX/Storage/Engine/IO/File.pm +++ b/lib/MooseX/Storage/Engine/IO/File.pm @@ -4,7 +4,7 @@ use Moose; use IO::File; -our $VERSION = '0.01'; +our $VERSION = '0.02'; has 'file' => ( is => 'ro', diff --git a/t/030_with_checksum.t b/t/030_with_checksum.t index c144ec2..fde3d14 100644 --- a/t/030_with_checksum.t +++ b/t/030_with_checksum.t @@ -3,11 +3,14 @@ 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'); }