r38423 - in /trunk/libmoosex-singleton-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/MooseX/ lib/MooseX/Singleton/Meta/Method/ t/

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Mon Jun 22 05:33:49 UTC 2009


Author: ryan52-guest
Date: Mon Jun 22 05:33:43 2009
New Revision: 38423

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=38423
Log:
* New upstream release
* Add debian/README.source to document quilt usage, as required by
  Debian Policy since 3.8.0.

Added:
    trunk/libmoosex-singleton-perl/debian/README.source
Modified:
    trunk/libmoosex-singleton-perl/ChangeLog
    trunk/libmoosex-singleton-perl/META.yml
    trunk/libmoosex-singleton-perl/Makefile.PL
    trunk/libmoosex-singleton-perl/README
    trunk/libmoosex-singleton-perl/debian/changelog
    trunk/libmoosex-singleton-perl/inc/Module/Install.pm
    trunk/libmoosex-singleton-perl/inc/Module/Install/Base.pm
    trunk/libmoosex-singleton-perl/inc/Module/Install/Can.pm
    trunk/libmoosex-singleton-perl/inc/Module/Install/Fetch.pm
    trunk/libmoosex-singleton-perl/inc/Module/Install/Makefile.pm
    trunk/libmoosex-singleton-perl/inc/Module/Install/Metadata.pm
    trunk/libmoosex-singleton-perl/inc/Module/Install/Win32.pm
    trunk/libmoosex-singleton-perl/inc/Module/Install/WriteAll.pm
    trunk/libmoosex-singleton-perl/lib/MooseX/Singleton.pm
    trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Meta/Method/Constructor.pm
    trunk/libmoosex-singleton-perl/t/003-immutable.t

Modified: trunk/libmoosex-singleton-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/ChangeLog?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/ChangeLog (original)
+++ trunk/libmoosex-singleton-perl/ChangeLog Mon Jun 22 05:33:43 2009
@@ -1,7 +1,10 @@
 Revision history for Perl extension MooseX-Singleton
 
+0.18 2009-06-21
+    - Changes to work Moose 0.82 (Dave Rolsky)	
+	
 0.17 2009-04-24
-		- Add ClassName->_clear_instance. (hdp)
+    - Add ClassName->_clear_instance. (hdp)
 
 0.16 2009-04-24
     - Changes to keep constructor inlining working with latest Moose &

Modified: trunk/libmoosex-singleton-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/META.yml?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/META.yml (original)
+++ trunk/libmoosex-singleton-perl/META.yml Mon Jun 22 05:33:43 2009
@@ -9,7 +9,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.85'
+generated_by: 'Module::Install version 0.91'
 license: Perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -20,7 +20,7 @@
     - inc
     - t
 requires:
-  Moose: 0.74
+  Moose: 0.82
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.17
+version: 0.18

Modified: trunk/libmoosex-singleton-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/Makefile.PL?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/Makefile.PL (original)
+++ trunk/libmoosex-singleton-perl/Makefile.PL Mon Jun 22 05:33:43 2009
@@ -5,7 +5,7 @@
 name 'MooseX-Singleton';
 all_from 'lib/MooseX/Singleton.pm';
 
-requires 'Moose' => '0.74';
+requires 'Moose' => '0.82';
 
 build_requires 'Test::More';
 build_requires 'Test::Exception';

Modified: trunk/libmoosex-singleton-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/README?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/README (original)
+++ trunk/libmoosex-singleton-perl/README Mon Jun 22 05:33:43 2009
@@ -2,7 +2,7 @@
     MooseX::Singleton - turn your Moose class into a singleton
 
 VERSION
-    Version 0.16
+    Version 0.18
 
 SYNOPSIS
         package MyApp;

Added: trunk/libmoosex-singleton-perl/debian/README.source
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/debian/README.source?rev=38423&op=file
==============================================================================
--- trunk/libmoosex-singleton-perl/debian/README.source (added)
+++ trunk/libmoosex-singleton-perl/debian/README.source Mon Jun 22 05:33:43 2009
@@ -1,0 +1,5 @@
+This package uses quilt to manage all modifications to the upstream
+source.  Changes are stored in the source package as diffs in
+debian/patches and applied during the build.
+
+See /usr/share/doc/quilt/README.source for a detailed explanation.

Modified: trunk/libmoosex-singleton-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/debian/changelog?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/debian/changelog (original)
+++ trunk/libmoosex-singleton-perl/debian/changelog Mon Jun 22 05:33:43 2009
@@ -1,3 +1,11 @@
+libmoosex-singleton-perl (0.18-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * Add debian/README.source to document quilt usage, as required by
+    Debian Policy since 3.8.0.
+
+ -- Ryan Niebur <ryanryan52 at gmail.com>  Sun, 21 Jun 2009 22:33:34 -0700
+
 libmoosex-singleton-perl (0.17-1) unstable; urgency=low
 
   * Initial Release. (Closes: #533473)

Modified: trunk/libmoosex-singleton-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/inc/Module/Install.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/inc/Module/Install.pm (original)
+++ trunk/libmoosex-singleton-perl/inc/Module/Install.pm Mon Jun 22 05:33:43 2009
@@ -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.85';
+	$VERSION = '0.91';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -353,7 +353,7 @@
 	if ( $] >= 5.006 ) {
 		open( FH, '<', $_[0] ) or die "open($_[0]): $!";
 	} else {
-		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";	
+		open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
 	}
 	my $string = do { local $/; <FH> };
 	close FH or die "close($_[0]): $!";
@@ -384,7 +384,7 @@
 	if ( $] >= 5.006 ) {
 		open( FH, '>', $_[0] ) or die "open($_[0]): $!";
 	} else {
-		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";	
+		open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
 	}
 	foreach ( 1 .. $#_ ) {
 		print FH $_[$_] or die "print($_[0]): $!";

Modified: trunk/libmoosex-singleton-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/inc/Module/Install/Base.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libmoosex-singleton-perl/inc/Module/Install/Base.pm Mon Jun 22 05:33:43 2009
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.85';
+	$VERSION = '0.91';
 }
 
 # Suspend handler for "redefined" warnings
@@ -13,42 +13,34 @@
 	$SIG{__WARN__} = sub { $w };
 }
 
-### This is the ONLY module that shouldn't have strict on
-# use strict;
-
-#line 45
+#line 42
 
 sub new {
-	my ($class, %args) = @_;
-
-	foreach my $method ( qw(call load) ) {
-		next if defined &{"$class\::$method"};
-		*{"$class\::$method"} = sub {
-			shift()->_top->$method(@_);
-		};
+	my $class = shift;
+	unless ( defined &{"${class}::call"} ) {
+		*{"${class}::call"} = sub { shift->_top->call(@_) };
 	}
-
-	bless( \%args, $class );
+	unless ( defined &{"${class}::load"} ) {
+		*{"${class}::load"} = sub { shift->_top->load(@_) };
+	}
+	bless { @_ }, $class;
 }
 
-#line 66
+#line 61
 
 sub AUTOLOAD {
-	my $self = shift;
 	local $@;
-	my $autoload = eval {
-		$self->_top->autoload
-	} or return;
-	goto &$autoload;
+	my $func = eval { shift->_top->autoload } or return;
+	goto &$func;
 }
 
-#line 83
+#line 75
 
 sub _top {
 	$_[0]->{_top};
 }
 
-#line 98
+#line 90
 
 sub admin {
 	$_[0]->_top->{admin}
@@ -56,7 +48,7 @@
 	Module::Install::Base::FakeAdmin->new;
 }
 
-#line 114
+#line 106
 
 sub is_admin {
 	$_[0]->admin->VERSION;
@@ -83,4 +75,4 @@
 
 1;
 
-#line 162
+#line 154

Modified: trunk/libmoosex-singleton-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/inc/Module/Install/Can.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libmoosex-singleton-perl/inc/Module/Install/Can.pm Mon Jun 22 05:33:43 2009
@@ -2,16 +2,16 @@
 package Module::Install::Can;
 
 use strict;
-use Module::Install::Base;
-use Config              ();
-use File::Spec          ();
-use ExtUtils::MakeMaker ();
+use Config                ();
+use File::Spec            ();
+use ExtUtils::MakeMaker   ();
+use Module::Install::Base ();
 
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
 }
 
 # check if we can load some module

Modified: trunk/libmoosex-singleton-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/inc/Module/Install/Fetch.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libmoosex-singleton-perl/inc/Module/Install/Fetch.pm Mon Jun 22 05:33:43 2009
@@ -2,13 +2,13 @@
 package Module::Install::Fetch;
 
 use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
 
-use vars qw{$VERSION $ISCORE @ISA};
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
 }
 
 sub get_file {

Modified: trunk/libmoosex-singleton-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/inc/Module/Install/Makefile.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libmoosex-singleton-perl/inc/Module/Install/Makefile.pm Mon Jun 22 05:33:43 2009
@@ -2,14 +2,14 @@
 package Module::Install::Makefile;
 
 use strict 'vars';
-use Module::Install::Base;
-use ExtUtils::MakeMaker ();
-
-use vars qw{$VERSION $ISCORE @ISA};
+use ExtUtils::MakeMaker   ();
+use Module::Install::Base ();
+
+use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
-	@ISA     = qw{Module::Install::Base};
 }
 
 sub Makefile { $_[0] }

Modified: trunk/libmoosex-singleton-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/inc/Module/Install/Metadata.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libmoosex-singleton-perl/inc/Module/Install/Metadata.pm Mon Jun 22 05:33:43 2009
@@ -2,18 +2,17 @@
 package Module::Install::Metadata;
 
 use strict 'vars';
-use Module::Install::Base;
+use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
-	@ISA     = qw{Module::Install::Base};
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
 
 my @boolean_keys = qw{
 	sign
-	mymeta
 };
 
 my @scalar_keys = qw{
@@ -440,21 +439,21 @@
 	/ixms ) {
 		my $license_text = $1;
 		my @phrases      = (
-			'under the same (?:terms|license) as perl itself' => 'perl',        1,
-			'GNU general public license'                      => 'gpl',         1,
-			'GNU public license'                              => 'gpl',         1,
-			'GNU lesser general public license'               => 'lgpl',        1,
-			'GNU lesser public license'                       => 'lgpl',        1,
-			'GNU library general public license'              => 'lgpl',        1,
-			'GNU library public license'                      => 'lgpl',        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,
+			'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
+			'GNU general public license'         => 'gpl',         1,
+			'GNU public license'                 => 'gpl',         1,
+			'GNU lesser general public license'  => 'lgpl',        1,
+			'GNU lesser public license'          => 'lgpl',        1,
+			'GNU library general public license' => 'lgpl',        1,
+			'GNU library public license'         => 'lgpl',        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, $osi) = splice(@phrases, 0, 3) ) {
 			$pattern =~ s{\s+}{\\s+}g;
@@ -506,17 +505,29 @@
 	}
 }
 
+sub test_requires_from {
+	my $self     = shift;
+	my $content  = Module::Install::_readperl($_[0]);
+	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+	while ( @requires ) {
+		my $module  = shift @requires;
+		my $version = shift @requires;
+		$self->test_requires( $module => $version );
+	}
+}
+
 # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
 # numbers (eg, 5.006001 or 5.008009).
 # Also, convert double-part versions (eg, 5.8)
 sub _perl_version {
 	my $v = $_[-1];
-	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;	
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
 	$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
 	$v =~ s/(\.\d\d\d)000$/$1/;
 	$v =~ s/_.+$//;
 	if ( ref($v) ) {
-		$v = $v + 0; # Numify
+		# Numify
+		$v = $v + 0;
 	}
 	return $v;
 }
@@ -526,21 +537,56 @@
 
 
 ######################################################################
-# MYMETA.yml Support
+# MYMETA Support
 
 sub WriteMyMeta {
 	die "WriteMyMeta has been deprecated";
 }
 
-sub write_mymeta {
-	my $self = shift;
-	
-	# If there's no existing META.yml there is nothing we can do
-	return unless -f 'META.yml';
+sub write_mymeta_yaml {
+	my $self = shift;
 
 	# We need YAML::Tiny to write the MYMETA.yml file
 	unless ( eval { require YAML::Tiny; 1; } ) {
 		return 1;
+	}
+
+	# Generate the data
+	my $meta = $self->_write_mymeta_data or return 1;
+
+	# Save as the MYMETA.yml file
+	print "Writing MYMETA.yml\n";
+	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+}
+
+sub write_mymeta_json {
+	my $self = shift;
+
+	# We need JSON to write the MYMETA.json file
+	unless ( eval { require JSON; 1; } ) {
+		return 1;
+	}
+
+	# Generate the data
+	my $meta = $self->_write_mymeta_data or return 1;
+
+	# Save as the MYMETA.yml file
+	print "Writing MYMETA.json\n";
+	Module::Install::_write(
+		'MYMETA.json',
+		JSON->new->pretty(1)->canonical->encode($meta),
+	);
+}
+
+sub _write_mymeta_data {
+	my $self = shift;
+
+	# If there's no existing META.yml there is nothing we can do
+	return undef unless -f 'META.yml';
+
+	# We need Parse::CPAN::Meta to load the file
+	unless ( eval { require Parse::CPAN::Meta; 1; } ) {
+		return undef;
 	}
 
 	# Merge the perl version into the dependencies
@@ -558,7 +604,7 @@
 	}
 
 	# Load the advisory META.yml file
-	my @yaml = YAML::Tiny::LoadFile('META.yml');
+	my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
 	my $meta = $yaml[0];
 
 	# Overwrite the non-configure dependency hashs
@@ -572,9 +618,7 @@
 		$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
 	}
 
-	# Save as the MYMETA.yml file
-	print "Writing MYMETA.yml\n";
-	YAML::Tiny::DumpFile('MYMETA.yml', $meta);	
+	return $meta;
 }
 
 1;

Modified: trunk/libmoosex-singleton-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/inc/Module/Install/Win32.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libmoosex-singleton-perl/inc/Module/Install/Win32.pm Mon Jun 22 05:33:43 2009
@@ -2,12 +2,12 @@
 package Module::Install::Win32;
 
 use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
-	@ISA     = qw{Module::Install::Base};
+	$VERSION = '0.91';
+	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
 

Modified: trunk/libmoosex-singleton-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/inc/Module/Install/WriteAll.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libmoosex-singleton-perl/inc/Module/Install/WriteAll.pm Mon Jun 22 05:33:43 2009
@@ -2,11 +2,11 @@
 package Module::Install::WriteAll;
 
 use strict;
-use Module::Install::Base;
+use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.85';
+	$VERSION = '0.91';;
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }
@@ -41,8 +41,18 @@
 
 	# The Makefile write process adds a couple of dependencies,
 	# so write the META.yml files after the Makefile.
-	$self->Meta->write        if $args{meta};
-	$self->Meta->write_mymeta if $self->mymeta;
+	if ( $args{meta} ) {
+		$self->Meta->write;
+	}
+
+	# Experimental support for MYMETA
+	if ( $ENV{X_MYMETA} ) {
+		if ( $ENV{X_MYMETA} eq 'JSON' ) {
+			$self->Meta->write_mymeta_json;
+		} else {
+			$self->Meta->write_mymeta_yaml;
+		}
+	}
 
 	return 1;
 }

Modified: trunk/libmoosex-singleton-perl/lib/MooseX/Singleton.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/lib/MooseX/Singleton.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/lib/MooseX/Singleton.pm (original)
+++ trunk/libmoosex-singleton-perl/lib/MooseX/Singleton.pm Mon Jun 22 05:33:43 2009
@@ -1,11 +1,11 @@
 package MooseX::Singleton;
 
-use Moose 0.74 ();
+use Moose 0.82 ();
 use Moose::Exporter;
 use MooseX::Singleton::Object;
 use MooseX::Singleton::Meta::Class;
 
-our $VERSION = '0.17';
+our $VERSION = '0.18';
 $VERSION = eval $VERSION;
 
 Moose::Exporter->setup_import_methods( also => 'Moose' );
@@ -31,7 +31,7 @@
 
 =head1 VERSION
 
-Version 0.16, released 24 May 08
+Version 0.18, released 24 May 08
 
 =head1 SYNOPSIS
 

Modified: trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Meta/Method/Constructor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Meta/Method/Constructor.pm?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Meta/Method/Constructor.pm (original)
+++ trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Meta/Method/Constructor.pm Mon Jun 22 05:33:43 2009
@@ -43,7 +43,7 @@
         defined $_ ? $_->_compiled_type_constraint : undef;
     } @type_constraints;
 
-    my $code = $self->_compile_code(
+    my ( $code, $e ) = $self->_compile_code(
         code => $source,
         environment => {
             '$meta'  => \$self,
@@ -51,7 +51,10 @@
             '@type_constraints' => \@type_constraints,
             '@type_constraint_bodies' => \@type_constraint_bodies,
         },
-    ) or $self->throw_error("Could not eval the constructor :\n\n$source\n\nbecause :\n\n$@", error => $@, data => $source );
+    );
+
+    $self->throw_error("Could not eval the constructor :\n\n$source\n\nbecause :\n\n$e", error => $e, data => $source )
+        if $e;
 
     $self->{'body'} = $code;
 }

Modified: trunk/libmoosex-singleton-perl/t/003-immutable.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/t/003-immutable.t?rev=38423&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/t/003-immutable.t (original)
+++ trunk/libmoosex-singleton-perl/t/003-immutable.t Mon Jun 22 05:33:43 2009
@@ -12,7 +12,7 @@
     }
 }
 
-BEGIN {
+{
     package MooseX::Singleton::Test;
     use MooseX::Singleton;
 
@@ -39,7 +39,7 @@
 
         $self->bag->{$key} += $value;
     }
-
+__PACKAGE__->meta->make_immutable;
     ::warning_is sub { __PACKAGE__->meta->make_immutable }, '',
         'no warnings when calling make_immutable';
 }




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