r45239 - in /trunk/libmoosex-getopt-perl: ChangeLog MANIFEST META.yml debian/changelog 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:14:52 UTC 2009
Author: jawnsy-guest
Date: Fri Oct 2 17:14:47 2009
New Revision: 45239
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=45239
Log:
Integrate new upstream version, still waiting for ConfigFromFile for testing
Added:
trunk/libmoosex-getopt-perl/inc/Module/Install/AutoManifest.pm
- copied unchanged from r45237, branches/upstream/libmoosex-getopt-perl/current/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/debian/changelog
trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm
trunk/libmoosex-getopt-perl/t/008_configfromfile.t
Modified: trunk/libmoosex-getopt-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/ChangeLog?rev=45239&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/ChangeLog (original)
+++ trunk/libmoosex-getopt-perl/ChangeLog Fri Oct 2 17:14:47 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: trunk/libmoosex-getopt-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/MANIFEST?rev=45239&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/MANIFEST (original)
+++ trunk/libmoosex-getopt-perl/MANIFEST Fri Oct 2 17:14:47 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: trunk/libmoosex-getopt-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/META.yml?rev=45239&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/META.yml (original)
+++ trunk/libmoosex-getopt-perl/META.yml Fri Oct 2 17:14:47 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
Modified: trunk/libmoosex-getopt-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/debian/changelog?rev=45239&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/debian/changelog (original)
+++ trunk/libmoosex-getopt-perl/debian/changelog Fri Oct 2 17:14:47 2009
@@ -1,15 +1,9 @@
-libmoosex-getopt-perl (0.22-1) UNRELEASED; urgency=low
+libmoosex-getopt-perl (0.23-1) UNRELEASED; urgency=low
[ Jonathan Yu ]
WAITS FOR libmoosex-configfromfile-perl
* New upstream release
- + Enable the argv parameter to the constructor
- + Add support for singular overrides via mock_sub (RT#43200)
- + Add support for --usage and --help (RT#43255)
- + Don't die if SimpleConfig can't find default config (RT#47766)
- + Split into MooseX::Getopt::Basic (removing the G::L::Descriptive
- support) and MooseX::Getopt::GLD
* No longer set RELEASE_TESTING; justification is that it is only
an author test, not even run on the smoker servers
* Use override for testing
@@ -20,7 +14,7 @@
* Update jawnsy's email address
* Update ryan52's email address
- -- Ryan Niebur <ryan at debian.org> Fri, 25 Sep 2009 00:25:35 -0700
+ -- Jonathan Yu <jawnsy at cpan.org> Fri, 02 Oct 2009 09:29:16 -0400
libmoosex-getopt-perl (0.20-2) unstable; urgency=low
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=45239&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm (original)
+++ trunk/libmoosex-getopt-perl/lib/MooseX/Getopt.pm Fri Oct 2 17:14:47 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: trunk/libmoosex-getopt-perl/t/008_configfromfile.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoosex-getopt-perl/t/008_configfromfile.t?rev=45239&op=diff
==============================================================================
--- trunk/libmoosex-getopt-perl/t/008_configfromfile.t (original)
+++ trunk/libmoosex-getopt-perl/t/008_configfromfile.t Fri Oct 2 17:14:47 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