diff -Nru libmethod-signatures-simple-perl-1.02/Changes libmethod-signatures-simple-perl-1.07/Changes --- libmethod-signatures-simple-perl-1.02/Changes 2011-09-01 19:17:07.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/Changes 2013-01-20 22:06:25.000000000 +0000 @@ -1,5 +1,23 @@ Revision history for Method-Signatures-Simple +1.07 2013-01-20 Rhesa Rozendaal + Fix RT80510: empty methods returning @_ + +1.06 2013-01-20 Rhesa Rozendaal + Fix a test so it passes on 5.10 + +1.05 2013-01-18 Rhesa Rozendaal + Fix RT80507: keep perl's idea of line number + intact when mangling multi-line signatures + +1.04 2013-01-17 Rhesa Rozendaal + Fix RT80505: allow comments in multiline + signature + +1.03 2013-01-17 Rhesa Rozendaal + Fix RT80508: allow space between invocant + and colon + 1.02 2011-09-01 Rhesa Rozendaal Avoid uninitialized warning. diff -Nru libmethod-signatures-simple-perl-1.02/LICENSE libmethod-signatures-simple-perl-1.07/LICENSE --- libmethod-signatures-simple-perl-1.02/LICENSE 2011-09-01 19:17:07.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/LICENSE 2013-01-20 22:06:25.000000000 +0000 @@ -1,4 +1,4 @@ -This software is copyright (c) 2011 by Rhesa Rozendaal. +This software is copyright (c) 2013 by Rhesa Rozendaal. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2011 by Rhesa Rozendaal. +This software is Copyright (c) 2013 by Rhesa Rozendaal. This is free software, licensed under: @@ -22,7 +22,7 @@ Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2011 by Rhesa Rozendaal. +This software is Copyright (c) 2013 by Rhesa Rozendaal. This is free software, licensed under: diff -Nru libmethod-signatures-simple-perl-1.02/MANIFEST libmethod-signatures-simple-perl-1.07/MANIFEST --- libmethod-signatures-simple-perl-1.02/MANIFEST 2011-09-01 19:17:07.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/MANIFEST 2013-01-20 22:06:25.000000000 +0000 @@ -10,6 +10,10 @@ t/01-parse-proto.t t/02-use.t t/03-config.t +t/RT80505.t +t/RT80507.t +t/RT80508.t +t/RT80510.t t/release-pod-coverage.t t/release-pod-syntax.t xt/boilerplate.t diff -Nru libmethod-signatures-simple-perl-1.02/META.yml libmethod-signatures-simple-perl-1.07/META.yml --- libmethod-signatures-simple-perl-1.02/META.yml 2011-09-01 19:17:07.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/META.yml 2013-01-20 22:06:25.000000000 +0000 @@ -6,7 +6,7 @@ configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 -generated_by: 'Dist::Zilla version 4.200011, CPAN::Meta::Converter version 2.110440' +generated_by: 'Dist::Zilla version 4.300016, CPAN::Meta::Converter version 2.120921' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -16,4 +16,4 @@ Devel::Declare: 0.003001 resources: repository: http://github.com/rhesa/method-signatures-simple -version: 1.02 +version: 1.07 diff -Nru libmethod-signatures-simple-perl-1.02/Makefile.PL libmethod-signatures-simple-perl-1.07/Makefile.PL --- libmethod-signatures-simple-perl-1.02/Makefile.PL 2011-09-01 19:17:07.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/Makefile.PL 2013-01-20 22:06:25.000000000 +0000 @@ -9,22 +9,22 @@ my %WriteMakefileArgs = ( - 'ABSTRACT' => 'Basic method declarations with signatures, without source filters', - 'AUTHOR' => 'Rhesa Rozendaal ', - 'BUILD_REQUIRES' => {}, - 'CONFIGURE_REQUIRES' => { - 'ExtUtils::MakeMaker' => '6.30' + "ABSTRACT" => "Basic method declarations with signatures, without source filters", + "AUTHOR" => "Rhesa Rozendaal ", + "BUILD_REQUIRES" => {}, + "CONFIGURE_REQUIRES" => { + "ExtUtils::MakeMaker" => "6.30" }, - 'DISTNAME' => 'Method-Signatures-Simple', - 'EXE_FILES' => [], - 'LICENSE' => 'perl', - 'NAME' => 'Method::Signatures::Simple', - 'PREREQ_PM' => { - 'Devel::Declare' => '0.003001' + "DISTNAME" => "Method-Signatures-Simple", + "EXE_FILES" => [], + "LICENSE" => "perl", + "NAME" => "Method::Signatures::Simple", + "PREREQ_PM" => { + "Devel::Declare" => "0.003001" }, - 'VERSION' => '1.02', - 'test' => { - 'TESTS' => 't/*.t' + "VERSION" => "1.07", + "test" => { + "TESTS" => "t/*.t" } ); diff -Nru libmethod-signatures-simple-perl-1.02/README libmethod-signatures-simple-perl-1.07/README --- libmethod-signatures-simple-perl-1.02/README 2011-09-01 19:17:07.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/README 2013-01-20 22:06:25.000000000 +0000 @@ -1,11 +1,11 @@ This archive contains the distribution Method-Signatures-Simple, -version 1.02: +version 1.07: Basic method declarations with signatures, without source filters -This software is copyright (c) 2011 by Rhesa Rozendaal. +This software is copyright (c) 2013 by Rhesa Rozendaal. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libmethod-signatures-simple-perl-1.02/debian/changelog libmethod-signatures-simple-perl-1.07/debian/changelog --- libmethod-signatures-simple-perl-1.02/debian/changelog 2011-09-01 22:58:54.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/debian/changelog 2013-10-01 15:18:44.000000000 +0000 @@ -1,3 +1,22 @@ +libmethod-signatures-simple-perl (1.07-1) unstable; urgency=low + + * Team upload + + [ Salvatore Bonaccorso ] + * Change Vcs-Git to canonical URI (git://anonscm.debian.org) + * Change search.cpan.org based URIs to metacpan.org based URIs + + [ Axel Beckert ] + * debian/copyright: migrate pre-1.0 format to 1.0 using "cme fix dpkg- + copyright" + + [ Nuno Carvalho ] + * New upstream release + * debian/control: update standards version + * debian/copyright: update copyright years + + -- Nuno Carvalho Tue, 01 Oct 2013 16:05:37 +0100 + libmethod-signatures-simple-perl (1.02-1) unstable; urgency=low * New upstream release. diff -Nru libmethod-signatures-simple-perl-1.02/debian/control libmethod-signatures-simple-perl-1.07/debian/control --- libmethod-signatures-simple-perl-1.02/debian/control 2011-09-01 22:58:54.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/debian/control 2013-10-01 15:18:44.000000000 +0000 @@ -7,9 +7,9 @@ Maintainer: Debian Perl Group Uploaders: Jonathan Yu , gregor herrmann -Standards-Version: 3.9.2 -Homepage: http://search.cpan.org/dist/Method-Signatures-Simple/ -Vcs-Git: git://git.debian.org/pkg-perl/packages/libmethod-signatures-simple-perl.git +Standards-Version: 3.9.4 +Homepage: https://metacpan.org/release/Method-Signatures-Simple/ +Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libmethod-signatures-simple-perl.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libmethod-signatures-simple-perl.git Package: libmethod-signatures-simple-perl diff -Nru libmethod-signatures-simple-perl-1.02/debian/copyright libmethod-signatures-simple-perl-1.07/debian/copyright --- libmethod-signatures-simple-perl-1.02/debian/copyright 2011-09-01 22:58:54.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/debian/copyright 2013-10-01 15:18:44.000000000 +0000 @@ -1,10 +1,10 @@ -Format-Specification: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?view=markup&pathrev=135 -Maintainer: Rhesa Rozendaal -Source: http://search.cpan.org/dist/Method-Signatures-Simple/ -Name: Method-Signatures-Simple +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Method-Signatures-Simple +Upstream-Contact: Rhesa Rozendaal +Source: https://metacpan.org/release/Method-Signatures-Simple/ Files: * -Copyright: 2008-2011, Rhesa Rozendaal +Copyright: 2008-2013, Rhesa Rozendaal License: Artistic or GPL-1+ Files: debian/* diff -Nru libmethod-signatures-simple-perl-1.02/debian/watch libmethod-signatures-simple-perl-1.07/debian/watch --- libmethod-signatures-simple-perl-1.02/debian/watch 2011-09-01 22:58:54.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/debian/watch 2013-10-01 15:18:44.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -http://search.cpan.org/dist/Method-Signatures-Simple/ .*/Method-Signatures-Simple-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ +https://metacpan.org/release/Method-Signatures-Simple/ .*/Method-Signatures-Simple-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ diff -Nru libmethod-signatures-simple-perl-1.02/dist.ini libmethod-signatures-simple-perl-1.07/dist.ini --- libmethod-signatures-simple-perl-1.02/dist.ini 2011-09-01 19:17:07.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/dist.ini 2013-01-20 22:06:25.000000000 +0000 @@ -1,5 +1,5 @@ name = Method-Signatures-Simple -version = 1.02 +version = 1.07 abstract = Basic method declarations with signatures, without source filters author = Rhesa Rozendaal license = Perl_5 diff -Nru libmethod-signatures-simple-perl-1.02/lib/Method/Signatures/Simple.pm libmethod-signatures-simple-perl-1.07/lib/Method/Signatures/Simple.pm --- libmethod-signatures-simple-perl-1.02/lib/Method/Signatures/Simple.pm 2011-09-01 19:17:07.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/lib/Method/Signatures/Simple.pm 2013-01-20 22:06:25.000000000 +0000 @@ -1,6 +1,6 @@ package Method::Signatures::Simple; -BEGIN { - $Method::Signatures::Simple::VERSION = '1.02'; +{ + $Method::Signatures::Simple::VERSION = '1.07'; } use warnings; @@ -12,11 +12,11 @@ =head1 VERSION -version 1.02 +version 1.07 =cut -use base q/Devel::Declare::MethodInstaller::Simple/; +use base 'Devel::Declare::MethodInstaller::Simple'; sub import { my $class = shift; @@ -49,18 +49,44 @@ } } +sub strip_proto { + my $self = shift; + my ($proto) = $self->SUPER::strip_proto() + or return ''; + # we strip comments and newlines here, and stash the number of newlines. + # we will re-inject the newlines in strip_attrs(), because DD does not + # like it when you inject them into the following code block. it does not + # object to tacking on newlines to the code attribute spec though. + # (see the call to inject_if_block() in DD::MethodInstaller::Simple->parser) + $proto =~ s/\s*#.*$//mg; + $self->{__nls} = $proto =~ s/[\r\n]//g; + $proto; +} + +sub strip_attrs { + my $self = shift; + my ($attrs) = $self->SUPER::strip_attrs(); + $attrs ||= ''; + $attrs .= $/ x $self->{__nls} if $self->{__nls}; + $attrs; +} + sub parse_proto { my $self = shift; my ($proto) = @_; $proto ||= ''; + $proto =~ s/\s*#.*$//mg; + $proto =~ s/^\s+//mg; + $proto =~ s/\s+$//mg; $proto =~ s/[\r\n]//g; my $invocant = $self->{invocant}; - $invocant = $1 if $proto =~ s{^(\$\w+):\s*}{}; + $invocant = $1 if $proto =~ s{(\$\w+)\s*:\s*}{}; my $inject = ''; $inject .= "my ${invocant} = shift;" if $invocant; $inject .= "my ($proto) = \@_;" if defined $proto and length $proto; + $inject .= '();'; # fix for empty method body return $inject; } diff -Nru libmethod-signatures-simple-perl-1.02/t/01-parse-proto.t libmethod-signatures-simple-perl-1.07/t/01-parse-proto.t --- libmethod-signatures-simple-perl-1.02/t/01-parse-proto.t 2011-09-01 19:17:07.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/t/01-parse-proto.t 2013-01-20 22:06:25.000000000 +0000 @@ -13,7 +13,7 @@ ['$class: %opts' => [ qr'my \$class = shift;', qr'my \(\%opts\) = \@_;' ]], ['@stuff' => [ qr'my \$self = shift;', qr'my \(\@stuff\) = \@_;' ]], ['$foo, $bar' => [ qr'my \$self = shift;', qr'my \(\$foo, \$bar\) = \@_;' ]], - ["$/foo, $/bar$/" => [ qr'my \$self = shift;', qr'my \(foo, bar\) = \@_;' ]], + ["$/foo, $/bar$/" => [ qr'my \$self = shift;', qr'my \(foo,bar\) = \@_;' ]], ); for my $t (@tests) { diff -Nru libmethod-signatures-simple-perl-1.02/t/RT80505.t libmethod-signatures-simple-perl-1.07/t/RT80505.t --- libmethod-signatures-simple-perl-1.02/t/RT80505.t 1970-01-01 00:00:00.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/t/RT80505.t 2013-01-20 22:06:25.000000000 +0000 @@ -0,0 +1,30 @@ + +use strict; +use warnings; +use Test::More tests => 2; + +{ + package My::Obj; + use Method::Signatures::Simple; + method new () { + bless {}, $self; + } + method foo ( + $x, # the X + $y, # the Y + ) { + return $x * $y; + } + my $bar = method ( + $P, # comment + $Q, # comment + ) { # comment + $P + $Q + }; +} + +my $o = My::Obj->new; +is $o->foo(4, 5), 20, "should allow comments and newlines in proto"; +is __LINE__, 28, "should leave line number intact"; + +__END__ diff -Nru libmethod-signatures-simple-perl-1.02/t/RT80507.t libmethod-signatures-simple-perl-1.07/t/RT80507.t --- libmethod-signatures-simple-perl-1.02/t/RT80507.t 1970-01-01 00:00:00.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/t/RT80507.t 2013-01-20 22:06:25.000000000 +0000 @@ -0,0 +1,27 @@ +use strict; +use warnings; + +use Method::Signatures::Simple; +use Test::More tests => 2; + +{ + my $uniq = 0; + + method fresh_name() { + $self->prefix . $uniq++ + } +} + +method prefix() { + $self->{prefix} +} + +my $o = bless {prefix => "foo_" }, main::; +is $o->fresh_name, 'foo_0'; + +TODO: { + local $TODO = 'do not know how to handle the scope change in line 7'; + is __LINE__, 24; +} + +__END__ diff -Nru libmethod-signatures-simple-perl-1.02/t/RT80508.t libmethod-signatures-simple-perl-1.07/t/RT80508.t --- libmethod-signatures-simple-perl-1.02/t/RT80508.t 1970-01-01 00:00:00.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/t/RT80508.t 2013-01-20 22:06:25.000000000 +0000 @@ -0,0 +1,17 @@ + +use strict; +use warnings; +use Test::More tests => 1; + +{ + package My::Obj; + use Method::Signatures::Simple; + + method with_space ( $this : $that ) { + return ($this, $that); + } +} + +is_deeply [ My::Obj->with_space (1) ], [ 'My::Obj', 1 ], 'space between invocant name and colon should parse'; + +__END__ diff -Nru libmethod-signatures-simple-perl-1.02/t/RT80510.t libmethod-signatures-simple-perl-1.07/t/RT80510.t --- libmethod-signatures-simple-perl-1.02/t/RT80510.t 1970-01-01 00:00:00.000000000 +0000 +++ libmethod-signatures-simple-perl-1.07/t/RT80510.t 2013-01-20 22:06:25.000000000 +0000 @@ -0,0 +1,13 @@ + +use strict; +use warnings; +use Test::More tests => 2; + +use Method::Signatures::Simple; + +func empty ($x) {} + +is scalar empty(1), undef, "empty func returns nothing (scalar context)"; +is_deeply [empty(1,2)], [], "empty func returns nothing (list context)"; + +__END__