r52126 - in /branches/upstream/libmoosex-method-signatures-perl/current: ./ inc/Module/ inc/Module/Install/ lib/MooseX/Method/ lib/MooseX/Method/Signatures/Meta/ t/ t/lib/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Thu Feb 4 12:13:20 UTC 2010
Author: ansgar-guest
Date: Thu Feb 4 12:13:06 2010
New Revision: 52126
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=52126
Log:
[svn-upgrade] Integrating new upstream version, libmoosex-method-signatures-perl (0.30)
Modified:
branches/upstream/libmoosex-method-signatures-perl/current/Changes
branches/upstream/libmoosex-method-signatures-perl/current/META.yml
branches/upstream/libmoosex-method-signatures-perl/current/Makefile.PL
branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install.pm
branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Base.pm
branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Can.pm
branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Fetch.pm
branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Makefile.pm
branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Metadata.pm
branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Win32.pm
branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/WriteAll.pm
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
branches/upstream/libmoosex-method-signatures-perl/current/t/basic.t
branches/upstream/libmoosex-method-signatures-perl/current/t/lib/TestClass.pm
branches/upstream/libmoosex-method-signatures-perl/current/t/structured.t
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=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/Changes (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/Changes Thu Feb 4 12:13:06 2010
@@ -1,7 +1,14 @@
Version history for MooseX::Method::Signatures
+0.30 Thu, 04 Feb 2010 02:41:36 +0100
+ * Make Any instead of Defined the default type constraint.
+ * Add tests for coercing optional named parameters (Cory Watson).
+ + Make those tests pass by depending on
+ MooseX::Types::Structured 0.20.
+ * Make sure Text::Balanced doesn't screw up our data.
+
0.29 Thu, 15 Oct 2009 23:27:08 +0200
- * Fix regression introduced in 0.29.
+ * Fix regression introduced in 0.28.
Validation for methods without named arguments wasn't strict enough
anymore. Passing too many arguments hasn't been rejected. Thanks
Justin Hunter for finding this.
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=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/META.yml Thu Feb 4 12:13:06 2010
@@ -5,11 +5,11 @@
build_requires:
ExtUtils::MakeMaker: 6.42
Test::Exception: 0
- Test::More: 0.88
+ Test::More: 0.89
configure_requires:
ExtUtils::MakeMaker: 6.42
distribution_type: module
-generated_by: 'Module::Install version 0.91'
+generated_by: 'Module::Install version 0.92'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -30,7 +30,7 @@
MooseX::Meta::TypeConstraint::ForceCoercion: 0
MooseX::Types: 0.19
MooseX::Types::Moose: 0
- MooseX::Types::Structured: 0.12
+ MooseX::Types::Structured: 0.20
Parse::Method::Signatures: 1.003011
Sub::Name: 0
Task::Weaken: 0
@@ -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.29
+version: 0.30
Modified: branches/upstream/libmoosex-method-signatures-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/Makefile.PL?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/Makefile.PL (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/Makefile.PL Thu Feb 4 12:13:06 2010
@@ -16,14 +16,14 @@
requires 'MooseX::Meta::TypeConstraint::ForceCoercion';
requires 'MooseX::Types' => '0.19';
requires 'MooseX::Types::Moose';
-requires 'MooseX::Types::Structured' => '0.12';
+requires 'MooseX::Types::Structured' => '0.20';
requires 'namespace::autoclean';
requires 'Sub::Name';
requires 'Task::Weaken';
requires 'Text::Balanced';
test_requires 'Test::Exception';
-test_requires 'Test::More' => 0.88;
+test_requires 'Test::More' => 0.89;
repository 'git://github.com/rafl/moosex-method-signatures.git';
bugtracker 'http://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Method-Signatures';
Modified: branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install.pm?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install.pm Thu Feb 4 12:13:06 2010
@@ -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.91';
+ $VERSION = '0.92';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -348,17 +348,24 @@
return $call;
}
+# Done in evals to avoid confusing Perl::MinimumVersion
+eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read {
local *FH;
- 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]): $!";
return $string;
}
+END_NEW
+sub _read {
+ local *FH;
+ open( FH, "< $_[0]" ) or die "open($_[0]): $!";
+ my $string = do { local $/; <FH> };
+ close FH or die "close($_[0]): $!";
+ return $string;
+}
+END_OLD
sub _readperl {
my $string = Module::Install::_read($_[0]);
@@ -379,18 +386,26 @@
return $string;
}
+# Done in evals to avoid confusing Perl::MinimumVersion
+eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write {
local *FH;
- 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]): $!";
}
close FH or die "close($_[0]): $!";
}
+END_NEW
+sub _write {
+ local *FH;
+ open( FH, "> $_[0]" ) or die "open($_[0]): $!";
+ foreach ( 1 .. $#_ ) {
+ print FH $_[$_] or die "print($_[0]): $!";
+ }
+ close FH or die "close($_[0]): $!";
+}
+END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
@@ -427,4 +442,4 @@
1;
-# Copyright 2008 - 2009 Adam Kennedy.
+# Copyright 2008 - 2010 Adam Kennedy.
Modified: branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Base.pm?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Base.pm Thu Feb 4 12:13:06 2010
@@ -4,7 +4,7 @@
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.92';
}
# Suspend handler for "redefined" warnings
Modified: branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Can.pm?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Can.pm Thu Feb 4 12:13:06 2010
@@ -9,7 +9,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.92';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Fetch.pm?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Fetch.pm Thu Feb 4 12:13:06 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.92';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Makefile.pm?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Makefile.pm Thu Feb 4 12:13:06 2010
@@ -7,7 +7,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.92';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -34,6 +34,17 @@
}
}
+# Store a cleaned up version of the MakeMaker version,
+# since we need to behave differently in a variety of
+# ways based on the MM version.
+my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
+
+# If we are passed a param, do a "newer than" comparison.
+# Otherwise, just return the MakeMaker version.
+sub makemaker {
+ ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0
+}
+
sub makemaker_args {
my $self = shift;
my $args = ( $self->{makemaker_args} ||= {} );
@@ -44,7 +55,7 @@
# For mm args that take multiple space-seperated args,
# append an argument to the current list.
sub makemaker_append {
- my $self = sShift;
+ my $self = shift;
my $name = shift;
my $args = $self->makemaker_args;
$args->{name} = defined $args->{$name}
@@ -130,12 +141,13 @@
# an underscore, even though its own version may contain one!
# Hence the funny regexp to get rid of it. See RT #35800
# for details.
- $self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
- $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
+ my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
+ $self->build_requires( 'ExtUtils::MakeMaker' => $v );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => $v );
} else {
# Allow legacy-compatibility with 5.005 by depending on the
# most recent EU:MM that supported 5.005.
- $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
$self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
}
@@ -152,42 +164,62 @@
$args->{ABSTRACT} = $self->abstract;
$args->{AUTHOR} = $self->author;
}
- if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+ if ( $self->makemaker(6.10) ) {
$args->{NO_META} = 1;
}
- if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+ if ( $self->makemaker(6.17) and $self->sign ) {
$args->{SIGN} = 1;
}
unless ( $self->is_admin ) {
delete $args->{SIGN};
}
- # Merge both kinds of requires into prereq_pm
my $prereq = ($args->{PREREQ_PM} ||= {});
%$prereq = ( %$prereq,
- map { @$_ }
+ map { @$_ } # flatten [module => version]
map { @$_ }
grep $_,
- ($self->configure_requires, $self->build_requires, $self->requires)
+ ($self->requires)
);
# Remove any reference to perl, PREREQ_PM doesn't support it
delete $args->{PREREQ_PM}->{perl};
- # merge both kinds of requires into prereq_pm
+ # Merge both kinds of requires into BUILD_REQUIRES
+ my $build_prereq = ($args->{BUILD_REQUIRES} ||= {});
+ %$build_prereq = ( %$build_prereq,
+ map { @$_ } # flatten [module => version]
+ map { @$_ }
+ grep $_,
+ ($self->configure_requires, $self->build_requires)
+ );
+
+ # Remove any reference to perl, BUILD_REQUIRES doesn't support it
+ delete $args->{BUILD_REQUIRES}->{perl};
+
+ # Delete bundled dists from prereq_pm
my $subdirs = ($args->{DIR} ||= []);
if ($self->bundles) {
foreach my $bundle (@{ $self->bundles }) {
my ($file, $dir) = @$bundle;
push @$subdirs, $dir if -d $dir;
- delete $prereq->{$file};
+ delete $build_prereq->{$file}; #Delete from build prereqs only
}
+ }
+
+ unless ( $self->makemaker('6.55_03') ) {
+ %$prereq = (%$prereq,%$build_prereq);
+ delete $args->{BUILD_REQUIRES};
}
if ( my $perl_version = $self->perl_version ) {
eval "use $perl_version; 1"
or die "ERROR: perl: Version $] is installed, "
. "but we need version >= $perl_version";
+
+ if ( $self->makemaker(6.48) ) {
+ $args->{MIN_PERL_VERSION} = $perl_version;
+ }
}
$args->{INSTALLDIRS} = $self->installdirs;
@@ -265,4 +297,4 @@
__END__
-#line 394
+#line 426
Modified: branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Metadata.pm?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Metadata.pm Thu Feb 4 12:13:06 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.92';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -230,6 +230,8 @@
die("The path '$file' does not exist, or is not a file");
}
+ $self->{values}{all_from} = $file;
+
# Some methods pull from POD instead of code.
# If there is a matching .pod, use that instead
my $pod = $file;
@@ -385,11 +387,10 @@
}
}
-sub perl_version_from {
- my $self = shift;
+sub _extract_perl_version {
if (
- Module::Install::_read($_[0]) =~ m/
- ^
+ $_[0] =~ m/
+ ^\s*
(?:use|require) \s*
v?
([\d_\.]+)
@@ -398,6 +399,16 @@
) {
my $perl_version = $1;
$perl_version =~ s{_}{}g;
+ return $perl_version;
+ } else {
+ return;
+ }
+}
+
+sub perl_version_from {
+ my $self = shift;
+ my $perl_version=_extract_perl_version(Module::Install::_read($_[0]));
+ if ($perl_version) {
$self->perl_version($perl_version);
} else {
warn "Cannot determine perl version info from $_[0]\n";
@@ -425,13 +436,12 @@
}
}
-sub license_from {
- my $self = shift;
+sub _extract_license {
if (
- Module::Install::_read($_[0]) =~ m/
+ $_[0] =~ m/
(
=head \d \s+
- (?:licen[cs]e|licensing|copyright|legal)\b
+ (?:licen[cs]e|licensing|copyrights?|legal)\b
.*?
)
(=head\\d.*|=cut.*|)
@@ -439,7 +449,8 @@
/ixms ) {
my $license_text = $1;
my @phrases = (
- 'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
+ 'under the same (?:terms|license) as (?:perl|the perl programming language)' => 'perl', 1,
+ 'under the terms of (?: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,
@@ -456,20 +467,32 @@
'proprietary' => 'proprietary', 0,
);
while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
- $pattern =~ s{\s+}{\\s+}g;
+ $pattern =~ s#\s+#\\s+#gs;
if ( $license_text =~ /\b$pattern\b/i ) {
- $self->license($license);
- return 1;
+ return $license;
}
}
- }
-
- warn "Cannot determine license info from $_[0]\n";
- return 'unknown';
+ } else {
+ return;
+ }
+}
+
+sub license_from {
+ my $self = shift;
+ if (my $license=_extract_license(Module::Install::_read($_[0]))) {
+ $self->license($license);
+ } else {
+ warn "Cannot determine license info from $_[0]\n";
+ return 'unknown';
+ }
}
sub _extract_bugtracker {
- my @links = $_[0] =~ m#L<(\Qhttp://rt.cpan.org/\E[^>]+)>#g;
+ my @links = $_[0] =~ m#L<(
+ \Qhttp://rt.cpan.org/\E[^>]+|
+ \Qhttp://github.com/\E[\w_]+/[\w_]+/issues|
+ \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list
+ )>#gx;
my %links;
@links{@links}=();
@links=keys %links;
@@ -485,7 +508,7 @@
return 0;
}
if ( @links > 1 ) {
- warn "Found more than on rt.cpan.org link in $_[0]\n";
+ warn "Found more than one bugtracker link in $_[0]\n";
return 0;
}
Modified: branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Win32.pm?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/Win32.pm Thu Feb 4 12:13:06 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.92';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/WriteAll.pm?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/inc/Module/Install/WriteAll.pm Thu Feb 4 12:13:06 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';;
+ $VERSION = '0.92';;
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
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=52126&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 Thu Feb 4 12:13:06 2010
@@ -19,7 +19,7 @@
use namespace::autoclean;
-our $VERSION = '0.29';
+our $VERSION = '0.30';
has package => (
is => 'ro',
@@ -109,7 +109,8 @@
my $line = $ctx->get_linestr;
my $offset = $ctx->offset;
local $@;
- my ($str) = extract_quotelike(substr($line, $offset));
+ my $copy = substr($line, $offset);
+ my ($str) = extract_quotelike($copy);
return unless defined $str;
return if ($@ && $@ =~ /^No quotelike operator found/);
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=52126&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 Thu Feb 4 12:13:06 2010
@@ -11,7 +11,7 @@
use MooseX::Meta::TypeConstraint::ForceCoercion;
use MooseX::Types::Util qw/has_available_type_export/;
use MooseX::Types::Structured qw/Tuple Dict Optional slurpy/;
-use MooseX::Types::Moose qw/ArrayRef Str Maybe Object Defined CodeRef Bool/;
+use MooseX::Types::Moose qw/ArrayRef Str Maybe Object Any CodeRef Bool/;
use MooseX::Method::Signatures::Types qw/Injections Params/;
use aliased 'Parse::Method::Signatures::Param::Named';
use aliased 'Parse::Method::Signatures::Param::Placeholder';
@@ -232,7 +232,7 @@
sub _param_to_spec {
my ($self, $param) = @_;
- my $tc = Defined;
+ my $tc = Any;
{
# Ensure errors get reported from the right place
local $Carp::Internal{'MooseX::Method::Signatures::Meta::Method'} = 1;
@@ -258,9 +258,7 @@
$spec{tc} = $param->required
? $tc
- : does_role($param, Named)
- ? Optional[$tc]
- : Maybe[$tc];
+ : Optional[$tc];
$spec{default} = $param->default_value
if $param->has_default_value;
Modified: branches/upstream/libmoosex-method-signatures-perl/current/t/basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/t/basic.t?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/t/basic.t (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/t/basic.t Thu Feb 4 12:13:06 2010
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 29;
+use Test::More;
use Test::Exception;
use FindBin;
@@ -68,6 +68,8 @@
lives_ok(sub { $o->with_coercion({}) });
dies_ok(sub { $o->without_coercion({}) });
+lives_ok(sub { $o->named_with_coercion(foo => bless({}, 'MyType')) });
+lives_ok(sub { $o->named_with_coercion(foo => {}) });
# MooseX::Meta::Signature::Combined bug? optional positional can't be omitted
#lives_ok(sub { $o->combined(1, 2, required => 3) });
@@ -77,3 +79,5 @@
my $anon = method ($foo, $bar) { };
isa_ok($anon, 'Moose::Meta::Method');
+
+done_testing;
Modified: branches/upstream/libmoosex-method-signatures-perl/current/t/lib/TestClass.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/t/lib/TestClass.pm?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/t/lib/TestClass.pm (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/t/lib/TestClass.pm Thu Feb 4 12:13:06 2010
@@ -55,6 +55,7 @@
method without_coercion (MyType $foo) { $foo }
method with_coercion (MyType $foo does coerce) { $foo }
+method named_with_coercion (MyType :$foo does coerce) { $foo }
no Moose;
Modified: branches/upstream/libmoosex-method-signatures-perl/current/t/structured.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-method-signatures-perl/current/t/structured.t?rev=52126&op=diff
==============================================================================
--- branches/upstream/libmoosex-method-signatures-perl/current/t/structured.t (original)
+++ branches/upstream/libmoosex-method-signatures-perl/current/t/structured.t Thu Feb 4 12:13:06 2010
@@ -2,7 +2,7 @@
use warnings;
use Test::More tests => 18;
use Moose::Util::TypeConstraints;
-use MooseX::Types::Moose qw/Defined Object Maybe Str Int/;
+use MooseX::Types::Moose qw/Any Object Maybe Str Int/;
use MooseX::Types::Structured qw/Dict Tuple Optional/;
use MooseX::Method::Signatures;
@@ -14,7 +14,7 @@
return "${\ref $self} ${foo} ${bar}";
};
- my $expected = Tuple[Tuple[Object,Defined,Maybe[Defined]], Dict[]];
+ my $expected = Tuple[Tuple[Object,Any,Optional[Any]], Dict[]];
is($meth->type_constraint->name, $expected->name);
eval {
@@ -39,7 +39,7 @@
return "${\ref $self} ${foo} ${bar}";
};
- my $expected = Tuple[Tuple[Object], Dict[foo => Defined, bar => Optional[Defined]]];
+ my $expected = Tuple[Tuple[Object], Dict[foo => Any, bar => Optional[Any]]];
is($meth->type_constraint->name, $expected->name);
eval {
@@ -73,7 +73,7 @@
return "${class} ${foo} ${bar}";
};
- my $expected = Tuple[Tuple[Defined, Str, subtype(Int, where { $_ % 2 == 0 })], Dict[]];
+ my $expected = Tuple[Tuple[Any, Str, subtype(Int, where { $_ % 2 == 0 })], Dict[]];
is($meth->type_constraint->name, $expected->name);
eval {
More information about the Pkg-perl-cvs-commits
mailing list