r8194 - in /trunk/libjson-any-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/JSON/ t/

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Thu Oct 11 06:57:53 UTC 2007


Author: dmn
Date: Thu Oct 11 06:57:53 2007
New Revision: 8194

URL: http://svn.debian.org/wsvn/?sc=1&rev=8194
Log:
* New upstream release
  Improves unicode support

Added:
    trunk/libjson-any-perl/t/10_unicode.t
      - copied unchanged from r8193, branches/upstream/libjson-any-perl/current/t/10_unicode.t
Modified:
    trunk/libjson-any-perl/Changes
    trunk/libjson-any-perl/MANIFEST
    trunk/libjson-any-perl/META.yml
    trunk/libjson-any-perl/debian/changelog
    trunk/libjson-any-perl/inc/Module/Install.pm
    trunk/libjson-any-perl/inc/Module/Install/AutoInstall.pm
    trunk/libjson-any-perl/inc/Module/Install/Base.pm
    trunk/libjson-any-perl/inc/Module/Install/Can.pm
    trunk/libjson-any-perl/inc/Module/Install/Fetch.pm
    trunk/libjson-any-perl/inc/Module/Install/Include.pm
    trunk/libjson-any-perl/inc/Module/Install/Makefile.pm
    trunk/libjson-any-perl/inc/Module/Install/Metadata.pm
    trunk/libjson-any-perl/inc/Module/Install/Win32.pm
    trunk/libjson-any-perl/inc/Module/Install/WriteAll.pm
    trunk/libjson-any-perl/lib/JSON/Any.pm

Modified: trunk/libjson-any-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/Changes?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/Changes (original)
+++ trunk/libjson-any-perl/Changes Thu Oct 11 06:57:53 2007
@@ -1,4 +1,36 @@
 Revision history for JSON-Any
+
+1.09	???
+        o also test for is_utf8() - nothingmuch
+        o improve unicode test	- nothingmuch
+        o add utf8 support for JSON::{Converter,Parser}	- nothingmuch
+        o Add a test for unicode strings	- nothingmuch
+
+1.08	18 May 2007
+
+        o Fix Packaging
+        o Fix JSON.pm backend tests 
+        o fix issues with JSON::XS being pedantic about how it's methods/functions are called
+        o added a carp requirement		
+
+1.07	???
+
+        o changed Makefile.PL to Module::Install
+        o helps if I test 04-ENV.t against the code it was designed for
+        o skip all 04-ENV.t until I get it working
+        o fixing tests
+        o change to skip_all based skippage
+        o add example directory
+        o pod updates
+
+1.06	???
+
+        o cleaned up t/04-ENV.t to not require JSON::XS anymore
+        o fixed split on uninitalized value error
+        o cleaned up JSON-XS tests a bit
+        o added 04-ENV.t to MANIFEST
+
+... History is Elusive ... 
 
 1.00    Fri Mar 23 10:24:50 EDT 2007
         o Initial Release

Modified: trunk/libjson-any-perl/MANIFEST
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/MANIFEST?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/MANIFEST (original)
+++ trunk/libjson-any-perl/MANIFEST Thu Oct 11 06:57:53 2007
@@ -12,7 +12,7 @@
 inc/Module/Install/WriteAll.pm
 lib/JSON/Any.pm
 Makefile.PL
-MANIFEST
+MANIFEST			This list of files
 META.yml
 README
 t/00-load.t
@@ -20,6 +20,7 @@
 t/02-JSON-XS.t
 t/03-JSON-DWIW.t
 t/04-ENV.t
+t/10_unicode.t
 t/kwalitee.t
 t/pod-coverage.t
 t/pod.t

Modified: trunk/libjson-any-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/META.yml?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/META.yml (original)
+++ trunk/libjson-any-perl/META.yml Thu Oct 11 06:57:53 2007
@@ -4,7 +4,7 @@
 build_requires: 
   Test::More: 0
 distribution_type: module
-generated_by: Module::Install version 0.65
+generated_by: Module::Install version 0.67
 license: perl
 meta-spec: 
   url: http://module-build.sourceforge.net/META-spec-v1.3.html
@@ -17,4 +17,4 @@
     - t
 requires: 
   Carp: 0
-version: 1.08
+version: 1.09

Modified: trunk/libjson-any-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/debian/changelog?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/debian/changelog (original)
+++ trunk/libjson-any-perl/debian/changelog Thu Oct 11 06:57:53 2007
@@ -1,3 +1,10 @@
+libjson-any-perl (1.09-1) UNRELEASED; urgency=low
+
+  * New upstream release
+    Improves unicode support
+
+ -- Damyan Ivanov <dmn at debian.org>  Thu, 11 Oct 2007 09:57:36 +0300
+
 libjson-any-perl (1.08-2) UNRELEASED; urgency=low
 
   * debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser

Modified: trunk/libjson-any-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install.pm Thu Oct 11 06:57:53 2007
@@ -28,7 +28,7 @@
     # This is not enforced yet, but will be some time in the next few
     # releases once we can make sure it won't clash with custom
     # Module::Install extensions.
-    $VERSION = '0.65';
+    $VERSION = '0.67';
 }
 
 # Whether or not inc::Module::Install is actually loaded, the

Modified: trunk/libjson-any-perl/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install/AutoInstall.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install/AutoInstall.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install/AutoInstall.pm Thu Oct 11 06:57:53 2007
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.65';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/libjson-any-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install/Base.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install/Base.pm Thu Oct 11 06:57:53 2007
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.65';
+$VERSION = '0.67';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: trunk/libjson-any-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install/Can.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install/Can.pm Thu Oct 11 06:57:53 2007
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.65';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/libjson-any-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install/Fetch.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install/Fetch.pm Thu Oct 11 06:57:53 2007
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.65';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/libjson-any-perl/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install/Include.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install/Include.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install/Include.pm Thu Oct 11 06:57:53 2007
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.65';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/libjson-any-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install/Makefile.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install/Makefile.pm Thu Oct 11 06:57:53 2007
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.65';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -17,196 +17,221 @@
 my %seen = ();
 
 sub prompt {
-    shift;
-
-    # Infinite loop protection
-    my @c = caller();
-    if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
-        die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
-    }
-
-    # In automated testing, always use defaults
-    if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
-        local $ENV{PERL_MM_USE_DEFAULT} = 1;
-        goto &ExtUtils::MakeMaker::prompt;
-    } else {
-        goto &ExtUtils::MakeMaker::prompt;
-    }
+	shift;
+
+	# Infinite loop protection
+	my @c = caller();
+	if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
+		die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
+	}
+
+	# In automated testing, always use defaults
+	if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) {
+		local $ENV{PERL_MM_USE_DEFAULT} = 1;
+		goto &ExtUtils::MakeMaker::prompt;
+	} else {
+		goto &ExtUtils::MakeMaker::prompt;
+	}
 }
 
 sub makemaker_args {
-    my $self = shift;
-    my $args = ($self->{makemaker_args} ||= {});
-    %$args = ( %$args, @_ ) if @_;
-    $args;
+	my $self = shift;
+	my $args = ($self->{makemaker_args} ||= {});
+	%$args = ( %$args, @_ ) if @_;
+	$args;
 }
 
 # For mm args that take multiple space-seperated args,
 # append an argument to the current list.
 sub makemaker_append {
-    my $self = shift;
-    my $name = shift;
-    my $args = $self->makemaker_args;
-    $args->{name} = defined $args->{$name}
-    	? join( ' ', $args->{name}, @_ )
-    	: join( ' ', @_ );
+	my $self = sShift;
+	my $name = shift;
+	my $args = $self->makemaker_args;
+	$args->{name} = defined $args->{$name}
+		? join( ' ', $args->{name}, @_ )
+		: join( ' ', @_ );
 }
 
 sub build_subdirs {
-    my $self    = shift;
-    my $subdirs = $self->makemaker_args->{DIR} ||= [];
-    for my $subdir (@_) {
-        push @$subdirs, $subdir;
-    }
+	my $self    = shift;
+	my $subdirs = $self->makemaker_args->{DIR} ||= [];
+	for my $subdir (@_) {
+		push @$subdirs, $subdir;
+	}
 }
 
 sub clean_files {
-    my $self  = shift;
-    my $clean = $self->makemaker_args->{clean} ||= {};
-    %$clean = (
-        %$clean, 
-        FILES => join(' ', grep length, $clean->{FILES}, @_),
-    );
+	my $self  = shift;
+	my $clean = $self->makemaker_args->{clean} ||= {};
+	%$clean = (
+		%$clean, 
+		FILES => join(' ', grep length, $clean->{FILES}, @_),
+	);
 }
 
 sub realclean_files {
-    my $self  = shift;
-    my $realclean = $self->makemaker_args->{realclean} ||= {};
-    %$realclean = (
-        %$realclean, 
-        FILES => join(' ', grep length, $realclean->{FILES}, @_),
-    );
+	my $self  = shift;
+	my $realclean = $self->makemaker_args->{realclean} ||= {};
+	%$realclean = (
+		%$realclean, 
+		FILES => join(' ', grep length, $realclean->{FILES}, @_),
+	);
 }
 
 sub libs {
-    my $self = shift;
-    my $libs = ref $_[0] ? shift : [ shift ];
-    $self->makemaker_args( LIBS => $libs );
+	my $self = shift;
+	my $libs = ref $_[0] ? shift : [ shift ];
+	$self->makemaker_args( LIBS => $libs );
 }
 
 sub inc {
-    my $self = shift;
-    $self->makemaker_args( INC => shift );
+	my $self = shift;
+	$self->makemaker_args( INC => shift );
+}
+
+my %test_dir = ();
+
+sub _wanted_t {
+	/\.t$/ and -f $_ and $test_dir{$File::Find::dir} = 1;
+}
+
+sub tests_recursive {
+	my $self = shift;
+	if ( $self->tests ) {
+		die "tests_recursive will not work if tests are already defined";
+	}
+	my $dir = shift || 't';
+	unless ( -d $dir ) {
+		die "tests_recursive dir '$dir' does not exist";
+	}
+	require File::Find;
+	%test_dir = ();
+	File::Find::find( \&_wanted_t, $dir );
+	$self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
 }
 
 sub write {
-    my $self = shift;
-    die "&Makefile->write() takes no arguments\n" if @_;
-
-    my $args = $self->makemaker_args;
-    $args->{DISTNAME} = $self->name;
-    $args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);
-    $args->{VERSION}  = $self->version || $self->determine_VERSION($args);
-    $args->{NAME}     =~ s/-/::/g;
-    if ( $self->tests ) {
-        $args->{test} = { TESTS => $self->tests };
-    }
-    if ($] >= 5.005) {
-        $args->{ABSTRACT} = $self->abstract;
-        $args->{AUTHOR}   = $self->author;
-    }
-    if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
-        $args->{NO_META} = 1;
-    }
-    if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
-        $args->{SIGN} = 1;
-    }
-    unless ( $self->is_admin ) {
-        delete $args->{SIGN};
-    }
-
-    # merge both kinds of requires into prereq_pm
-    my $prereq = ($args->{PREREQ_PM} ||= {});
-    %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_,
-                 ($self->build_requires, $self->requires) );
-
-    # merge both kinds of requires into prereq_pm
-    my $subdirs = ($args->{DIR} ||= []);
-    if ($self->bundles) {
-        foreach my $bundle (@{ $self->bundles }) {
-            my ($file, $dir) = @$bundle;
-            push @$subdirs, $dir if -d $dir;
-            delete $prereq->{$file};
-        }
-    }
-
-    if ( my $perl_version = $self->perl_version ) {
-        eval "use $perl_version; 1"
-            or die "ERROR: perl: Version $] is installed, "
-                . "but we need version >= $perl_version";
-    }
-
-    $args->{INSTALLDIRS} = $self->installdirs;
-
-    my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
-
-    my $user_preop = delete $args{dist}->{PREOP};
-    if (my $preop = $self->admin->preop($user_preop)) {
-        $args{dist} = $preop;
-    }
-
-    my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
-    $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
+	my $self = shift;
+	die "&Makefile->write() takes no arguments\n" if @_;
+
+	my $args = $self->makemaker_args;
+	$args->{DISTNAME} = $self->name;
+	$args->{NAME}     = $self->module_name || $self->name || $self->determine_NAME($args);
+	$args->{VERSION}  = $self->version || $self->determine_VERSION($args);
+	$args->{NAME}     =~ s/-/::/g;
+	if ( $self->tests ) {
+		$args->{test} = { TESTS => $self->tests };
+	}
+	if ($] >= 5.005) {
+		$args->{ABSTRACT} = $self->abstract;
+		$args->{AUTHOR}   = $self->author;
+	}
+	if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+		$args->{NO_META} = 1;
+	}
+	if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+		$args->{SIGN} = 1;
+	}
+	unless ( $self->is_admin ) {
+		delete $args->{SIGN};
+	}
+
+	# merge both kinds of requires into prereq_pm
+	my $prereq = ($args->{PREREQ_PM} ||= {});
+	%$prereq = ( %$prereq,
+		map { @$_ }
+		map { @$_ }
+		grep $_,
+		($self->build_requires, $self->requires)
+	);
+
+	# merge both kinds of requires into prereq_pm
+	my $subdirs = ($args->{DIR} ||= []);
+	if ($self->bundles) {
+		foreach my $bundle (@{ $self->bundles }) {
+			my ($file, $dir) = @$bundle;
+			push @$subdirs, $dir if -d $dir;
+			delete $prereq->{$file};
+		}
+	}
+
+	if ( my $perl_version = $self->perl_version ) {
+		eval "use $perl_version; 1"
+			or die "ERROR: perl: Version $] is installed, "
+			. "but we need version >= $perl_version";
+	}
+
+	$args->{INSTALLDIRS} = $self->installdirs;
+
+	my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
+
+	my $user_preop = delete $args{dist}->{PREOP};
+	if (my $preop = $self->admin->preop($user_preop)) {
+		$args{dist} = $preop;
+	}
+
+	my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
+	$self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
 }
 
 sub fix_up_makefile {
-    my $self          = shift;
-    my $makefile_name = shift;
-    my $top_class     = ref($self->_top) || '';
-    my $top_version   = $self->_top->VERSION || '';
-
-    my $preamble = $self->preamble 
-        ? "# Preamble by $top_class $top_version\n"
-            . $self->preamble
-        : '';
-    my $postamble = "# Postamble by $top_class $top_version\n"
-        . ($self->postamble || '');
-
-    local *MAKEFILE;
-    open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
-    my $makefile = do { local $/; <MAKEFILE> };
-    close MAKEFILE or die $!;
-
-    $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
-    $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
-    $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
-    $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
-    $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
-
-    # Module::Install will never be used to build the Core Perl
-    # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
-    # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
-    $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
-    #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
-
-    # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
-    $makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
-
-    # XXX - This is currently unused; not sure if it breaks other MM-users
-    # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
-
-    open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
-    print MAKEFILE  "$preamble$makefile$postamble" or die $!;
-    close MAKEFILE  or die $!;
-
-    1;
+	my $self          = shift;
+	my $makefile_name = shift;
+	my $top_class     = ref($self->_top) || '';
+	my $top_version   = $self->_top->VERSION || '';
+
+	my $preamble = $self->preamble 
+		? "# Preamble by $top_class $top_version\n"
+			. $self->preamble
+		: '';
+	my $postamble = "# Postamble by $top_class $top_version\n"
+		. ($self->postamble || '');
+
+	local *MAKEFILE;
+	open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	my $makefile = do { local $/; <MAKEFILE> };
+	close MAKEFILE or die $!;
+
+	$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
+	$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
+	$makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+	$makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
+	$makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
+
+	# Module::Install will never be used to build the Core Perl
+	# Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
+	# PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
+	$makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
+	#$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
+
+	# Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
+	$makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g;
+
+	# XXX - This is currently unused; not sure if it breaks other MM-users
+	# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
+
+	open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	print MAKEFILE  "$preamble$makefile$postamble" or die $!;
+	close MAKEFILE  or die $!;
+
+	1;
 }
 
 sub preamble {
-    my ($self, $text) = @_;
-    $self->{preamble} = $text . $self->{preamble} if defined $text;
-    $self->{preamble};
+	my ($self, $text) = @_;
+	$self->{preamble} = $text . $self->{preamble} if defined $text;
+	$self->{preamble};
 }
 
 sub postamble {
-    my ($self, $text) = @_;
-    $self->{postamble} ||= $self->admin->postamble;
-    $self->{postamble} .= $text if defined $text;
-    $self->{postamble}
+	my ($self, $text) = @_;
+	$self->{postamble} ||= $self->admin->postamble;
+	$self->{postamble} .= $text if defined $text;
+	$self->{postamble}
 }
 
 1;
 
 __END__
 
-#line 338
+#line 363

Modified: trunk/libjson-any-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install/Metadata.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install/Metadata.pm Thu Oct 11 06:57:53 2007
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.65';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -56,14 +56,23 @@
     };
 }
 
-sub install_as_core   { $_[0]->installdirs('perl')   }
-sub install_as_cpan   { $_[0]->installdirs('site')   }
-sub install_as_site   { $_[0]->installdirs('site')   }
-sub install_as_vendor { $_[0]->installdirs('vendor') }
+# configure_requires is currently a null-op
+sub configure_requires { 1 }
+
+# Aliases for build_requires that will have alternative
+# meanings in some future version of META.yml.
+sub test_requires      { shift->build_requires(@_)  }
+sub install_requires   { shift->build_requires(@_)  }
+
+# Aliases for installdirs options
+sub install_as_core    { $_[0]->installdirs('perl')   }
+sub install_as_cpan    { $_[0]->installdirs('site')   }
+sub install_as_site    { $_[0]->installdirs('site')   }
+sub install_as_vendor  { $_[0]->installdirs('vendor') }
 
 sub sign {
     my $self = shift;
-    return $self->{'values'}{'sign'} if defined wantarray and !@_;
+    return $self->{'values'}{'sign'} if defined wantarray and ! @_;
     $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 );
     return $self;
 }
@@ -296,20 +305,24 @@
     {
         my $license_text = $1;
         my @phrases      = (
-            'under the same (?:terms|license) as perl itself' => 'perl',
-            'GNU public license'                              => 'gpl',
-            'GNU lesser public license'                       => 'gpl',
-            'BSD license'                                     => 'bsd',
-            'Artistic license'                                => 'artistic',
-            'GPL'                                             => 'gpl',
-            'LGPL'                                            => 'lgpl',
-            'BSD'                                             => 'bsd',
-            'Artistic'                                        => 'artistic',
-            'MIT'                                             => 'MIT',
+            'under the same (?:terms|license) as perl itself' => 'perl',        1,
+            'GNU public license'                              => 'gpl',         1,
+            'GNU lesser public license'                       => 'gpl',         1,
+            'BSD license'                                     => 'bsd',         1,
+            'Artistic license'                                => 'artistic',    1,
+            'GPL'                                             => 'gpl',         1,
+            'LGPL'                                            => 'lgpl',        1,
+            'BSD'                                             => 'bsd',         1,
+            'Artistic'                                        => 'artistic',    1,
+            'MIT'                                             => 'mit',         1,
+            'proprietary'                                     => 'proprietary', 0,
         );
-        while ( my ( $pattern, $license ) = splice( @phrases, 0, 2 ) ) {
+        while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
             $pattern =~ s{\s+}{\\s+}g;
             if ( $license_text =~ /\b$pattern\b/i ) {
+                if ( $osi and $license_text =~ /All rights reserved/i ) {
+                        warn "LEGAL WARNING: 'All rights reserved' may invalidate Open Source licenses. Consider removing it.";
+		}
                 $self->license($license);
                 return 1;
             }

Modified: trunk/libjson-any-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install/Win32.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install/Win32.pm Thu Oct 11 06:57:53 2007
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.65';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/libjson-any-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/inc/Module/Install/WriteAll.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libjson-any-perl/inc/Module/Install/WriteAll.pm Thu Oct 11 06:57:53 2007
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.65';
+	$VERSION = '0.67';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: trunk/libjson-any-perl/lib/JSON/Any.pm
URL: http://svn.debian.org/wsvn/trunk/libjson-any-perl/lib/JSON/Any.pm?rev=8194&op=diff
==============================================================================
--- trunk/libjson-any-perl/lib/JSON/Any.pm (original)
+++ trunk/libjson-any-perl/lib/JSON/Any.pm Thu Oct 11 06:57:53 2007
@@ -1,6 +1,6 @@
 ##############################################################################
 # JSON::Any
-# v1.08
+# v1.09
 # Copyright (c) 2007 Chris Thompson
 ##############################################################################
 
@@ -16,23 +16,27 @@
 
 =head1 VERSION
 
-Version 1.08
-
-=cut
-
-our $VERSION = '1.08';
+Version 1.09
+
+=cut
+
+our $VERSION = '1.09';
+
+our $UTF8;
 
 my ( %conf, $handler, $encoder, $decoder );
 use constant HANDLER => 0;
 use constant ENCODER => 1;
 use constant DECODER => 2;
+use constant UTF8    => 3;
+
 BEGIN {
     %conf = (
         json => {
             encoder       => 'objToJson',
             decoder       => 'jsonToObj',
             create_object => sub {
-                my ($self, $conf) = @_;
+                my ( $self, $conf ) = @_;
                 my @params = qw(
                   autoconv
                   skipinvalid
@@ -44,9 +48,10 @@
                   convblessed
                   selfconvert
                   singlequote
+                  utf8
                 );
                 $self->[ENCODER] = 'objToJson';
-                $self->[DECODER] = 'jsonToObj',
+                $self->[DECODER] = 'jsonToObj';
                 $self->[HANDLER] = $handler->new( map { $_ => $conf->{$_} } @params );
             },
         },
@@ -55,10 +60,11 @@
             encoder       => 'to_json',
             decoder       => 'from_json',
             create_object => sub {
-                my ($self, $conf) = @_;
+                my ( $self, $conf ) = @_;
                 my @params = qw(bare_keys);
+                croak "JSON::DWIW does not support utf8" if $conf->{utf8};
                 $self->[ENCODER] = 'to_json';
-                $self->[DECODER] = 'from_json',                
+                $self->[DECODER] = 'from_json';
                 $self->[HANDLER] = $handler->new( { map { $_ => $conf->{$_} } @params } );
             },
         },
@@ -67,7 +73,9 @@
             encoder       => 'to_json',
             decoder       => 'from_json',
             create_object => sub {
-                my ($self, $conf) = @_;
+                require utf8;
+                utf8->import();
+                my ( $self, $conf ) = @_;
 
                 my @params = qw(
                   ascii
@@ -88,7 +96,11 @@
                     $obj = $obj->$mutator( $conf->{$mutator} );
                 }
                 $self->[ENCODER] = 'encode';
-                $self->[DECODER] = 'decode',                
+                $self->[DECODER] = sub {
+                    my ( $handler, $json ) = @_;
+                    utf8::encode($json) if utf8::is_utf8($json);
+                    $handler->decode($json);
+                };
                 $self->[HANDLER] = $obj;
             },
         },
@@ -108,10 +120,8 @@
 
     ( $handler, $encoder, $decoder ) = ();
 
-    if ( $ENV{JSON_ANY_ORDER} ) {
-        next if @order;
-        @order = split /\s/, $ENV{JSON_ANY_ORDER};
-    }
+    @order = split /\s/, $ENV{JSON_ANY_ORDER}
+      if !@order and $ENV{JSON_ANY_ORDER};
     @order = qw(XS JSON DWIW Syck) unless @order;
 
     foreach my $testmod (@order) {
@@ -196,6 +206,15 @@
 standpoint this is really only helpful for those paramters that happen
 to have the same name. This will be addressed in a future release.
 
+The one parameter that is universally supported (to the extent that is
+supported by the underlying JSON modules) is C<utf8>. When this parameter is
+enabled all resulting JSON will be marked as unicode, and all unicode strings
+in the input data structure will be preserved as such.
+
+The actual output will vary, for example L<JSON> will encode and decode unicode
+chars (the resulting JSON is not unicode) wheras L<JSON::XS> will emit unicode
+JSON.
+
 =back
 
 =cut
@@ -210,7 +229,8 @@
             push @config, map { split /=/, $_ } split /,\s*/,
               $ENV{JSON_ANY_CONFIG};
         }
-        $creator->( $self, {@config} );
+        $creator->( $self, my $conf = {@config} );
+        $self->[UTF8] = $conf->{utf8};
     }
     return $self;
 }
@@ -265,13 +285,26 @@
     my $self = shift;
     my $obj  = shift;
     croak 'must provide object to convert' unless defined $obj;
+
+    my $json;
+
     if ( ref $self ) {
-        croak "No $handler Object created!" unless exists $self->[HANDLER];
-        my $method = $self->[HANDLER]->can($self->[ENCODER]);
-        croak "$handler can't execute $self->[ENCODER]" unless $method;
-        return $self->[HANDLER]->$method($obj);
+        my $method;
+        unless ( ref $self->[ENCODER] ) {
+            croak "No $handler Object created!" unless exists $self->[HANDLER];
+            $method = $self->[HANDLER]->can( $self->[ENCODER] );
+            croak "$handler can't execute $self->[ENCODER]" unless $method;
+        }
+        else {
+            $method = $self->[ENCODER];
+        }
+        $json = $self->[HANDLER]->$method($obj);
+    } else {
+        $json = $handler->can($encoder)->($obj);
     }
-    return $handler->can($encoder)->($obj);
+
+    utf8::decode($json) if (ref $self ? $self->[UTF8] : $UTF8 ) and !utf8::is_utf8($json) and utf8::valid($json);
+    return $json;
 }
 
 =over
@@ -289,12 +322,9 @@
 
 =cut
 
-{
-    no strict "refs";
-    *to_json = \&objToJson;
-    *Dump    = \&objToJson;
-    *encode  = \&objToJson;
-}
+*to_json = \&objToJson;
+*Dump    = \&objToJson;
+*encode  = \&objToJson;
 
 =over
 
@@ -310,11 +340,18 @@
 sub jsonToObj {
     my $self = shift;
     my $obj  = shift;
-        croak 'must provide json to convert' unless defined $obj;
+    croak 'must provide json to convert' unless defined $obj;
+
     if ( ref $self ) {
-        croak "No $handler Object created!" unless exists $self->[HANDLER];
-        my $method = $self->[HANDLER]->can($self->[DECODER]);
-        croak "$handler can't execute $self->[DECODER]" unless $method;
+        my $method;
+        unless ( ref $self->[DECODER] ) {
+            croak "No $handler Object created!" unless exists $self->[HANDLER];
+            $method = $self->[HANDLER]->can( $self->[DECODER] );
+            croak "$handler can't execute $self->[DECODER]" unless $method;
+        }
+        else {
+            $method = $self->[DECODER];
+        }
         return $self->[HANDLER]->$method($obj);
     }
     $handler->can($decoder)->($obj);
@@ -335,12 +372,9 @@
 
 =cut
 
-{
-    no strict "refs";
-    *from_json = \&jsonToObj;
-    *Load      = \&jsonToObj;
-    *decode    = \&jsonToObj;
-}
+*from_json = \&jsonToObj;
+*Load      = \&jsonToObj;
+*decode    = \&jsonToObj;
 
 =head1 AUTHOR
 
@@ -367,7 +401,7 @@
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2007 Chris Thompson, all rights reserved.
+Copyright 2007 Chris Thompson, some rights reserved.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.




More information about the Pkg-perl-cvs-commits mailing list