Commit 224d88de authored by gregor herrmann's avatar gregor herrmann

[svn-upgrade] Integrating new upstream version, libdata-serializer-perl (0.46)

parent b2c83d9c
use Module::Build; use Module::Build;
my $build = Module::Build->new my $build = Module::Build->new
( (
sign => 1, #sign => 1,
module_name => 'Data::Serializer', module_name => 'Data::Serializer',
dist_author => 'Neil Neely (neil@neely.cx)', dist_author => 'Neil Neely (neil@neely.cx)',
license => 'perl', license => 'perl',
create_makefile_pl => 'passthrough',
build_class => 'Module::Build', build_class => 'Module::Build',
requires => { requires => {
'Exporter' => 0, 'Exporter' => 0,
......
Revision history for Perl extension Data::Serializer Revision history for Perl extension Data::Serializer
0.46 Wedn Apr 23 2008
- Fixed Module::Build implementation, will now generate proper META.yml file
0.45 Wedn Apr 23 2008
- Removed support for Tie::Transient, the module is long gone. If ever a standard
emerges for tagging data as transient then Data::Serializer will support it.
- Added utf8 call to Data::Serializer::JSON
patch supplied by Makamaka <makamaka@donzoko.net> in response to complex bug discussion
that started under Crypt::CBC http://rt.cpan.org/Public/Bug/Display.html?id=35239
0.44 Thu Dec 13 2008 0.44 Thu Dec 13 2008
- Added 'raw' flag to constructor, allows for more convenient - Added 'raw' flag to constructor, allows for more convenient
raw access to underlying serializers raw access to underlying serializers
......
--- #YAML:1.0 ---
name: Data-Serializer name: Data-Serializer
version: 0.44 version: 0.46
abstract: ~ author:
license: ~ - Neil Neely (neil@neely.cx)
generated_by: ExtUtils::MakeMaker version 6.36 abstract: Modules that serialize data structures
distribution_type: module license: perl
requires: resources:
AutoLoader: 0 license: http://dev.perl.org/licenses/
AutoSplit: 0 requires:
Data::Dumper: 2.08 AutoLoader: 0
Digest::SHA: 0 Data::Dumper: 2.08
Exporter: 0 Digest::SHA: 0
File::Spec: 0 Exporter: 0
IO::File: 0 IO::File: 0
Test::More: 0 build_requires:
File::Spec: 0
IO::File: 0
Test::More: 0
recommends:
Compress::PPMd: 0
Compress::Zlib: 0
Config::General: 0
Crypt::Blowfish: 0
Crypt::CBC: 0
Data::Denter: 0
Data::Taxi: 0
FreezeThaw: 0
JSON: 0
JSON::Syck: 0
JSON::XS: 0
MIME::Base64: 0
PHP::Serialization: 0
Storable: 0
XML::Dumper: 0
XML::Simple: 0
YAML: 0
YAML::Syck: 0
provides:
Data::Serializer:
file: lib/Data/Serializer.pm
version: 0.46
Data::Serializer::Config::General:
file: lib/Data/Serializer/Config/General.pm
version: 0.02
Data::Serializer::Cookbook:
file: lib/Data/Serializer/Cookbook.pm
version: 0.04
Data::Serializer::Data::Denter:
file: lib/Data/Serializer/Data/Denter.pm
version: 0.02
Data::Serializer::Data::Dumper:
file: lib/Data/Serializer/Data/Dumper.pm
version: 0.05
Data::Serializer::Data::Taxi:
file: lib/Data/Serializer/Data/Taxi.pm
version: 0.02
Data::Serializer::FreezeThaw:
file: lib/Data/Serializer/FreezeThaw.pm
version: 0.02
Data::Serializer::JSON:
file: lib/Data/Serializer/JSON.pm
version: 0.03
Data::Serializer::JSON::Syck:
file: lib/Data/Serializer/JSON/Syck.pm
version: 0.02
Data::Serializer::PHP::Serialization:
file: lib/Data/Serializer/PHP/Serialization.pm
version: 0.02
Data::Serializer::Storable:
file: lib/Data/Serializer/Storable.pm
version: 0.03
Data::Serializer::XML::Dumper:
file: lib/Data/Serializer/XML/Dumper.pm
version: 0.02
Data::Serializer::XML::Simple:
file: lib/Data/Serializer/XML/Simple.pm
version: 0.02
Data::Serializer::YAML:
file: lib/Data/Serializer/YAML.pm
version: 0.02
Data::Serializer::YAML::Syck:
file: lib/Data/Serializer/YAML/Syck.pm
version: 0.02
generated_by: Module::Build version 0.2808
meta-spec: meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html url: http://module-build.sourceforge.net/META-spec-v1.2.html
version: 1.2 version: 1.2
# Note: this file was auto-generated by Module::Build::Compat version 0.03 # Note: this file was auto-generated by Module::Build::Compat version 0.03
use ExtUtils::MakeMaker;
WriteMakefile unless (eval "use Module::Build::Compat 0.02; 1" ) {
( print "This module requires Module::Build to install itself.\n";
'NAME' => 'Data::Serializer',
'VERSION_FROM' => 'lib/Data/Serializer.pm', require ExtUtils::MakeMaker;
'PREREQ_PM' => { my $yn = ExtUtils::MakeMaker::prompt
'AutoLoader' => '0', (' Install Module::Build now from CPAN?', 'y');
'AutoSplit' => '0',
'Data::Dumper' => '2.08', unless ($yn =~ /^y/i) {
'Digest::SHA' => '0', die " *** Cannot install without Module::Build. Exiting ...\n";
'Exporter' => '0', }
'File::Spec' => '0',
'IO::File' => '0', require Cwd;
'Test::More' => '0' require File::Spec;
}, require CPAN;
'INSTALLDIRS' => 'site',
'EXE_FILES' => [], # Save this 'cause CPAN will chdir all over the place.
'PL_FILES' => {} my $cwd = Cwd::cwd();
)
; CPAN::Shell->install('Module::Build::Compat');
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
or die "Couldn't install Module::Build, giving up.\n";
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
Module::Build::Compat->run_build_pl(args => \@ARGV);
require Module::Build;
Module::Build::Compat->write_makefile(build_class => 'Module::Build');
...@@ -200,21 +200,6 @@ METHODS ...@@ -200,21 +200,6 @@ METHODS
Reads first line of supplied file or filehandle and returns it Reads first line of supplied file or filehandle and returns it
deserialized. deserialized.
TRANSIENCE
Data::Serializer is aware of Tie::Transient. What this means is that you
use Tie::Transient as normal, and when your object is serialized, the
transient components will be automatically removed for you.
Tie::Transient is not on CPAN, and doesn't look like it ever will be.
With the advent of attributes from 5.8 this feature should probably be
deprecated anyway.
If you would like to use Tie::Transient you can download it directly
from Brian's site here:
http://www.maz.org/perl/Tie-Transient-0.05.tar.gz
With perl attributes in 5.8, this should probably be deprecated.
AUTHOR AUTHOR
Neil Neely <neil@neely.cx>. Neil Neely <neil@neely.cx>.
...@@ -228,8 +213,6 @@ BUGS ...@@ -228,8 +213,6 @@ BUGS
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Serializer http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Serializer
TODO TODO
Phase out support for Tie::Transient
Extend the persistent framework. Perhaps Persistent::Base(3) framework Extend the persistent framework. Perhaps Persistent::Base(3) framework
would be useful to explore further. Volunteers for putting this together would be useful to explore further. Volunteers for putting this together
would be welcome. would be welcome.
...@@ -276,5 +259,4 @@ SEE ALSO ...@@ -276,5 +259,4 @@ SEE ALSO
Crypt(3) Crypt(3)
MIME::Base64(3) MIME::Base64(3)
IO::File(3) IO::File(3)
Tie::Transient(3)
...@@ -19,7 +19,7 @@ require Exporter; ...@@ -19,7 +19,7 @@ require Exporter;
@EXPORT = qw( ); @EXPORT = qw( );
@EXPORT_OK = qw( ); @EXPORT_OK = qw( );
$VERSION = '0.44'; $VERSION = '0.46';
# Preloaded methods go here. # Preloaded methods go here.
{ {
...@@ -35,7 +35,7 @@ $VERSION = '0.44'; ...@@ -35,7 +35,7 @@ $VERSION = '0.44';
compress => '0', compress => '0',
raw => '0', raw => '0',
options => {}, options => {},
transient => '0', #transient => '0',
serializer_token => '1', serializer_token => '1',
); );
sub new { sub new {
...@@ -51,7 +51,11 @@ $VERSION = '0.44'; ...@@ -51,7 +51,11 @@ $VERSION = '0.44';
$_internal{$dataref->{_key}} = $dataref; $_internal{$dataref->{_key}} = $dataref;
my $self = \$dataref->{_key}; my $self = \$dataref->{_key};
bless $self, $class; bless $self, $class;
$self->_transient(1) if (eval "require Tie::Transient"); #opting to not even warn on this, I don't think anyone ever used it as it never did get published on CPAN.
#If I am wrong and this is in production use, contact me
#if (eval "require Tie::Transient") {
# warn "Support for Tie::Transient is deprecated\n";
#}
#load serializer module if it is defined #load serializer module if it is defined
return $self; return $self;
...@@ -124,15 +128,6 @@ $VERSION = '0.44'; ...@@ -124,15 +128,6 @@ $VERSION = '0.44';
} }
return $return; return $return;
} }
sub _transient {
my $self = (shift);
my $id = $$self;
my $return = $_internal{$id}->{transient};
if (@_) {
$_internal{$id}->{transient} = (shift);
}
return $return;
}
sub portable { sub portable {
my $self = (shift); my $self = (shift);
my $id = $$self; my $id = $$self;
...@@ -456,21 +451,6 @@ Reads first line of supplied file or filehandle and returns it deserialized. ...@@ -456,21 +451,6 @@ Reads first line of supplied file or filehandle and returns it deserialized.
=back =back
=head1 TRANSIENCE
Data::Serializer is aware of Tie::Transient. What this means is that you use
Tie::Transient as normal, and when your object is serialized, the transient
components will be automatically removed for you.
Tie::Transient is not on CPAN, and doesn't look like it ever will be. With
the advent of attributes from 5.8 this feature should probably be deprecated
anyway.
If you would like to use Tie::Transient you can download it directly
from Brian's site here: http://www.maz.org/perl/Tie-Transient-0.05.tar.gz
With perl attributes in 5.8, this should probably be deprecated.
=head1 AUTHOR =head1 AUTHOR
Neil Neely <F<neil@neely.cx>>. Neil Neely <F<neil@neely.cx>>.
...@@ -487,8 +467,6 @@ http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Serializer ...@@ -487,8 +467,6 @@ http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Serializer
=head1 TODO =head1 TODO
Phase out support for Tie::Transient
Extend the persistent framework. Perhaps L<Persistent::Base(3)> framework Extend the persistent framework. Perhaps L<Persistent::Base(3)> framework
would be useful to explore further. Volunteers for putting this together would be useful to explore further. Volunteers for putting this together
would be welcome. would be welcome.
...@@ -563,8 +541,6 @@ This module is dedicated to my beautiful wife Erica. ...@@ -563,8 +541,6 @@ This module is dedicated to my beautiful wife Erica.
=item L<IO::File(3)> =item L<IO::File(3)>
=item L<Tie::Transient(3)>
=back =back
=cut =cut
...@@ -721,9 +697,7 @@ sub serialize { ...@@ -721,9 +697,7 @@ sub serialize {
#define serializer for token #define serializer for token
$serializer = $self->serializer; $serializer = $self->serializer;
&Tie::Transient::hide_transients() if ($self->_transient());
my $value = $self->_serialize(\@_,$serializer); my $value = $self->_serialize(\@_,$serializer);
&Tie::Transient::show_transients() if ($self->_transient());
if ($self->compress) { if ($self->compress) {
$compressor = $self->compressor; $compressor = $self->compressor;
...@@ -873,9 +847,7 @@ sub deserialize { ...@@ -873,9 +847,7 @@ sub deserialize {
$value = $self->_decompress($value); $value = $self->_decompress($value);
} }
#we always deserialize no matter what. #we always deserialize no matter what.
&Tie::Transient::show_transients() if ($self->_transient());
my @return = $self->_deserialize($value,$serializer); my @return = $self->_deserialize($value,$serializer);
&Tie::Transient::hide_transients() if ($self->_transient());
return wantarray ? @return : $return[0]; return wantarray ? @return : $return[0];
} }
......
...@@ -6,10 +6,10 @@ use strict; ...@@ -6,10 +6,10 @@ use strict;
use JSON; use JSON;
use vars qw($VERSION @ISA); use vars qw($VERSION @ISA);
$VERSION = '0.02'; $VERSION = '0.03';
sub serialize { sub serialize {
return JSON->VERSION < 2 ? JSON->new->objToJson($_[1]) : JSON->new->encode($_[1]); return JSON->VERSION < 2 ? JSON->new->objToJson($_[1]) : JSON->new->utf8->encode($_[1]);
} }
sub deserialize { sub deserialize {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment