r45596 - in /branches/upstream/libmoosex-method-signatures-perl/current: Changes MANIFEST META.yml inc/Module/Install/ExtraTests.pm lib/MooseX/Method/Signatures.pm lib/MooseX/Method/Signatures/Meta/Method.pm t/named_defaults.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Mon Oct 12 00:11:45 UTC 2009


Author: jawnsy-guest
Date: Mon Oct 12 00:11:36 2009
New Revision: 45596

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=45596
Log:
[svn-upgrade] Integrating new upstream version, libmoosex-method-signatures-perl (0.28)

Added:
    branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/ExtraTests.pm
    branches/upstream/libmoosex-method-signatures-perl/current/t/named_defaults.t
Modified:
    branches/upstream/libmoosex-method-signatures-perl/current/Changes
    branches/upstream/libmoosex-method-signatures-perl/current/MANIFEST
    branches/upstream/libmoosex-method-signatures-perl/current/META.yml
    branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures.pm
    branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures/Meta/Method.pm

Modified: branches/upstream/libmoosex-method-signatures-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/Changes?rev=45596&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/Changes (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/Changes Mon Oct 12 00:11:36 2009
@@ -1,4 +1,7 @@
 Version history for MooseX::Method::Signatures
+
+0.28  Fri, 09 Oct 2009 01:28:02 +0200
+  * Fix default values for named arguments.
 
 0.27  Tue, 22 Sep 2009 14:30:23 +0200
   * Depend on MooseX::LazyRequire 0.04 to avoid fail on version 0.03, which has

Modified: branches/upstream/libmoosex-method-signatures-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/MANIFEST?rev=45596&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/MANIFEST (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/MANIFEST Mon Oct 12 00:11:36 2009
@@ -2,6 +2,7 @@
 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
@@ -33,6 +34,7 @@
 t/lib/TestClassTrait.pm
 t/list.t
 t/meta.t
+t/named_defaults.t
 t/no_signature.t
 t/placeholders.t
 t/precedence.t

Modified: branches/upstream/libmoosex-method-signatures-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/META.yml?rev=45596&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/META.yml Mon Oct 12 00:11:36 2009
@@ -41,4 +41,4 @@
   bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Method-Signatures
   license: http://dev.perl.org/licenses/
   repository: git://github.com/rafl/moosex-method-signatures.git
-version: 0.27
+version: 0.28

Added: branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/ExtraTests.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/ExtraTests.pm?rev=45596&op=file
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/ExtraTests.pm (added)
+++ branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/ExtraTests.pm Mon Oct 12 00:11:36 2009
@@ -1,0 +1,100 @@
+#line 1
+use strict;
+use warnings;
+use 5.006;
+package Module::Install::ExtraTests;
+use Module::Install::Base;
+
+BEGIN {
+  our $VERSION = '0.006';
+  our $ISCORE  = 1;
+  our @ISA     = qw{Module::Install::Base};
+}
+
+sub extra_tests {
+  my ($self) = @_;
+
+  return unless -d 'xt';
+  return unless my @content = grep { $_ =~ /^[.]/ } <xt/*>;
+
+  die "unknown files found in ./xt" if grep { -f } @content;
+
+  my %known   = map {; $_ => 1 } qw(author smoke release);
+  my @unknown = grep { not $known{$_} } @content;
+  die "unknown directories found in ./xt: @unknown" if @unknown;
+
+  {
+    no warnings qw(closure once);
+    package # The newline tells PAUSE, "DO NOT INDEXING!"
+    MY;
+    sub test_via_harness {
+      my ($self, $perl, $tests) = @_;
+      my $a_str = -d 'xt/author'  ? 'xt/author'  : '';
+      my $r_str = -d 'xt/release' ? 'xt/release' : '';
+      my $s_str = -d 'xt/smoke'   ? 'xt/smoke'   : '';
+      my $is_author = $Module::Install::AUTHOR ? 1 : 0;
+
+      return qq{\t$perl "-Iinc" "-MModule::Install::ExtraTests" }
+           . qq{"-e" "Module::Install::ExtraTests::__harness('Test::Harness', $is_author, '$a_str', '$r_str', '$s_str', \$(TEST_VERBOSE), '\$(INST_LIB)', '\$(INST_ARCHLIB)')" $tests\n};
+    }
+
+    sub dist_test {
+      my ($self, @args) = @_;
+      my $text = $self->SUPER::dist_test(@args);
+      my @lines = split /\n/, $text;
+      $_ =~ s/ (\S*MAKE\S* test )/ RELEASE_TESTING=1 $1 / for grep { m/ test / } @lines;
+      return join "\n", @lines;
+    }
+
+  }
+}
+
+sub __harness {
+  my $harness_class = shift;
+  my $is_author     = shift;
+  my $author_tests  = shift;
+  my $release_tests = shift;
+  my $smoke_tests   = shift;
+
+  eval "require $harness_class; 1" or die;
+  require File::Spec;
+
+  my $verbose = shift;
+  eval "\$$harness_class\::verbose = $verbose; 1" or die;
+
+  # Because Windows doesn't do this for us and listing all the *.t files
+  # out on the command line can blow over its exec limit.
+  require ExtUtils::Command;
+  push @ARGV, __PACKAGE__->_deep_t($author_tests)
+    if $author_tests and (exists $ENV{AUTHOR_TESTING} ? $ENV{AUTHOR_TESTING} : $is_author);
+
+  push @ARGV, __PACKAGE__->_deep_t($release_tests)
+    if $release_tests and $ENV{RELEASE_TESTING};
+
+  push @ARGV, __PACKAGE__->_deep_t($smoke_tests)
+    if $smoke_tests and $ENV{AUTOMATED_TESTING};
+
+  my @argv = ExtUtils::Command::expand_wildcards(@ARGV);
+
+  local @INC = @INC;
+  unshift @INC, map { File::Spec->rel2abs($_) } @_;
+  $harness_class->can('runtests')->(sort { lc $a cmp lc $b } @argv);
+}
+
+sub _wanted {
+  my $href = shift;
+  no warnings 'once';
+  sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 }
+}
+
+sub _deep_t {
+  my ($self, $dir) = @_;
+  require File::Find;
+
+  my %test_dir;
+  File::Find::find(_wanted(\%test_dir), $dir);
+  return map { "$_/*.t" } sort keys %test_dir;
+}
+
+1;
+__END__

Modified: branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures.pm?rev=45596&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures.pm Mon Oct 12 00:11:36 2009
@@ -19,7 +19,7 @@
 
 use namespace::autoclean;
 
-our $VERSION = '0.27';
+our $VERSION = '0.28';
 
 has package => (
     is            => 'ro',

Modified: branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures/Meta/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures/Meta/Method.pm?rev=45596&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures/Meta/Method.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/lib/MooseX/Method/Signatures/Meta/Method.pm Mon Oct 12 00:11:36 2009
@@ -410,22 +410,20 @@
             if ($self->_has_slurpy_positional) {
                 push @positional_args, @{ $_ }[$i .. $#{ $_ }];
             }
-            else {
-                unless ($#{ $_ } < $i) {
-                    my %rest = @{ $_ }[$i .. $#{ $_ }];
-                    while (my ($key, $spec) = each %named) {
-                        if (exists $rest{$key}) {
-                            $named_args{$key} = $coerce_param->($spec, delete $rest{$key});
-                            next;
-                        }
-
-                        if (exists $spec->{default}) {
-                            $named_args{$key} = eval $spec->{default};
-                        }
+            elsif (%named) {
+                my %rest = @{ $_ }[$i .. $#{ $_ }];
+                while (my ($key, $spec) = each %named) {
+                    if (exists $rest{$key}) {
+                        $named_args{$key} = $coerce_param->($spec, delete $rest{$key});
+                        next;
                     }
 
-                    @named_args{keys %rest} = values %rest;
+                    if (exists $spec->{default}) {
+                        $named_args{$key} = eval $spec->{default};
+                    }
                 }
+
+                @named_args{keys %rest} = values %rest;
             }
 
             return [\@positional_args, \%named_args];

Added: branches/upstream/libmoosex-method-signatures-perl/current/t/named_defaults.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/t/named_defaults.t?rev=45596&op=file
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/t/named_defaults.t (added)
+++ branches/upstream/libmoosex-method-signatures-perl/current/t/named_defaults.t Mon Oct 12 00:11:36 2009
@@ -1,0 +1,18 @@
+use strict;
+use warnings;
+use Test::More;
+
+{
+    package Foo;
+
+    use Moose;
+    use MooseX::Method::Signatures;
+
+    method bar (:$baz = 42) { $baz }
+}
+
+my $o = Foo->new;
+is($o->bar, 42);
+is($o->bar(baz => 0xaffe), 0xaffe);
+
+done_testing;




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