r45236 - in /branches/upstream/libmoosex-getopt-perl/current: ChangeLog MANIFEST META.yml inc/Module/Install/AutoManifest.pm lib/MooseX/Getopt.pm t/008_configfromfile.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Fri Oct 2 17:11:53 UTC 2009
Author: jawnsy-guest
Date: Fri Oct 2 17:11:48 2009
New Revision: 45236
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=45236
Log:
[svn-upgrade] Integrating new upstream version, libmoosex-getopt-perl (0.23)
Added:
branches/upstream/libmoosex-getopt-perl/current/inc/Module/Install/AutoManifest.pm
Modified:
branches/upstream/libmoosex-getopt-perl/current/ChangeLog
branches/upstream/libmoosex-getopt-perl/current/MANIFEST
branches/upstream/libmoosex-getopt-perl/current/META.yml
branches/upstream/libmoosex-getopt-perl/current/lib/MooseX/Getopt.pm
branches/upstream/libmoosex-getopt-perl/current/t/008_configfromfile.t
Modified: branches/upstream/libmoosex-getopt-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-getopt-perl/current/ChangeLog?rev=45236&op=diff
==============================================================================
--- branches/upstream/libmoosex-getopt-perl/current/ChangeLog (original)
+++ branches/upstream/libmoosex-getopt-perl/current/ChangeLog Fri Oct 2 17:11:48 2009
@@ -1,4 +1,9 @@
Revision history for Perl extension MooseX-Getopt
+
+0.23 Fri. Oct 02 2009
+ * MooseX::Getopt
+ - Allow the config file to be a code ref which is called to return
+ the config file location (Gordon Irving)
0.22 Sat. Sept 05 2009
- Require GLD 0.077 for RT#49427 as some versions are broken
Modified: branches/upstream/libmoosex-getopt-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-getopt-perl/current/MANIFEST?rev=45236&op=diff
==============================================================================
--- branches/upstream/libmoosex-getopt-perl/current/MANIFEST (original)
+++ branches/upstream/libmoosex-getopt-perl/current/MANIFEST Fri Oct 2 17:11:48 2009
@@ -2,6 +2,7 @@
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: branches/upstream/libmoosex-getopt-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-getopt-perl/current/META.yml?rev=45236&op=diff
==============================================================================
--- branches/upstream/libmoosex-getopt-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-getopt-perl/current/META.yml Fri Oct 2 17:11:48 2009
@@ -27,4 +27,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: git://git.moose.perl.org/MooseX-Getopt.git
-version: 0.22
+version: 0.23
Added: branches/upstream/libmoosex-getopt-perl/current/inc/Module/Install/AutoManifest.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-getopt-perl/current/inc/Module/Install/AutoManifest.pm?rev=45236&op=file
==============================================================================
--- branches/upstream/libmoosex-getopt-perl/current/inc/Module/Install/AutoManifest.pm (added)
+++ branches/upstream/libmoosex-getopt-perl/current/inc/Module/Install/AutoManifest.pm Fri Oct 2 17:11:48 2009
@@ -1,0 +1,45 @@
+#line 1
+use strict;
+use warnings;
+
+package Module::Install::AutoManifest;
+
+use Module::Install::Base;
+
+BEGIN {
+ our $VERSION = '0.003';
+ our $ISCORE = 1;
+ our @ISA = qw(Module::Install::Base);
+}
+
+sub auto_manifest {
+ my ($self) = @_;
+
+ return unless $Module::Install::AUTHOR;
+
+ die "auto_manifest requested, but no MANIFEST.SKIP exists\n"
+ unless -e "MANIFEST.SKIP";
+
+ if (-e "MANIFEST") {
+ unlink('MANIFEST') or die "Can't remove MANIFEST: $!";
+ }
+
+ $self->postamble(<<"END");
+create_distdir: manifest_clean manifest
+
+distclean :: manifest_clean
+
+manifest_clean:
+\t\$(RM_F) MANIFEST
+END
+
+}
+
+1;
+__END__
+
+#line 48
+
+#line 131
+
+1; # End of Module::Install::AutoManifest
Modified: branches/upstream/libmoosex-getopt-perl/current/lib/MooseX/Getopt.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-getopt-perl/current/lib/MooseX/Getopt.pm?rev=45236&op=diff
==============================================================================
--- branches/upstream/libmoosex-getopt-perl/current/lib/MooseX/Getopt.pm (original)
+++ branches/upstream/libmoosex-getopt-perl/current/lib/MooseX/Getopt.pm Fri Oct 2 17:11:48 2009
@@ -11,7 +11,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.22';
+our $VERSION = '0.23';
our $AUTHORITY = 'cpan:STEVAN';
has ARGV => (is => 'rw', isa => 'ArrayRef', metaclass => "NoGetopt");
@@ -31,6 +31,11 @@
if(!defined $configfile) {
my $cfmeta = $class->meta->find_attribute_by_name('configfile');
$configfile = $cfmeta->default if $cfmeta->has_default;
+ if (ref $configfile eq 'CODE') {
+ # not sure theres a lot you can do with the class and may break some assumptions
+ # warn?
+ $configfile = &$configfile($class);
+ }
if (defined $configfile) {
$config_from_file = eval {
$class->get_config_from_file($configfile);
Modified: branches/upstream/libmoosex-getopt-perl/current/t/008_configfromfile.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-getopt-perl/current/t/008_configfromfile.t?rev=45236&op=diff
==============================================================================
--- branches/upstream/libmoosex-getopt-perl/current/t/008_configfromfile.t (original)
+++ branches/upstream/libmoosex-getopt-perl/current/t/008_configfromfile.t Fri Oct 2 17:11:48 2009
@@ -13,7 +13,7 @@
}
else
{
- plan tests => 25;
+ plan tests => 37;
}
{
@@ -76,6 +76,17 @@
);
}
+{
+ package App::DefaultConfigFileCodeRef;
+
+ use Moose;
+ extends 'App';
+
+ has '+configfile' => (
+ default => sub { return File::Spec->canonpath('/notused/default') },
+ );
+}
+
# No config specified
{
local @ARGV = qw( --required_from_argv 1 );
@@ -95,6 +106,23 @@
}
}
+# No config specified
+{
+ local @ARGV = qw( --required_from_argv 1 );
+
+ {
+ my $app = App::DefaultConfigFileCodeRef->new_with_options;
+ isa_ok( $app, 'App::DefaultConfigFileCodeRef' );
+ app_ok( $app );
+
+ ok( !$app->config_from_override,
+ '... config_from_override false as expected' );
+
+ is( $app->configfile, File::Spec->canonpath('/notused/default'),
+ '... configfile is /notused/default as expected' );
+ }
+}
+
# Config specified
{
local @ARGV = qw( --configfile /notused --required_from_argv 1 );
@@ -116,6 +144,17 @@
is( $app->configfile, File::Spec->canonpath('/notused'),
'... configfile is /notused as expected' );
}
+ {
+ my $app = App::DefaultConfigFileCodeRef->new_with_options;
+ isa_ok( $app, 'App::DefaultConfigFileCodeRef' );
+ app_ok( $app );
+
+ ok( $app->config_from_override,
+ '... config_from_override true as expected' );
+
+ is( $app->configfile, File::Spec->canonpath('/notused'),
+ '... configfile is /notused as expected' );
+ }
}
# Required arg not supplied from cmdline
More information about the Pkg-perl-cvs-commits
mailing list