From: Dave Rolsky Date: Thu, 21 Aug 2008 14:37:23 +0000 (+0000) Subject: Updates to work with the latest dev release of Moose X-Git-Tag: 0.09_02~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Singleton.git;a=commitdiff_plain;h=ede8dce0a097ce38426064a0eae5aa1ad14a54e6 Updates to work with the latest dev release of Moose --- diff --git a/ChangeLog b/ChangeLog index 2504855..0994f86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ Revision history for Perl extension MooseX-Singleton +0.09_01 2008-06-27 + - fixes to work with the latest dev release of Moose - 0.55_01 (Dave Rolsky) + 0.09 2008-06-27 - fix immutability to work with Moose 0.51 (Dave Rolsky) diff --git a/lib/MooseX/Singleton.pm b/lib/MooseX/Singleton.pm index 179e40d..2a664ff 100644 --- a/lib/MooseX/Singleton.pm +++ b/lib/MooseX/Singleton.pm @@ -1,22 +1,24 @@ package MooseX::Singleton; -use Moose; + +use Moose (); +use Moose::Exporter; use MooseX::Singleton::Object; use MooseX::Singleton::Meta::Class; -our $VERSION = 0.09; - -sub import { - my $caller = caller; +our $VERSION = '0.09_01'; +$VERSION = eval $VERSION; - Moose::init_meta($caller, 'MooseX::Singleton::Object', 'MooseX::Singleton::Meta::Class'); +Moose::Exporter->setup_import_methods( also => 'Moose' ); - Moose->import({into => $caller}); - strict->import; - warnings->import; +sub init_meta { + shift; + Moose->init_meta( + @_, + base_class => 'MooseX::Singleton::Object', + metaclass => 'MooseX::Singleton::Meta::Class', + ); } -no Moose; - 1; __END__ diff --git a/lib/MooseX/Singleton/Meta/Method/Constructor.pm b/lib/MooseX/Singleton/Meta/Method/Constructor.pm index c27085f..b3ec6a8 100644 --- a/lib/MooseX/Singleton/Meta/Method/Constructor.pm +++ b/lib/MooseX/Singleton/Meta/Method/Constructor.pm @@ -64,7 +64,7 @@ sub initialize_body { $code = eval $source; confess "Could not eval the constructor :\n\n$source\n\nbecause :\n\n$@" if $@; } - $self->{'&!body'} = $code; + $self->{'body'} = $code; } no Moose;