Revision history for MooseX-Storage
-0.12 ???
+0.12 Fri. March 14, 2008
- added build_requires for Test::Deep (awwaiid)
+ - upped the Moose dependency to support the custom
+ meta-attribute-traits
+
+ * t/
+ - fixing all the tests to properly skip if optional
+ features are not being used, this should help get
+ rid of all our CPANtester failures
+ - tested against 5.10 as well
+
+ * MooseX::Storage::Meta::Attribute::DoNotSerialize
+ MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize
+ - adding meta-attribute-trait support for
+ DoNotSerialize
+ - added tests for this
0.11 Thurs. Jan. 10, 2008
all_from 'lib/MooseX/Storage.pm';
# Specific dependencies
-requires 'Moose' => '0.20';
+requires 'Moose' => '0.38';
# you should have at least one
# serialization format
-MooseX-Storage version 0.10
+MooseX-Storage version 0.12
INSTALLATION
Moose
JSON::Any
Best (in order to load a YAML file)
- IO::Fole
+ IO::File
OPTIONAL DEPENDENCIES
use MooseX::Storage::Meta::Attribute::DoNotSerialize;
-our $VERSION = '0.11';
+our $VERSION = '0.12';
our $AUTHORITY = 'cpan:STEVAN';
sub import {
=head1 NAME
-MooseX::Storage::Base::WithChecksum
+MooseX::Storage::Base::WithChecksum - A more secure serialization role
=head1 DESCRIPTION
=head1 NAME
-MooseX::Storage::Format::JSON
+MooseX::Storage::Format::JSON - A JSON serialization role
=head1 SYNOPSIS
=head1 NAME
-MooseX::Storage::Format::Storable
+MooseX::Storage::Format::Storable - A Storable serialization role
=head1 SYNOPSIS
=head1 NAME
-MooseX::Storage::Format::YAML
+MooseX::Storage::Format::YAML - A YAML serialization role
=head1 SYNOPSIS
=head1 NAME
-MooseX::Storage::IO::AtomicFile
+MooseX::Storage::IO::AtomicFile - An Atomic File I/O role
=head1 SYNOPSIS
=head1 NAME
-MooseX::Storage::IO::File
+MooseX::Storage::IO::File - A basic File I/O role
=head1 SYNOPSIS
=head1 NAME
-MooseX::Storage::IO::StorableFile
+MooseX::Storage::IO::StorableFile - An Storable File I/O role
=head1 SYNOPSIS
package MooseX::Storage::Meta::Attribute::DoNotSerialize;
use Moose;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
our $AUTHORITY = 'cpan:STEVAN';
extends 'Moose::Meta::Attribute';
+ with 'MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize';
# register this alias ...
package Moose::Meta::Attribute::Custom::DoNotSerialize;
=head1 NAME
-MooseX::Storage::Meta::Attribute::DoNotSerialize
+MooseX::Storage::Meta::Attribute::DoNotSerialize - A custom meta-attribute to bypass serialization
=head1 SYNOPSIS
--- /dev/null
+
+package MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize;
+use Moose::Role;
+
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:STEVAN';
+
+# register this alias ...
+package Moose::Meta::Attribute::Custom::Trait::DoNotSerialize;
+
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:STEVAN';
+
+sub register_implementation { 'MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize' }
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize - A custom meta-attribute-trait to bypass serialization
+
+=head1 SYNOPSIS
+
+ package Point;
+ use Moose;
+ use MooseX::Storage;
+
+ with Storage('format' => 'JSON', 'io' => 'File');
+
+ has 'x' => (is => 'rw', isa => 'Int');
+ has 'y' => (is => 'rw', isa => 'Int');
+
+ has 'foo' => (
+ traits => [ 'DoNotSerialize' ],
+ is => 'rw',
+ isa => 'CodeRef',
+ );
+
+ 1;
+
+=head1 DESCRIPTION
+
+Sometimes you don't want a particular attribute to be part of the
+serialization, in this case, you want to make sure that attribute
+uses this custom meta-attribute-trait. See the SYNOPSIS for a nice
+example that can be easily cargo-culted.
+
+=head1 METHODS
+
+=head2 Introspection
+
+=over 4
+
+=item B<meta>
+
+=back
+
+=head1 BUGS
+
+All complex software has bugs lurking in it, and this module is no
+exception. If you find a bug please either email me, or add the bug
+to cpan-RT.
+
+=head1 AUTHOR
+
+Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2007-2008 by Infinity Interactive, Inc.
+
+L<http://www.iinteractive.com>
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
use strict;
use warnings;
-use Test::More tests => 9;
+use Test::More;
+
+BEGIN {
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
+ plan tests => 10;
+ use_ok('MooseX::Storage');
+}
{
package Foo;
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More no_plan => 1;
+use Test::Exception;
+
+BEGIN {
+ use_ok('MooseX::Storage');
+}
+
+{
+ package Foo;
+ use Moose;
+ use MooseX::Storage;
+
+ with Storage;
+
+ has 'bar' => (
+ metaclass => 'DoNotSerialize',
+ is => 'rw',
+ default => sub { 'BAR' }
+ );
+
+ has 'baz' => (
+ traits => [ 'DoNotSerialize' ],
+ is => 'rw',
+ default => sub { 'BAZ' }
+ );
+
+ has 'gorch' => (
+ is => 'rw',
+ default => sub { 'GORCH' }
+ );
+
+ 1;
+}
+
+my $foo = Foo->new;
+isa_ok($foo, 'Foo');
+
+
BEGIN {
eval "use Test::JSON";
plan skip_all => "Test::JSON is required for this test" if $@;
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
plan tests => 12;
use_ok('MooseX::Storage');
}
BEGIN {
eval "use Encode";
- plan skip_all => "Encode is required for this test" if $@;
+ plan skip_all => "Encode is required for this test" if $@;
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
# NOTE:
# this is because JSON::XS is
# the only one which really gets
BEGIN {
eval "use Test::YAML::Valid";
- plan skip_all => "Test::YAML::Valid is required for this test" if $@;
+ plan skip_all => "Test::YAML::Valid is required for this test" if $@;
plan tests => 12;
use_ok('MooseX::Storage');
}
BEGIN {
eval "use Digest; use Digest::SHA1";
- plan skip_all => "Digest and Digest::SHA1 is required for this test" if $@;
+ plan skip_all => "Digest and Digest::SHA1 is required for this test" if $@;
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
plan tests => 26;
use_ok('MooseX::Storage');
}
#!/usr/bin/perl
+
$|++;
use strict;
use warnings;
BEGIN {
eval "use Test::JSON; use Test::YAML::Valid;";
- plan skip_all => "Test::JSON and Test::YAML::Valid are required for this test" if $@;
+ plan skip_all => "Test::JSON and Test::YAML::Valid are required for this test" if $@;
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
plan tests => 33;
use_ok('MooseX::Storage');
}
BEGIN {
eval "use IO::AtomicFile";
- plan skip_all => "IO::AtomicFile is required for this test" if $@;
+ plan skip_all => "IO::AtomicFile is required for this test" if $@;
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
plan tests => 21;
use_ok('MooseX::Storage');
}
use strict;
use warnings;
-use Test::More tests => 10;
+use Test::More;
-BEGIN {
+BEGIN {
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
+ plan tests => 10;
use_ok('MooseX::Storage');
}
BEGIN {
eval "use IO::AtomicFile";
- plan skip_all => "IO::AtomicFile is required for this test" if $@;
+ plan skip_all => "IO::AtomicFile is required for this test" if $@;
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
plan tests => 10;
use_ok('MooseX::Storage');
}
use Test::More;
BEGIN {
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
# NOTE:
# this is because JSON::XS is
# the only one which really gets
BEGIN {
eval "use IO::AtomicFile";
- plan skip_all => "IO::AtomicFile is required for this test" if $@;
+ plan skip_all => "IO::AtomicFile is required for this test" if $@;
+ eval "use JSON::Any";
+ plan skip_all => "JSON::Any is required for this test" if $@;
# NOTE:
# this is because JSON::XS is
# the only one which really gets