r17714 - in /trunk/libmoosex-getopt-perl: ./ debian/ lib/MooseX/ lib/MooseX/Getopt/ lib/MooseX/Getopt/Meta/ lib/MooseX/Getopt/Meta/Attribute/ lib/MooseX/Getopt/Meta/Attribute/Trait/ t/
roberto at users.alioth.debian.org
roberto at users.alioth.debian.org
Mon Mar 17 02:49:07 UTC 2008
Author: roberto
Date: Mon Mar 17 02:49:06 2008
New Revision: 17714
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=17714
Log:
* New upstream release.
Added:
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait/
- copied from r17713, branches/upstream/libmoosex-getopt-perl/current/lib/MooseX/Getopt/Meta/Attribute/Trait/
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute/Trait.pm
- copied unchanged from r17713, branches/upstream/libmoosex-getopt-perl/current/lib/MooseX/Getopt/Meta/Attribute/Trait.pm
trunk/libmoosex-getopt-perl/t/006_metaclass_traits.t
- copied unchanged from r17713, branches/upstream/libmoosex-getopt-perl/current/t/006_metaclass_traits.t
trunk/libmoosex-getopt-perl/t/007_nogetopt_trait.t
- copied unchanged from r17713, branches/upstream/libmoosex-getopt-perl/current/t/007_nogetopt_trait.t
Removed:
trunk/libmoosex-getopt-perl/MANIFEST.SKIP
Modified:
trunk/libmoosex-getopt-perl/Build.PL
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/lib/MooseX/Getopt.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/OptionTypeMap.pm
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Strict.pm
trunk/libmoosex-getopt-perl/t/001_basic.t
Modified: trunk/libmoosex-getopt-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/Build.PL?rev=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/Build.PL (original)
+++ trunk/libmoosex-getopt-perl/Build.PL Mon Mar 17 02:49:06 2008
@@ -6,10 +6,11 @@
module_name => 'MooseX::Getopt',
license => 'perl',
requires => {
- 'Moose' => '0.19',
+ 'Moose' => '0.39',
'Getopt::Long' => '2.34',
},
optional => {
+ 'Getopt::Long::Descriptive' => 0,
},
build_requires => {
'Test::More' => '0.62',
Modified: trunk/libmoosex-getopt-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/ChangeLog?rev=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/ChangeLog (original)
+++ trunk/libmoosex-getopt-perl/ChangeLog Mon Mar 17 02:49:06 2008
@@ -1,19 +1,35 @@
Revision history for Perl extension MooseX-Getopt
+
+0.12 Fri. March 14, 2008
+ ~~ updated copyright dates ~~
+
+ - upped the Moose dependency to support
+ the custom metaclass traits
+ - added Getopt::Long::Descriptive as an
+ optional dependency
+
+ * MooseX::Getopt
+ MooseX::Getopt::Meta::Attribute
+ MooseX::Getopt::Meta::Attribute::Trait
+ MooseX::Getopt::Meta::Attribute::NoGetopt
+ MooseX::Getopt::Meta::Attribute::Trait::NoGetopt
+ - added support for custom metaclass traits
+ - added tests for this
0.11 Sun. Jan. 27, 2008
* MooseX::Getopt
- - Commandline option shouldn't be required in the
- case that the given "required" attribute has
- a default or a builder method.
+ - Commandline option shouldn't be required in the
+ case that the given "required" attribute has
+ a default or a builder method.
0.10 Wed. Jan. 23, 2008
* MooseX::Getopt
- - Support default configfile attribute when
- used with MooseX::ConfigFromFile-based roles
+ - Support default configfile attribute when
+ used with MooseX::ConfigFromFile-based roles
0.09 Tues. Jan. 22, 2008
* MooseX::Getopt
- - Use Getopt::Long::Descriptive if it's available
+ - Use Getopt::Long::Descriptive if it's available
0.08 Tues. Dec. 8, 2007
* MooseX::Getopt
Modified: trunk/libmoosex-getopt-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/MANIFEST?rev=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/MANIFEST (original)
+++ trunk/libmoosex-getopt-perl/MANIFEST Mon Mar 17 02:49:06 2008
@@ -1,20 +1,23 @@
Build.PL
ChangeLog
-META.yml
+lib/MooseX/Getopt.pm
+lib/MooseX/Getopt/Meta/Attribute.pm
+lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm
+lib/MooseX/Getopt/Meta/Attribute/Trait.pm
+lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm
+lib/MooseX/Getopt/OptionTypeMap.pm
+lib/MooseX/Getopt/Strict.pm
Makefile.PL
MANIFEST
-MANIFEST.SKIP
+META.yml
README
-lib/MooseX/Getopt.pm
-lib/MooseX/Getopt/OptionTypeMap.pm
-lib/MooseX/Getopt/Strict.pm
-lib/MooseX/Getopt/Meta/Attribute.pm
-lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm
t/000_load.t
t/001_basic.t
t/002_custom_option_type.t
t/003_inferred_option_type.t
t/004_nogetop.t
t/005_strict.t
+t/006_metaclass_traits.t
+t/007_nogetopt_trait.t
t/pod.t
t/pod_coverage.t
Modified: trunk/libmoosex-getopt-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/META.yml?rev=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/META.yml (original)
+++ trunk/libmoosex-getopt-perl/META.yml Mon Mar 17 02:49:06 2008
@@ -1,6 +1,6 @@
---
name: MooseX-Getopt
-version: 0.11
+version: 0.12
author:
- 'Stevan Little E<lt>stevan at iinteractive.comE<gt>'
- 'Brandon L. Black, E<lt>blblack at gmail.comE<gt>'
@@ -10,26 +10,32 @@
license: http://dev.perl.org/licenses/
requires:
Getopt::Long: 2.34
- Moose: 0.19
+ Moose: 0.39
build_requires:
Test::Exception: 0.21
Test::More: 0.62
provides:
MooseX::Getopt:
file: lib/MooseX/Getopt.pm
- version: 0.11
+ version: 0.12
MooseX::Getopt::Meta::Attribute:
file: lib/MooseX/Getopt/Meta/Attribute.pm
- version: 0.04
+ version: 0.05
MooseX::Getopt::Meta::Attribute::NoGetopt:
file: lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm
+ version: 0.02
+ MooseX::Getopt::Meta::Attribute::Trait:
+ file: lib/MooseX/Getopt/Meta/Attribute/Trait.pm
+ version: 0.01
+ MooseX::Getopt::Meta::Attribute::Trait::NoGetopt:
+ file: lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm
version: 0.01
MooseX::Getopt::OptionTypeMap:
file: lib/MooseX/Getopt/OptionTypeMap.pm
version: 0.03
MooseX::Getopt::Strict:
file: lib/MooseX/Getopt/Strict.pm
-generated_by: Module::Build version 0.280801
+generated_by: Module::Build version 0.2808
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
version: 1.2
Modified: trunk/libmoosex-getopt-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/Makefile.PL?rev=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/Makefile.PL (original)
+++ trunk/libmoosex-getopt-perl/Makefile.PL Mon Mar 17 02:49:06 2008
@@ -1,17 +1,17 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.2808_01
+# Note: this file was auto-generated by Module::Build::Compat version 0.03
use ExtUtils::MakeMaker;
WriteMakefile
(
- 'PL_FILES' => {},
- 'INSTALLDIRS' => 'site',
'NAME' => 'MooseX::Getopt',
- 'EXE_FILES' => [],
'VERSION_FROM' => 'lib/MooseX/Getopt.pm',
'PREREQ_PM' => {
- 'Test::More' => '0.62',
'Getopt::Long' => '2.34',
+ 'Moose' => '0.39',
'Test::Exception' => '0.21',
- 'Moose' => '0.19'
- }
+ 'Test::More' => '0.62'
+ },
+ 'INSTALLDIRS' => 'site',
+ 'EXE_FILES' => [],
+ 'PL_FILES' => {}
)
;
Modified: trunk/libmoosex-getopt-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/README?rev=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/README (original)
+++ trunk/libmoosex-getopt-perl/README Mon Mar 17 02:49:06 2008
@@ -1,4 +1,4 @@
-MooseX::Getopt version 0.07
+MooseX::Getopt version 0.12
===========================
See the individual module documentation for more information
@@ -21,7 +21,7 @@
COPYRIGHT AND LICENCE
-Copyright (C) 2007 Infinity Interactive, Inc.
+Copyright (C) 2007-2008 Infinity Interactive, Inc.
http://www.iinteractive.com
Modified: trunk/libmoosex-getopt-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/debian/changelog?rev=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/debian/changelog (original)
+++ trunk/libmoosex-getopt-perl/debian/changelog Mon Mar 17 02:49:06 2008
@@ -1,3 +1,9 @@
+libmoosex-getopt-perl (0.12-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Roberto C. Sanchez <roberto at debian.org> Sun, 16 Mar 2008 22:48:46 -0400
+
libmoosex-getopt-perl (0.11-1) unstable; urgency=low
* New upstream release.
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=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm Mon Mar 17 02:49:06 2008
@@ -9,7 +9,7 @@
use Getopt::Long (); # GLD uses it anyway, doesn't hurt
use constant HAVE_GLD => not not eval { require Getopt::Long::Descriptive };
-our $VERSION = '0.11';
+our $VERSION = '0.12';
our $AUTHORITY = 'cpan:STEVAN';
has ARGV => (is => 'rw', isa => 'ArrayRef', metaclass => "NoGetopt");
@@ -107,7 +107,11 @@
foreach my $opt ( @{ $params{options} } ) {
push @options, $opt->{opt_string};
- $name_to_init_arg{ $opt->{name} } = $opt->{init_arg};
+
+ my $identifier = $opt->{name};
+ $identifier =~ s/\W/_/g; # Getopt::Long does this to all option names
+
+ $name_to_init_arg{$identifier} = $opt->{init_arg};
}
return ( \@options, \%name_to_init_arg );
@@ -128,7 +132,10 @@
},
];
- $name_to_init_arg{ $opt->{name} } = $opt->{init_arg};
+ my $identifier = $opt->{name};
+ $identifier =~ s/\W/_/g; # Getopt::Long does this to all option names
+
+ $name_to_init_arg{$identifier} = $opt->{init_arg};
}
return ( \@options, \%name_to_init_arg );
@@ -137,12 +144,27 @@
sub _compute_getopt_attrs {
my $class = shift;
grep {
- $_->isa("MooseX::Getopt::Meta::Attribute")
+ $_->does("MooseX::Getopt::Meta::Attribute::Trait")
or
$_->name !~ /^_/
- &&
- !$_->isa('MooseX::Getopt::Meta::Attribute::NoGetopt')
+ } grep {
+ !$_->does('MooseX::Getopt::Meta::Attribute::Trait::NoGetopt')
} $class->meta->compute_all_applicable_attributes
+}
+
+sub _get_cmd_flags_for_attr {
+ my ( $class, $attr ) = @_;
+
+ my $flag = $attr->name;
+
+ my @aliases;
+
+ if ($attr->does('MooseX::Getopt::Meta::Attribute::Trait')) {
+ $flag = $attr->cmd_flag if $attr->has_cmd_flag;
+ @aliases = @{ $attr->cmd_aliases } if $attr->has_cmd_aliases;
+ }
+
+ return ( $flag, @aliases );
}
sub _attrs_to_options {
@@ -151,18 +173,9 @@
my @options;
foreach my $attr ($class->_compute_getopt_attrs) {
- my $name = $attr->name;
-
- my $aliases;
-
- if ($attr->isa('MooseX::Getopt::Meta::Attribute')) {
- $name = $attr->cmd_flag if $attr->has_cmd_flag;
- $aliases = $attr->cmd_aliases if $attr->has_cmd_aliases;
- }
-
- my $opt_string = $aliases
- ? join(q{|}, $name, @$aliases)
- : $name;
+ my ( $flag, @aliases ) = $class->_get_cmd_flags_for_attr($attr);
+
+ my $opt_string = join(q{|}, $flag, @aliases);
if ($attr->has_type_constraint) {
my $type_name = $attr->type_constraint->name;
@@ -172,7 +185,7 @@
}
push @options, {
- name => $name,
+ name => $flag,
init_arg => $attr->init_arg,
opt_string => $opt_string,
required => $attr->is_required && !$attr->has_default && !$attr->has_builder,
@@ -412,7 +425,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>
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=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Meta/Attribute.pm Mon Mar 17 02:49:06 2008
@@ -3,31 +3,11 @@
use Moose;
use Moose::Util::TypeConstraints;
-our $VERSION = '0.04';
+our $VERSION = '0.05';
our $AUTHORITY = 'cpan:STEVAN';
extends 'Moose::Meta::Attribute'; # << Moose extending Moose :)
-
-has 'cmd_flag' => (
- is => 'rw',
- isa => 'Str',
- predicate => 'has_cmd_flag',
-);
-
-# This subtype is to support scalar -> arrayref coercion
-# without polluting the built-in types
-subtype '_MooseX_Getopt_CmdAliases' => as 'ArrayRef';
-
-coerce '_MooseX_Getopt_CmdAliases'
- => from 'Str'
- => via { [$_] };
-
-has 'cmd_aliases' => (
- is => 'rw',
- isa => '_MooseX_Getopt_CmdAliases',
- predicate => 'has_cmd_aliases',
- coerce => 1,
-);
+ with 'MooseX::Getopt::Meta::Attribute::Trait';
no Moose;
@@ -129,7 +109,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>
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=17714&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 Mon Mar 17 02:49:06 2008
@@ -2,10 +2,11 @@
package MooseX::Getopt::Meta::Attribute::NoGetopt;
use Moose;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
our $AUTHORITY = 'cpan:STEVAN';
extends 'Moose::Meta::Attribute'; # << Moose extending Moose :)
+ with 'MooseX::Getopt::Meta::Attribute::Trait::NoGetopt';
no Moose;
@@ -69,7 +70,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>
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=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/OptionTypeMap.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/OptionTypeMap.pm Mon Mar 17 02:49:06 2008
@@ -106,7 +106,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>
Modified: trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Strict.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Strict.pm?rev=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Strict.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt/Strict.pm Mon Mar 17 02:49:06 2008
@@ -50,7 +50,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2008 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>
Modified: trunk/libmoosex-getopt-perl/t/001_basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/t/001_basic.t?rev=17714&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/t/001_basic.t (original)
+++ trunk/libmoosex-getopt-perl/t/001_basic.t Mon Mar 17 02:49:06 2008
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 53;
+use Test::More tests => 69;
BEGIN {
use_ok('MooseX::Getopt');
@@ -79,6 +79,14 @@
}
+foreach my $attr_name (qw(data cow horse _private_stuff_cmdline)) {
+ my $attr = App->meta->get_attribute($attr_name);
+ isa_ok($attr, 'Moose::Meta::Attribute');
+ isa_ok($attr, 'MooseX::Getopt::Meta::Attribute');
+ can_ok($attr, 'cmd_flag');
+ can_ok($attr, 'cmd_aliases');
+}
+
{
local @ARGV = ();
More information about the Pkg-perl-cvs-commits
mailing list