Revision history for Perl extension MooseX-Singleton
+0.09 2008-06-27
+ - fix immutability to work with Moose 0.51 (Dave Rolsky)
+
0.08 2008-05-24
- fix make_immutable keyword in test (Sartak)
- immutable singleton objects did not call triggers in the constructor (Dave Rolsky)
name 'MooseX-Singleton';
all_from 'lib/MooseX/Singleton.pm';
-requires 'Moose' => '0.41';
+requires 'Moose' => '0.51';
build_requires 'Test::More';
build_requires 'Test::Exception';
use MooseX::Singleton::Object;
use MooseX::Singleton::Meta::Class;
-our $VERSION = 0.08;
+our $VERSION = 0.09;
sub import {
my $caller = caller;
$source .= "\n" . 'return $class->Moose::Object::new(@_)';
$source .= "\n" . ' if $class ne \'' . $self->associated_metaclass->name . '\';';
- $source .= "\n" . 'my %params = (scalar @_ == 1) ? %{$_[0]} : @_;';
+ $source .= "\n" . 'my $params = ' . $self->_generate_BUILDARGS('$class', '@_');
- $source .= "\n" . 'my $instance = ' . $self->meta_instance->inline_create_instance('$class');
+ $source .= ";\n" . 'my $instance = ' . $self->meta_instance->inline_create_instance('$class');
$source .= ";\n" . (join ";\n" => map {
$self->_generate_slot_initializer($_)