r69918 - in /trunk/libmoosex-singleton-perl: ./ debian/ inc/ lib/MooseX/ lib/MooseX/Singleton/Role/ lib/MooseX/Singleton/Role/Meta/ lib/MooseX/Singleton/Role/Meta/Method/ t/ xt/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sun Feb 27 16:44:34 UTC 2011


Author: jawnsy-guest
Date: Sun Feb 27 16:44:17 2011
New Revision: 69918

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=69918
Log:
NOTE: this contains compatibility changes for Moose 2.0; this
does not need to be uploaded until the new Moose is in Debian
Also a dep change Test::Exception -> Test::Fatal
* New upstream release

Added:
    trunk/libmoosex-singleton-perl/LICENSE
      - copied unchanged from r69911, branches/upstream/libmoosex-singleton-perl/current/LICENSE
    trunk/libmoosex-singleton-perl/META.json
      - copied unchanged from r69911, branches/upstream/libmoosex-singleton-perl/current/META.json
    trunk/libmoosex-singleton-perl/README
      - copied unchanged from r69911, branches/upstream/libmoosex-singleton-perl/current/README
    trunk/libmoosex-singleton-perl/dist.ini
      - copied unchanged from r69911, branches/upstream/libmoosex-singleton-perl/current/dist.ini
    trunk/libmoosex-singleton-perl/t/release-eol.t
      - copied unchanged from r69911, branches/upstream/libmoosex-singleton-perl/current/t/release-eol.t
    trunk/libmoosex-singleton-perl/t/release-no-tabs.t
      - copied unchanged from r69911, branches/upstream/libmoosex-singleton-perl/current/t/release-no-tabs.t
    trunk/libmoosex-singleton-perl/t/release-pod-coverage.t
      - copied unchanged from r69911, branches/upstream/libmoosex-singleton-perl/current/t/release-pod-coverage.t
    trunk/libmoosex-singleton-perl/t/release-pod-spell.t
      - copied unchanged from r69911, branches/upstream/libmoosex-singleton-perl/current/t/release-pod-spell.t
    trunk/libmoosex-singleton-perl/t/release-pod-syntax.t
      - copied unchanged from r69911, branches/upstream/libmoosex-singleton-perl/current/t/release-pod-syntax.t
Removed:
    trunk/libmoosex-singleton-perl/inc/
    trunk/libmoosex-singleton-perl/xt/
Modified:
    trunk/libmoosex-singleton-perl/ChangeLog
    trunk/libmoosex-singleton-perl/MANIFEST
    trunk/libmoosex-singleton-perl/META.yml
    trunk/libmoosex-singleton-perl/Makefile.PL
    trunk/libmoosex-singleton-perl/debian/changelog
    trunk/libmoosex-singleton-perl/lib/MooseX/Singleton.pm
    trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Class.pm
    trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Instance.pm
    trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm
    trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Object.pm
    trunk/libmoosex-singleton-perl/t/002-init.t
    trunk/libmoosex-singleton-perl/t/006-cooperative.t

Modified: trunk/libmoosex-singleton-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/ChangeLog?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/ChangeLog (original)
+++ trunk/libmoosex-singleton-perl/ChangeLog Sun Feb 27 16:44:17 2011
@@ -1,4 +1,11 @@
 Revision history for Perl extension MooseX-Singleton
+
+{{NEXT}}
+    - This module will now work with Moose 1.9900+, but it still works with
+      older Moose as well. (Dave Rolsky)
+
+    - The test suite now uses Test::Fatal instead of Test::Exception. (Karen
+      Etheridge)
 
 0.25 2010-08-22
     - Fixes for latest Moose. (Dave Rolsky)

Modified: trunk/libmoosex-singleton-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/MANIFEST?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/MANIFEST (original)
+++ trunk/libmoosex-singleton-perl/MANIFEST Sun Feb 27 16:44:17 2011
@@ -1,29 +1,24 @@
 ChangeLog
-inc/Module/Install.pm
-inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/ExtraTests.pm
-inc/Module/Install/Fetch.pm
-inc/Module/Install/Makefile.pm
-inc/Module/Install/Metadata.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
+LICENSE
+MANIFEST
+META.json
+META.yml
+Makefile.PL
+README
+dist.ini
 lib/MooseX/Singleton.pm
 lib/MooseX/Singleton/Role/Meta/Class.pm
 lib/MooseX/Singleton/Role/Meta/Instance.pm
 lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm
 lib/MooseX/Singleton/Role/Object.pm
-Makefile.PL
-MANIFEST			This list of files
-META.yml
 t/001-basic.t
 t/002-init.t
 t/003-immutable.t
 t/004-build_bug.t
 t/005-build_bug-immutable.t
 t/006-cooperative.t
-xt/author/pod-coverage.t
-xt/author/pod-spell.t
-xt/author/pod.t
-xt/author/tabs.t
-xt/author/version-numbers.t
+t/release-eol.t
+t/release-no-tabs.t
+t/release-pod-coverage.t
+t/release-pod-spell.t
+t/release-pod-syntax.t

Modified: trunk/libmoosex-singleton-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/META.yml?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/META.yml (original)
+++ trunk/libmoosex-singleton-perl/META.yml Sun Feb 27 16:44:17 2011
@@ -4,26 +4,23 @@
   - 'Shawn M Moore <sartak at gmail.com>'
 build_requires:
   ExtUtils::MakeMaker: 6.42
-  Scalar::Util: 0
-  Test::Exception: 0
+  Test::Fatal: 0
   Test::More: 0.88
   Test::Requires: 0
 configure_requires:
-  ExtUtils::MakeMaker: 6.42
-distribution_type: module
-generated_by: 'Module::Install version 1.00'
+  ExtUtils::MakeMaker: 6.31
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 4.200004, CPAN::Meta::Converter version 2.110240'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
   version: 1.4
 name: MooseX-Singleton
-no_index:
-  directory:
-    - inc
-    - t
-    - xt
 requires:
   Moose: 1.10
+  Scalar::Util: 0
 resources:
-  license: http://dev.perl.org/licenses/
-version: 0.25
+  bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Singleton
+  repository: git://git.moose.perl.org/MooseX-Singleton.git
+version: 0.26
+x_authority: cpan:SARTAK

Modified: trunk/libmoosex-singleton-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/Makefile.PL?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/Makefile.PL (original)
+++ trunk/libmoosex-singleton-perl/Makefile.PL Sun Feb 27 16:44:17 2011
@@ -1,19 +1,57 @@
+
 use strict;
 use warnings;
-use inc::Module::Install;
 
-name 'MooseX-Singleton';
-all_from 'lib/MooseX/Singleton.pm';
 
-requires 'Moose' => '1.10';
 
-build_requires 'Scalar::Util';
-build_requires 'Test::More' => '0.88';
-build_requires 'Test::Exception';
-build_requires 'Test::Requires';
+use ExtUtils::MakeMaker 6.31;
 
-license 'Perl';
 
-extra_tests();
 
-WriteAll();
+my %WriteMakefileArgs = (
+  'ABSTRACT' => 'turn your Moose class into a singleton',
+  'AUTHOR' => 'Shawn M Moore <sartak at gmail.com>',
+  'BUILD_REQUIRES' => {
+    'ExtUtils::MakeMaker' => '6.42',
+    'Test::Fatal' => '0',
+    'Test::More' => '0.88',
+    'Test::Requires' => '0'
+  },
+  'CONFIGURE_REQUIRES' => {
+    'ExtUtils::MakeMaker' => '6.31'
+  },
+  'DISTNAME' => 'MooseX-Singleton',
+  'EXE_FILES' => [],
+  'LICENSE' => 'perl',
+  'NAME' => 'MooseX::Singleton',
+  'PREREQ_PM' => {
+    'Moose' => '1.10',
+    'Scalar::Util' => '0'
+  },
+  'VERSION' => '0.26',
+  'test' => {
+    'TESTS' => 't/*.t'
+  }
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
+  my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
+  my $pp = $WriteMakefileArgs{PREREQ_PM};
+  for my $mod ( keys %$br ) {
+    if ( exists $pp->{$mod} ) {
+      $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
+    }
+    else {
+      $pp->{$mod} = $br->{$mod};
+    }
+  }
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
+
+WriteMakefile(%WriteMakefileArgs);
+
+
+

Modified: trunk/libmoosex-singleton-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/debian/changelog?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/debian/changelog (original)
+++ trunk/libmoosex-singleton-perl/debian/changelog Sun Feb 27 16:44:17 2011
@@ -1,8 +1,17 @@
-libmoosex-singleton-perl (0.25-2) UNRELEASED; urgency=low
+libmoosex-singleton-perl (0.26-1) UNRELEASED; urgency=low
 
+  NOTE: this contains compatibility changes for Moose 2.0; this
+  does not need to be uploaded until the new Moose is in Debian
+
+  Also a dep change Test::Exception -> Test::Fatal
+
+  [ Ansgar Burchardt ]
   * Update my email address.
 
- -- Ansgar Burchardt <ansgar at debian.org>  Mon, 01 Nov 2010 11:17:05 +0100
+  [ Jonathan Yu ]
+  * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Sun, 27 Feb 2011 11:59:06 -0500
 
 libmoosex-singleton-perl (0.25-1) unstable; urgency=low
 

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=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/lib/MooseX/Singleton.pm (original)
+++ trunk/libmoosex-singleton-perl/lib/MooseX/Singleton.pm Sun Feb 27 16:44:17 2011
@@ -1,4 +1,10 @@
 package MooseX::Singleton;
+BEGIN {
+  $MooseX::Singleton::AUTHORITY = 'cpan:SARTAK';
+}
+BEGIN {
+  $MooseX::Singleton::VERSION = '0.26';
+}
 
 use Moose 1.10 ();
 use Moose::Exporter;
@@ -6,8 +12,6 @@
 use MooseX::Singleton::Role::Meta::Class;
 use MooseX::Singleton::Role::Meta::Instance;
 
-our $VERSION = '0.25';
-$VERSION = eval $VERSION;
 
 Moose::Exporter->setup_import_methods( also => 'Moose' );
 
@@ -42,13 +46,19 @@
 
 1;
 
-__END__
+# ABSTRACT: turn your Moose class into a singleton
+
+
 
 =pod
 
 =head1 NAME
 
 MooseX::Singleton - turn your Moose class into a singleton
+
+=head1 VERSION
+
+version 0.26
 
 =head1 SYNOPSIS
 
@@ -112,12 +122,6 @@
 L<http://rt.cpan.org>. We will be notified, and then you'll automatically be
 notified of progress on your bug as we make changes.
 
-=head1 AUTHORS
-
-Shawn M Moore E<lt>sartak at gmail.comE<gt>
-
-Dave Rolsky E<lt>autarch at urth.orgE<gt>
-
 =head1 SOME CODE STOLEN FROM
 
 Anders Nor Berle E<lt>debolaz at gmail.comE<gt>
@@ -126,12 +130,20 @@
 
 Ricardo SIGNES E<lt>rjbs at cpan.orgE<gt>
 
+=head1 AUTHOR
+
+Shawn M Moore <sartak at gmail.com>
+
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2007-2009 Infinity Interactive
+This software is copyright (c) 2001 by Shawn M Moore.
 
-This program is free software; you can redistribute it and/or modify it under
-the same terms as Perl itself.
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
 
 =cut
 
+
+__END__
+
+

Modified: trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Class.pm?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Class.pm (original)
+++ trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Class.pm Sun Feb 27 16:44:17 2011
@@ -1,10 +1,14 @@
 package MooseX::Singleton::Role::Meta::Class;
+BEGIN {
+  $MooseX::Singleton::Role::Meta::Class::AUTHORITY = 'cpan:SARTAK';
+}
+BEGIN {
+  $MooseX::Singleton::Role::Meta::Class::VERSION = '0.26';
+}
 use Moose::Role;
 use MooseX::Singleton::Role::Meta::Instance;
 use MooseX::Singleton::Role::Meta::Method::Constructor;
 
-our $VERSION = '0.25';
-$VERSION = eval $VERSION;
 
 sub existing_singleton {
     my ($class) = @_;
@@ -39,11 +43,34 @@
     return ${"$pkg\::singleton"} = super;
 };
 
+if ( $Moose::VERSION >= 1.9900 ) {
+    override _inline_params => sub {
+        my $self = shift;
+
+        return
+            'my $existing = do {',
+                'no strict "refs";',
+                'no warnings "once";',
+                '\${"$class\::singleton"};',
+            '};',
+            'return ${$existing} if ${$existing};',
+            super();
+    };
+
+    override _inline_extra_init => sub {
+        my $self = shift;
+
+        return '${$existing} = $instance;';
+    };
+}
+
 no Moose::Role;
 
 1;
 
-__END__
+# ABSTRACT: Metaclass role for MooseX::Singleton
+
+
 
 =pod
 
@@ -51,11 +78,30 @@
 
 MooseX::Singleton::Role::Meta::Class - Metaclass role for MooseX::Singleton
 
+=head1 VERSION
+
+version 0.26
+
 =head1 DESCRIPTION
 
 This metaclass role makes sure that there is only ever one instance of an
 object for a singleton class. The first call to C<construct_instance> is run
 normally (and then cached). Subsequent calls will return the cached version.
 
+=head1 AUTHOR
+
+Shawn M Moore <sartak at gmail.com>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2001 by Shawn M Moore.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
 =cut
 
+
+__END__
+
+

Modified: trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Instance.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Instance.pm?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Instance.pm (original)
+++ trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Instance.pm Sun Feb 27 16:44:17 2011
@@ -1,9 +1,13 @@
 package MooseX::Singleton::Role::Meta::Instance;
+BEGIN {
+  $MooseX::Singleton::Role::Meta::Instance::AUTHORITY = 'cpan:SARTAK';
+}
+BEGIN {
+  $MooseX::Singleton::Role::Meta::Instance::VERSION = '0.26';
+}
 use Moose::Role;
 use Scalar::Util 'weaken';
 
-our $VERSION = '0.25';
-$VERSION = eval $VERSION;
 
 sub get_singleton_instance {
     my ( $self, $instance ) = @_;
@@ -63,7 +67,9 @@
 
 1;
 
-__END__
+# ABSTRACT: Instance metaclass role for MooseX::Singleton
+
+
 
 =pod
 
@@ -71,10 +77,29 @@
 
 MooseX::Singleton::Role::Meta::Instance - Instance metaclass role for MooseX::Singleton
 
+=head1 VERSION
+
+version 0.26
+
 =head1 DESCRIPTION
 
 This role overrides all object access so that it gets the appropriate
 singleton instance for the class.
 
+=head1 AUTHOR
+
+Shawn M Moore <sartak at gmail.com>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2001 by Shawn M Moore.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
 =cut
 
+
+__END__
+
+

Modified: trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm (original)
+++ trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm Sun Feb 27 16:44:17 2011
@@ -1,73 +1,79 @@
 package MooseX::Singleton::Role::Meta::Method::Constructor;
+BEGIN {
+  $MooseX::Singleton::Role::Meta::Method::Constructor::AUTHORITY = 'cpan:SARTAK';
+}
+BEGIN {
+  $MooseX::Singleton::Role::Meta::Method::Constructor::VERSION = '0.26';
+}
 use Moose::Role;
 
-our $VERSION = '0.25';
-$VERSION = eval $VERSION;
 
-override _initialize_body => sub {
-    my $self = shift;
+if ( $Moose::VERSION < 1.9900 ) {
+    override _initialize_body => sub {
+        my $self = shift;
 
-    # TODO:
-    # the %options should also include a both
-    # a call 'initializer' and call 'SUPER::'
-    # options, which should cover approx 90%
-    # of the possible use cases (even if it
-    # requires some adaption on the part of
-    # the author, after all, nothing is free)
-    my $source = 'sub {';
-    $source .= "\n" . 'my $class = shift;';
+        # TODO:
+        # the %options should also include a both
+        # a call 'initializer' and call 'SUPER::'
+        # options, which should cover approx 90%
+        # of the possible use cases (even if it
+        # requires some adaption on the part of
+        # the author, after all, nothing is free)
+        my $source = 'sub {';
+        $source .= "\n" . 'my $class = shift;';
 
-    $source .= "\n"
-        . 'my $existing = do { no strict "refs"; no warnings "once"; \${"$class\::singleton"}; };';
-    $source .= "\n" . 'return ${$existing} if ${$existing};';
+        $source .= "\n"
+            . 'my $existing = do { no strict "refs"; no warnings "once"; \${"$class\::singleton"}; };';
+        $source .= "\n" . 'return ${$existing} if ${$existing};';
 
-    $source .= "\n" . 'return $class->Moose::Object::new(@_)';
-    $source
-        .= "\n"
-        . '    if $class ne \''
-        . $self->associated_metaclass->name . '\';';
+        $source .= "\n" . 'return $class->Moose::Object::new(@_)';
+        $source
+            .= "\n"
+            . '    if $class ne \''
+            . $self->associated_metaclass->name . '\';';
 
-    $source .= $self->_generate_params( '$params', '$class' );
-    $source .= $self->_generate_instance( '$instance', '$class' );
-    $source .= $self->_generate_slot_initializers;
+        $source .= $self->_generate_params( '$params', '$class' );
+        $source .= $self->_generate_instance( '$instance', '$class' );
+        $source .= $self->_generate_slot_initializers;
 
-    $source .= ";\n" . $self->_generate_triggers();
-    $source .= ";\n" . $self->_generate_BUILDALL();
+        $source .= ";\n" . $self->_generate_triggers();
+        $source .= ";\n" . $self->_generate_BUILDALL();
 
-    $source .= ";\n" . 'return ${$existing} = $instance';
-    $source .= ";\n" . '}';
-    warn $source if $self->options->{debug};
+        $source .= ";\n" . 'return ${$existing} = $instance';
+        $source .= ";\n" . '}';
+        warn $source if $self->options->{debug};
 
-    my $attrs = $self->_attributes;
+        my $attrs = $self->_attributes;
 
-    my @type_constraints
-        = map { $_->can('type_constraint') ? $_->type_constraint : undef }
-        @$attrs;
+        my @type_constraints
+            = map { $_->can('type_constraint') ? $_->type_constraint : undef }
+            @$attrs;
 
-    my @type_constraint_bodies
-        = map { defined $_ ? $_->_compiled_type_constraint : undef; }
-        @type_constraints;
+        my @type_constraint_bodies
+            = map { defined $_ ? $_->_compiled_type_constraint : undef; }
+            @type_constraints;
 
-    my $defaults = [map { $_->default } @$attrs];
+        my $defaults = [map { $_->default } @$attrs];
 
-    my ( $code, $e ) = $self->_compile_code(
-        code        => $source,
-        environment => {
-            '$meta'                   => \$self,
-            '$attrs'                  => \$attrs,
-            '$defaults'               => \$defaults,
-            '@type_constraints'       => \@type_constraints,
-            '@type_constraint_bodies' => \@type_constraint_bodies,
-        },
-    );
+        my ( $code, $e ) = $self->_compile_code(
+            code        => $source,
+            environment => {
+                '$meta'                   => \$self,
+                '$attrs'                  => \$attrs,
+                '$defaults'               => \$defaults,
+                '@type_constraints'       => \@type_constraints,
+                '@type_constraint_bodies' => \@type_constraint_bodies,
+            },
+        );
 
-    $self->throw_error(
-        "Could not eval the constructor :\n\n$source\n\nbecause :\n\n$e",
-        error => $e, data => $source )
-        if $e;
+        $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;
-};
+        $self->{'body'} = $code;
+    };
+}
 
 # Ideally we'd be setting this in the constructor, but the new() methods in
 # what the parent classes are not well-factored.
@@ -96,7 +102,9 @@
 
 1;
 
-__END__
+# ABSTRACT: Constructor method role for MooseX::Singleton
+
+
 
 =pod
 
@@ -104,10 +112,29 @@
 
 MooseX::Singleton::Role::Meta::Method::Constructor - Constructor method role for MooseX::Singleton
 
+=head1 VERSION
+
+version 0.26
+
 =head1 DESCRIPTION
 
 This role overrides the generated object C<new> method so that it returns the
 singleton if it already exists.
 
+=head1 AUTHOR
+
+Shawn M Moore <sartak at gmail.com>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2001 by Shawn M Moore.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
 =cut
 
+
+__END__
+
+

Modified: trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Object.pm?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Object.pm (original)
+++ trunk/libmoosex-singleton-perl/lib/MooseX/Singleton/Role/Object.pm Sun Feb 27 16:44:17 2011
@@ -1,9 +1,13 @@
 package MooseX::Singleton::Role::Object;
+BEGIN {
+  $MooseX::Singleton::Role::Object::AUTHORITY = 'cpan:SARTAK';
+}
+BEGIN {
+  $MooseX::Singleton::Role::Object::VERSION = '0.26';
+}
 use Moose::Role;
 use Carp qw( carp );
 
-our $VERSION = '0.25';
-$VERSION = eval $VERSION;
 
 sub instance { shift->new }
 
@@ -38,7 +42,9 @@
 
 1;
 
-__END__
+# ABSTRACT: Object class role for MooseX::Singleton
+
+
 
 =pod
 
@@ -46,9 +52,28 @@
 
 MooseX::Singleton::Role::Object - Object class role for MooseX::Singleton
 
+=head1 VERSION
+
+version 0.26
+
 =head1 DESCRIPTION
 
 This just adds C<instance> as a shortcut for C<new>.
 
+=head1 AUTHOR
+
+Shawn M Moore <sartak at gmail.com>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2001 by Shawn M Moore.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
 =cut
 
+
+__END__
+
+

Modified: trunk/libmoosex-singleton-perl/t/002-init.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/t/002-init.t?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/t/002-init.t (original)
+++ trunk/libmoosex-singleton-perl/t/002-init.t Sun Feb 27 16:44:17 2011
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use Test::More;
-use Test::Exception;
+use Test::Fatal;
 
 my $i = 0;
 sub new_singleton_pkg {
@@ -16,13 +16,13 @@
   return $pkg_name;
 }
 
-throws_ok { new_singleton_pkg()->instance }
+like( exception { new_singleton_pkg()->instance },
     qr/\QAttribute (number) is required/,
-    q{can't get the Singleton if requires attrs and we don't provide them};
+    q{can't get the Singleton if requires attrs and we don't provide them});
 
-throws_ok { new_singleton_pkg()->string }
+like( exception { new_singleton_pkg()->string },
     qr/\QAttribute (number) is required/,
-    q{can't call any Singleton attr reader if Singleton can't be inited};
+    q{can't call any Singleton attr reader if Singleton can't be inited});
 
 for my $pkg (new_singleton_pkg) {
     my $mst = $pkg->new( number => 5 );
@@ -36,9 +36,9 @@
         "the class method, called directly, returns the given attribute value"
     );
 
-    throws_ok { $pkg->new( number => 3 ) }
+    like( exception { $pkg->new( number => 3 ) },
         qr/already/,
-        "can't make new singleton with conflicting attributes";
+        "can't make new singleton with conflicting attributes");
 
     my $second = eval { $pkg->new };
     ok( !$@, "...but a second ->new without args is okay" );
@@ -46,9 +46,9 @@
     is( $second->number, 5,
         "...we get the originally inited number from it" );
 
-    throws_ok { $pkg->initialize }
+    like( exception { $pkg->initialize },
         qr/already/,
-        "...but ->initialize() is still an error";
+        "...but ->initialize() is still an error");
 }
 
 {

Modified: trunk/libmoosex-singleton-perl/t/006-cooperative.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-singleton-perl/t/006-cooperative.t?rev=69918&op=diff
==============================================================================
--- trunk/libmoosex-singleton-perl/t/006-cooperative.t (original)
+++ trunk/libmoosex-singleton-perl/t/006-cooperative.t Sun Feb 27 16:44:17 2011
@@ -4,8 +4,8 @@
 use Test::More;
 
 use Test::Requires {
-   'MooseX::StrictConstructor' => 0.01, # skip all if not installed
-   'Test::Exception' => 0.01,
+    'MooseX::StrictConstructor' => 0.09,
+    'Test::Fatal' => 0.001,
 };
 
 {
@@ -17,9 +17,9 @@
     has 'attrib' => ( is => 'rw' );
 }
 
-throws_ok {
+like( exception {
     MySingleton->new( bad_name => 42 );
-}
-qr/Found unknown attribute/, 'singleton class also has a strict constructor';
+},
+qr/Found unknown attribute/, 'singleton class also has a strict constructor');
 
 done_testing;




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