work with MooseX::Getopt 0.48 by using the new public method for printing usage
Karen Etheridge [Sat, 5 Jan 2013 11:42:27 +0000 (03:42 -0800)]
This reverts commit f831720babc4818823ec8628dcc1bd032ed8220c, which reverted commit cd61f3ab24b7dcc59068c35d62ddb4bb9b9162c8, but with version dependency added and pod coverage fixed.

Makefile.PL
lib/Catalyst/Script/Create.pm
lib/Catalyst/ScriptRole.pm
t/aggregate/unit_core_script_create.t
t/aggregate/unit_core_script_help.t

index 58f73ea..8e6c2c9 100644 (file)
@@ -63,7 +63,7 @@ requires 'URI' => '1.35';
 requires 'Task::Weaken';
 requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
 requires 'MRO::Compat';
-requires 'MooseX::Getopt' => '0.30';
+requires 'MooseX::Getopt' => '0.48';
 requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace
 requires 'Plack' => '0.9991'; # IIS6+7 fix middleware
 requires 'Plack::Middleware::ReverseProxy' => '0.04';
index 1308acd..593323d 100644 (file)
@@ -39,13 +39,13 @@ sub _build_helper_class { 'Catalyst::Helper' }
 sub run {
     my ($self) = @_;
 
-    $self->_getopt_full_usage if !$self->ARGV->[0];
+    $self->print_usage_text if !$self->ARGV->[0];
 
     my $helper_class = $self->helper_class;
     Class::MOP::load_class($helper_class);
     my $helper = $helper_class->new( { '.newfiles' => !$self->force, mech => $self->mechanize } );
 
-    $self->_getopt_full_usage unless $helper->mk_component( $self->application_name, @{$self->extra_argv} );
+    $self->print_usage_text unless $helper->mk_component( $self->application_name, @{$self->extra_argv} );
 
 }
 
index b1ddc27..2b46097 100644 (file)
@@ -14,10 +14,11 @@ coerce 'Catalyst::ScriptRole::LoadableClass',
   via { ensure_class_loaded($_); 1 };
 
 with 'MooseX::Getopt' => {
+    -version => 0.48,
     -excludes => [qw/
         _getopt_spec_warnings
         _getopt_spec_exception
-        _getopt_full_usage
+        print_usage_text
     /],
 };
 
@@ -56,7 +57,10 @@ sub _getopt_spec_warnings {
     warn @_;
 }
 
-sub _getopt_full_usage {
+=for Pod::Coverage
+    print_usage_text
+=cut
+sub print_usage_text {
     my $self = shift;
     pod2usage();
     exit 0;
index 68e2458..d492fd9 100644 (file)
@@ -12,7 +12,7 @@ use lib "$Bin/../lib";
     use Moose;
     extends 'Catalyst::Script::Create';
     our $help;
-    sub _getopt_full_usage { $help++ }
+    sub print_usage_text { $help++ }
 }
 
 {
index d3a6fab..00d24da 100644 (file)
@@ -12,7 +12,7 @@ use lib "$Bin/../lib";
     use Moose;
     with 'Catalyst::ScriptRole';
     our $help;
-    sub _getopt_full_usage { $help++ }
+    sub print_usage_text { $help++ }
 }
 
 test('--help');