From: Stevan Little Date: Mon, 30 Apr 2007 05:04:24 +0000 (+0000) Subject: 0.01 releaase X-Git-Tag: 0_02~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Storage.git;a=commitdiff_plain;h=8d8356bb0a96c1c4e909b56c812b16fc82c7bbd2 0.01 releaase --- diff --git a/Build.PL b/Build.PL index 534b2d8..4468bfc 100644 --- a/Build.PL +++ b/Build.PL @@ -1,18 +1,39 @@ -use strict; -use warnings; use Module::Build; -my $builder = Module::Build->new( - module_name => 'MooseX::Storage', - license => 'perl', - dist_author => 'Chris Prather , Stevan Little ', - dist_version_from => 'lib/MooseX/Storage.pm', - requires => { - 'Test::More' => 0, - 'Moose' => 0, - 'JSON::Any' => 0, +use strict; + +my $build = Module::Build->new( + module_name => 'MooseX::Storage', + license => 'perl', + requires => { + 'Moose' => '0.20', + # you should have at least one + # serialization format + 'JSON::Any' => '0', + 'Best' => '0', # << this if for loading YAML + # and the ability to save the + # file to disk + 'IO::File' => '0', }, - add_to_cleanup => [ 'MooseX-Storage-*' ], + optional => { + 'IO::AtomicFile' => '0', + # these are only used in the + # test, I recommend them, but + # there is no need to force + # them on people :) + 'Test::YAML::Valid' => '0', + 'Test::JSON' => '0', + }, + build_requires => { + 'Test::More' => '0.62', + 'Test::Exception' => '0.21', + }, + create_makefile_pl => 'traditional', + recursive_test_files => 1, + add_to_cleanup => [ + 'META.yml', '*.bak', '*.gz', 'Makefile.PL', + ], ); -$builder->create_build_script(); +$build->create_build_script; + diff --git a/MANIFEST b/MANIFEST index 41323ab..ae259ef 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,14 +1,29 @@ Build.PL Changes -MANIFEST -META.yml # Will be created by "make dist" +META.yml Makefile.PL +MANIFEST +MANIFEST.SKIP README +TODO lib/MooseX/Storage.pm +lib/MooseX/Storage/Basic.pm lib/MooseX/Storage/Engine.pm +lib/MooseX/Storage/Engine/IO/AtomicFile.pm lib/MooseX/Storage/Engine/IO/File.pm lib/MooseX/Storage/Format/JSON.pm +lib/MooseX/Storage/Format/YAML.pm +lib/MooseX/Storage/IO/AtomicFile.pm lib/MooseX/Storage/IO/File.pm +lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm +t/000_load.t t/001_basic.t +t/002_basic_w_subtypes.t +t/003_basic_w_embedded_objects.t +t/004_w_cycles.t +t/010_basic_json.t +t/020_basic_yaml.t +t/100_io.t +t/101_io_atomic.t t/pod-coverage.t t/pod.t diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP new file mode 100644 index 0000000..3de3ebc --- /dev/null +++ b/MANIFEST.SKIP @@ -0,0 +1,19 @@ +^_build +^Build$ +^blib +~$ +\.bak$ +^MANIFEST\.SKIP$ +CVS +\.svn +\.DS_Store +cover_db +\..*\.sw.?$ +^Makefile$ +^pm_to_blib$ +^MakeMaker-\d +^blibdirs$ +\.old$ +^#.*#$ +^\.# +^TODO$ \ No newline at end of file diff --git a/Makefile.PL b/Makefile.PL deleted file mode 100644 index 9acfa80..0000000 --- a/Makefile.PL +++ /dev/null @@ -1,18 +0,0 @@ -use strict; -use warnings; -use ExtUtils::MakeMaker; - -WriteMakefile( - NAME => 'MooseX::Storage', - AUTHOR => 'Chris Prather , Stevan Little ', - VERSION_FROM => 'lib/MooseX/Storage.pm', - ABSTRACT_FROM => 'lib/MooseX/Storage.pm', - PL_FILES => {}, - PREREQ_PM => { - 'Test::More' => 0, - 'Moose' => 0, - 'JSON::Any' => 0, - }, - dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, - clean => { FILES => 'MooseX-Storage-*' }, -); diff --git a/README b/README index bab99a8..f4dcf91 100644 --- a/README +++ b/README @@ -18,7 +18,16 @@ Alternatively, to install with Module::Build, you can use the following commands DEPENDENCIES -Moose!!!!!!! + Moose + JSON::Any + Best (in order to load a YAML file) + IO::Fole + +OPTIONAL DEPENDENCIES + + IO::AtomicFile + Test::YAML::Valid + Test::JSON COPYRIGHT AND LICENCE diff --git a/TODO b/TODO new file mode 100644 index 0000000..a1e5226 --- /dev/null +++ b/TODO @@ -0,0 +1,36 @@ +--------------------------------------------------------------------- +: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/t/000_load.t b/t/000_load.t index 3e08819..f287b41 100644 --- a/t/000_load.t +++ b/t/000_load.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More tests => 1; BEGIN { use_ok('MooseX::Storage'); diff --git a/t/001_basic.t b/t/001_basic.t index e75f51e..91848c2 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More tests => 11; BEGIN { use_ok('MooseX::Storage'); diff --git a/t/002_basic_w_subtypes.t b/t/002_basic_w_subtypes.t index e468ca8..16bad20 100644 --- a/t/002_basic_w_subtypes.t +++ b/t/002_basic_w_subtypes.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More tests => 11; BEGIN { use_ok('MooseX::Storage'); diff --git a/t/003_basic_w_embedded_objects.t b/t/003_basic_w_embedded_objects.t index 7c69094..55c4e6c 100644 --- a/t/003_basic_w_embedded_objects.t +++ b/t/003_basic_w_embedded_objects.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More tests => 47; BEGIN { use_ok('MooseX::Storage'); diff --git a/t/004_w_cycles.t b/t/004_w_cycles.t index cca0e22..92fc210 100644 --- a/t/004_w_cycles.t +++ b/t/004_w_cycles.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More tests => 12; use Test::Exception; BEGIN { diff --git a/t/010_basic_json.t b/t/010_basic_json.t index 8c475e3..5a93cc5 100644 --- a/t/010_basic_json.t +++ b/t/010_basic_json.t @@ -3,10 +3,12 @@ use strict; use warnings; -use Test::More no_plan => 1; -use Test::JSON; +use Test::More; BEGIN { + eval "use Test::JSON"; + plan skip_all => "Test::JSON is required for this test" if $@; + plan tests => 12; use_ok('MooseX::Storage'); } @@ -39,7 +41,7 @@ BEGIN { my $json = $foo->freeze; - is_valid_json($json); + is_valid_json($json, '.. this is valid JSON'); is_json( $json, diff --git a/t/020_basic_yaml.t b/t/020_basic_yaml.t index 794f883..36ee605 100644 --- a/t/020_basic_yaml.t +++ b/t/020_basic_yaml.t @@ -3,10 +3,12 @@ use strict; use warnings; -use Test::More no_plan => 1; -use Test::YAML::Valid; +use Test::More; BEGIN { + eval "use Test::YAML::Valid"; + plan skip_all => "Test::YAML::Valid is required for this test" if $@; + plan tests => 12; use_ok('MooseX::Storage'); } diff --git a/t/100_io.t b/t/100_io.t index 130f4b7..b494e10 100644 --- a/t/100_io.t +++ b/t/100_io.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More tests => 10; BEGIN { use_ok('MooseX::Storage'); diff --git a/t/101_io_atomic.t b/t/101_io_atomic.t index 8f28dbd..20e0aa5 100644 --- a/t/101_io_atomic.t +++ b/t/101_io_atomic.t @@ -3,9 +3,12 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More; BEGIN { + eval "use IO::AtomicFile"; + plan skip_all => "IO::AtomicFile is required for this test" if $@; + plan tests => 10; use_ok('MooseX::Storage'); }