r53557 - in /trunk/libmoosex-getopt-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/MooseX/ lib/MooseX/Getopt/ lib/MooseX/Getopt/Meta/ lib/MooseX/Getopt/Meta/Attribute/ lib/MooseX/Getopt/Meta/Attribute/Trait/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Wed Mar 3 16:22:26 UTC 2010
Author: jawnsy-guest
Date: Wed Mar 3 16:22:15 2010
New Revision: 53557
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=53557
Log:
* New upstream release
* Standards-Version 3.8.4 (no changes)
* Bumps GLD dep to 0.081, possibly preventing FTBFS
Removed:
trunk/libmoosex-getopt-perl/inc/Module/Install/AutoManifest.pm
Modified:
trunk/libmoosex-getopt-perl/ChangeLog
trunk/libmoosex-getopt-perl/MANIFEST
trunk/libmoosex-getopt-perl/META.yml
trunk/libmoosex-getopt-perl/Makefile.PL
trunk/libmoosex-getopt-perl/README
trunk/libmoosex-getopt-perl/debian/changelog
trunk/libmoosex-getopt-perl/debian/control
trunk/libmoosex-getopt-perl/inc/Module/Install.pm
trunk/libmoosex-getopt-perl/inc/Module/Install/Base.pm
trunk/libmoosex-getopt-perl/inc/Module/Install/Can.pm
trunk/libmoosex-getopt-perl/inc/Module/Install/Fetch.pm
trunk/libmoosex-getopt-perl/inc/Module/Install/Makefile.pm
trunk/libmoosex-getopt-perl/inc/Module/Install/Metadata.pm
trunk/libmoosex-getopt-perl/inc/Module/Install/Win32.pm
trunk/libmoosex-getopt-perl/inc/Module/Install/WriteAll.pm
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Dashes.pm
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute.pm
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait.pm
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/OptionTypeMap.pm
trunk/libmoosex-getopt-perl/t/010_dashes.t
Modified: trunk/libmoosex-getopt-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/ChangeLog?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/ChangeLog (original)
+++ trunk/libmoosex-getopt-perl/ChangeLog Wed Mar 3 16:22:15 2010
@@ -1,4 +1,12 @@
Revision history for Perl extension MooseX-Getopt
+
+ * Makefile.PL:
+ - Bump dependency to Getopt::Long::Descriptive to 0.081 in an attempt to
+ avoid test failures.
+
+ * MooseX::Getopt::Dashes
+ - Document that using a cmd_flag argument to attributes can be used to
+ override the tr/_/-/ replacement ::Dashes does on attribute names
0.26 Thu. Dec 10 2009
* MooseX::Getopt::Basic
@@ -42,7 +50,7 @@
default config file name.
0.20 Wed. July 9 2009
- - fix MANIFEST.SKIP to avoid double-packaging
+ - fix MANIFEST.SKIP to avoid double-packaging
0.19 Wed. July 8 2009
* MooseX::Getopt
@@ -62,25 +70,25 @@
* MooseX::Getopt
- work with latest Moose (hdp)
- ~ unify module version numbers with dist version (hdp)
+ ~ unify module version numbers with dist version (hdp)
0.16 Tue. February 17 2009
- * t/
- - run pod tests only if RELEASE_TESTING env var is set
+ * t/
+ - run pod tests only if RELEASE_TESTING env var is set
0.15 Sat. July 26 2008
- * MooseX::Getopt::OptionTypeMap
- - Accept type constraint objects in the type mapping, not just names
+ * MooseX::Getopt::OptionTypeMap
+ - Accept type constraint objects in the type mapping, not just names
0.14 Thurs. July 10, 2008
- * MooseX::Getopt::OptionTypeMap
- - Change 'Float' which doesn't exist to 'Num' which does (perigrin)
-
- * MooseX::Getopt
- - removed the default handling with Getopt::Long::Descriptive
- as it would override constructor parameters and that was
- bad. Besides, Moose will just DWIM on this anyway. (stevan)
- - added test for it (stevan)
+ * MooseX::Getopt::OptionTypeMap
+ - Change 'Float' which doesn't exist to 'Num' which does (perigrin)
+
+ * MooseX::Getopt
+ - removed the default handling with Getopt::Long::Descriptive
+ as it would override constructor parameters and that was
+ bad. Besides, Moose will just DWIM on this anyway. (stevan)
+ - added test for it (stevan)
* t/
- fixed Getopt::Long::Descriptive specific tests to only run
Modified: trunk/libmoosex-getopt-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/MANIFEST?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/MANIFEST (original)
+++ trunk/libmoosex-getopt-perl/MANIFEST Wed Mar 3 16:22:15 2010
@@ -2,7 +2,6 @@
inc/Module/Install.pm
inc/Module/Install/AuthorRequires.pm
inc/Module/Install/AuthorTests.pm
-inc/Module/Install/AutoManifest.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
Modified: trunk/libmoosex-getopt-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/META.yml?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/META.yml (original)
+++ trunk/libmoosex-getopt-perl/META.yml Wed Mar 3 16:22:15 2010
@@ -10,7 +10,7 @@
configure_requires:
ExtUtils::MakeMaker: 6.42
distribution_type: module
-generated_by: 'Module::Install version 0.910'
+generated_by: 'Module::Install version 0.94'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -22,9 +22,9 @@
- t
requires:
Getopt::Long: 2.37
- Getopt::Long::Descriptive: 0.077
+ Getopt::Long::Descriptive: 0.081
Moose: 0.56
resources:
license: http://dev.perl.org/licenses/
repository: git://git.moose.perl.org/MooseX-Getopt.git
-version: 0.26
+version: 0.27
Modified: trunk/libmoosex-getopt-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/Makefile.PL?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/Makefile.PL (original)
+++ trunk/libmoosex-getopt-perl/Makefile.PL Wed Mar 3 16:22:15 2010
@@ -16,7 +16,7 @@
requires 'Getopt::Long' => '2.37';
# optional
-requires 'Getopt::Long::Descriptive' => '0.077';
+requires 'Getopt::Long::Descriptive' => '0.081';
build_requires 'Test::Moose';
build_requires 'Test::More' => '0.62';
Modified: trunk/libmoosex-getopt-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/README?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/README (original)
+++ trunk/libmoosex-getopt-perl/README Wed Mar 3 16:22:15 2010
@@ -1,4 +1,4 @@
-MooseX::Getopt version 0.26
+MooseX::Getopt version 0.27
===========================
See the individual module documentation for more information
Modified: trunk/libmoosex-getopt-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/debian/changelog?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/debian/changelog (original)
+++ trunk/libmoosex-getopt-perl/debian/changelog Wed Mar 3 16:22:15 2010
@@ -1,3 +1,11 @@
+libmoosex-getopt-perl (0.27-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * Standards-Version 3.8.4 (no changes)
+ * Bumps GLD dep to 0.081, possibly preventing FTBFS
+
+ -- Jonathan Yu <jawnsy at cpan.org> Wed, 03 Mar 2010 11:46:54 -0500
+
libmoosex-getopt-perl (0.26-1) unstable; urgency=low
* New upstream release
Modified: trunk/libmoosex-getopt-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/debian/control?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/debian/control (original)
+++ trunk/libmoosex-getopt-perl/debian/control Wed Mar 3 16:22:15 2010
@@ -2,14 +2,14 @@
Section: perl
Priority: optional
Build-Depends: debhelper (>= 7.0.50)
-Build-Depends-Indep: perl, libgetopt-long-descriptive-perl (>= 0.077),
+Build-Depends-Indep: perl, libgetopt-long-descriptive-perl (>= 0.081),
libmoose-perl (>= 0.56), libtest-pod-perl, libtest-pod-coverage-perl,
libtest-exception-perl, libclass-mop-perl (>= 0.49)
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Damyan Ivanov <dmn at debian.org>, Jonathan Yu <jawnsy at cpan.org>,
Krzysztof Krzyżaniak (eloy) <eloy at debian.org>, Niko Tyni <ntyni at debian.org>,
gregor herrmann <gregoa at debian.org>, Ryan Niebur <ryan at debian.org>
-Standards-Version: 3.8.3
+Standards-Version: 3.8.4
Homepage: http://search.cpan.org/dist/MooseX-Getopt/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libmoosex-getopt-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libmoosex-getopt-perl/
@@ -17,7 +17,7 @@
Package: libmoosex-getopt-perl
Architecture: all
Depends: ${perl:Depends}, ${misc:Depends}, libmoose-perl (>= 0.56),
- libgetopt-long-descriptive-perl (>= 0.077)
+ libgetopt-long-descriptive-perl (>= 0.081)
Description: Moose extension for processing command line options
MooseX::Getopt is a Moose role which provides an alternate constructor for
creating objects using parameters passed in from the command line. This module
Modified: trunk/libmoosex-getopt-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/inc/Module/Install.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/inc/Module/Install.pm (original)
+++ trunk/libmoosex-getopt-perl/inc/Module/Install.pm Wed Mar 3 16:22:15 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.94';
# 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: trunk/libmoosex-getopt-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/inc/Module/Install/Base.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libmoosex-getopt-perl/inc/Module/Install/Base.pm Wed Mar 3 16:22:15 2010
@@ -4,7 +4,7 @@
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.94';
}
# Suspend handler for "redefined" warnings
Modified: trunk/libmoosex-getopt-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/inc/Module/Install/Can.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libmoosex-getopt-perl/inc/Module/Install/Can.pm Wed Mar 3 16:22:15 2010
@@ -9,7 +9,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.94';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libmoosex-getopt-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/inc/Module/Install/Fetch.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libmoosex-getopt-perl/inc/Module/Install/Fetch.pm Wed Mar 3 16:22:15 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.94';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libmoosex-getopt-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/inc/Module/Install/Makefile.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libmoosex-getopt-perl/inc/Module/Install/Makefile.pm Wed Mar 3 16:22:15 2010
@@ -7,7 +7,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.94';
@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}
@@ -107,6 +118,9 @@
%test_dir = ();
require File::Find;
File::Find::find( \&_wanted_t, $dir );
+ if ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
+ File::Find::find( \&_wanted_t, 'xt' );
+ }
$self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir );
}
@@ -130,12 +144,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 );
}
@@ -145,57 +160,87 @@
$args->{NAME} = $self->module_name || $self->name;
$args->{VERSION} = $self->version;
$args->{NAME} =~ s/-/::/g;
+ $DB::single = 1;
if ( $self->tests ) {
- $args->{test} = { TESTS => $self->tests };
+ $args->{test} = {
+ TESTS => $self->tests,
+ };
+ } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
+ $args->{test} = {
+ TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ),
+ };
}
if ( $] >= 5.005 ) {
$args->{ABSTRACT} = $self->abstract;
$args->{AUTHOR} = $self->author;
}
- if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
- $args->{NO_META} = 1;
- }
- if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) {
+ if ( $self->makemaker(6.10) ) {
+ $args->{NO_META} = 1;
+ #$args->{NO_MYMETA} = 1;
+ }
+ 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;
- my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args;
+ my %args = map {
+ ( $_ => $args->{$_} ) } grep {defined($args->{$_} )
+ } keys %$args;
my $user_preop = delete $args{dist}->{PREOP};
- if (my $preop = $self->admin->preop($user_preop)) {
+ if ( my $preop = $self->admin->preop($user_preop) ) {
foreach my $key ( keys %$preop ) {
$args{dist}->{$key} = $preop->{$key};
}
@@ -265,4 +310,4 @@
__END__
-#line 394
+#line 439
Modified: trunk/libmoosex-getopt-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/inc/Module/Install/Metadata.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libmoosex-getopt-perl/inc/Module/Install/Metadata.pm Wed Mar 3 16:22:15 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.94';
@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,9 @@
/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,
+ 'Artistic and GPL' => 'perl', 1,
'GNU general public license' => 'gpl', 1,
'GNU public license' => 'gpl', 1,
'GNU lesser general public license' => 'lgpl', 1,
@@ -456,20 +468,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 +509,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: trunk/libmoosex-getopt-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/inc/Module/Install/Win32.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libmoosex-getopt-perl/inc/Module/Install/Win32.pm Wed Mar 3 16:22:15 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';
+ $VERSION = '0.94';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: trunk/libmoosex-getopt-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/inc/Module/Install/WriteAll.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libmoosex-getopt-perl/inc/Module/Install/WriteAll.pm Wed Mar 3 16:22:15 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.91';;
+ $VERSION = '0.94';;
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm Wed Mar 3 16:22:15 2010
@@ -3,7 +3,7 @@
use constant _HAVE_GLD => not not eval { require Getopt::Long::Descriptive };
-our $VERSION = '0.26';
+our $VERSION = '0.27';
our $AUTHORITY = 'cpan:STEVAN';
with _HAVE_GLD ? 'MooseX::Getopt::GLD' : 'MooseX::Getopt::Basic';
Modified: trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Dashes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Dashes.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Dashes.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Dashes.pm Wed Mar 3 16:22:15 2010
@@ -31,12 +31,33 @@
use Moose;
with 'MooseX::Getopt::Dashes';
+ # Will be called as --some-thingy, not --some_thingy
+ has 'some_thingy' => (
+ is => 'ro',
+ isa => 'Str',
+ default => 'foo'
+ );
+
+ # Will be called as --another_thingy, not --another-thingy
+ has 'another_thingy' => (
+ traits => [ 'Getopt' ],
+ cmd_flag => 'another_thingy'
+ is => 'ro',
+ isa => 'Str',
+ default => 'foo'
+ );
+
# use as MooseX::Getopt
=head1 DESCRIPTION
This is a version of C<MooseX::Getopt> which converts underscores in
attribute names to dashes when generating command line flags.
+
+You can selectively disable this on a per-attribute basis by supplying
+a L<cmd_flag|MooseX::Getopt::Meta::Attribute/METHODS> argument with
+the command flag you'd like for a given attribute. No underscore to
+dash replacement will be done on the C<cmd_flag>.
=head1 METHODS
@@ -60,6 +81,8 @@
Yuval Kogman C<< <nuffin at cpan.org> >>
+E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason E<lt>avar at cpan.orgE<gt>
+
=head1 COPYRIGHT AND LICENSE
Copyright 2007-2008 by Infinity Interactive, Inc.
Modified: trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute.pm Wed Mar 3 16:22:15 2010
@@ -3,7 +3,7 @@
use Moose;
use Moose::Util::TypeConstraints;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
our $AUTHORITY = 'cpan:STEVAN';
extends 'Moose::Meta::Attribute'; # << Moose extending Moose :)
Modified: trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm Wed Mar 3 16:22:15 2010
@@ -2,7 +2,7 @@
package MooseX::Getopt::Meta::Attribute::NoGetopt;
use Moose;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
our $AUTHORITY = 'cpan:STEVAN';
extends 'Moose::Meta::Attribute'; # << Moose extending Moose :)
Modified: trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait.pm Wed Mar 3 16:22:15 2010
@@ -3,7 +3,7 @@
use Moose::Role;
use Moose::Util::TypeConstraints;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
our $AUTHORITY = 'cpan:STEVAN';
has 'cmd_flag' => (
Modified: trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm Wed Mar 3 16:22:15 2010
@@ -2,7 +2,7 @@
package MooseX::Getopt::Meta::Attribute::Trait::NoGetopt;
use Moose::Role;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
our $AUTHORITY = 'cpan:STEVAN';
no Moose::Role;
Modified: trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/OptionTypeMap.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/OptionTypeMap.pm?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/OptionTypeMap.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/OptionTypeMap.pm Wed Mar 3 16:22:15 2010
@@ -4,7 +4,7 @@
use Moose 'confess', 'blessed';
use Moose::Util::TypeConstraints 'find_type_constraint';
-our $VERSION = '0.26';
+our $VERSION = '0.27';
our $AUTHORITY = 'cpan:STEVAN';
my %option_type_map = (
Modified: trunk/libmoosex-getopt-perl/t/010_dashes.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/t/010_dashes.t?rev=53557&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/t/010_dashes.t (original)
+++ trunk/libmoosex-getopt-perl/t/010_dashes.t Wed Mar 3 16:22:15 2010
@@ -3,26 +3,27 @@
use strict;
use warnings;
-use Test::More tests => 3;
+use Test::More tests => 5;
use Test::Exception;
BEGIN {
- use_ok('MooseX::Getopt');
+ use_ok('MooseX::Getopt');
}
{
- package App;
- use Moose;
+ package App;
+ use Moose;
- with 'MooseX::Getopt::Dashes';
+ with 'MooseX::Getopt::Dashes';
- has 'some_thingy' => ( is => 'ro', isa => 'Str', default => 'foo' );
+ has 'some_thingy' => ( is => 'ro', isa => 'Str', default => 'foo' );
+ has 'another_thingy' => ( is => 'ro', isa => 'Str', default => 'foo', cmd_flag => 'another_thingy', traits => [ 'Getopt' ], );
}
{
- local @ARGV = (qw/--some-thingy bar/);
+ local @ARGV = (qw/--some-thingy bar/);
lives_and { is( App->new_with_options->some_thingy, 'bar') } 'Dash in option name';
}
@@ -30,3 +31,13 @@
local @ARGV = (qw/--some_thingy bar/);
throws_ok { App->new_with_options } qr/Unknown option: some_thingy/;
}
+
+{
+ local @ARGV = (qw/--another_thingy bar/);
+ lives_and { is( App->new_with_options->another_thingy, 'bar' ) } 'Underscore in option name';
+}
+
+{
+ local @ARGV = (qw/--another-thingy bar/);
+ throws_ok { App->new_with_options } qr/Unknown option: another-thingy/;
+}
More information about the Pkg-perl-cvs-commits
mailing list