From: Arthur Axel 'fREW' Schmidt Date: Mon, 30 Jul 2012 00:58:27 +0000 (-0500) Subject: Fix '-all' option for the default group X-Git-Tag: v0.001001~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FSub-Exporter-Progressive.git;a=commitdiff_plain;h=d446192d0f931cd3d38c90144e9aa7341ab951f0 Fix '-all' option for the default group --- diff --git a/Changes b/Changes index 4dab640..47b76e0 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for {{$dist->name}} {{$NEXT}} + - Fix '-all' option for the default group 0.001000 2012-07-29 16:44:01 America/Chicago - Initial Release diff --git a/lib/Sub/Exporter/Progressive.pm b/lib/Sub/Exporter/Progressive.pm index 325d103..d945936 100644 --- a/lib/Sub/Exporter/Progressive.pm +++ b/lib/Sub/Exporter/Progressive.pm @@ -76,12 +76,12 @@ sub sub_export_options { if first { $_ ne 'default' } keys %{$options{groups}}; @defaults = @{$options{groups}{default} || [] }; - @defaults = @exports if $defaults[0] eq '-all'; } else { $TOO_COMPLICATED = 1; last OPTIONS } } + @defaults = @exports if $defaults[0] eq '-all'; } return $TOO_COMPLICATED, { diff --git a/t/all.t b/t/all.t new file mode 100644 index 0000000..9751d0e --- /dev/null +++ b/t/all.t @@ -0,0 +1,14 @@ + +use strict; +use warnings; + +use Test::More; +use List::Util 'first'; +use lib 't/lib'; +use A::JunkAll; + +ok(main->can('junk1'), 'sub exported'); +ok(main->can('junk2'), 'sub exported'); +ok(! $INC{'Sub/Exporter.pm'}, 'Sub::Exporter not loaded'); + +done_testing; diff --git a/t/lib/A/JunkAll.pm b/t/lib/A/JunkAll.pm new file mode 100644 index 0000000..d3e6123 --- /dev/null +++ b/t/lib/A/JunkAll.pm @@ -0,0 +1,13 @@ +package A::JunkAll; + +use Sub::Exporter::Progressive -setup => { + exports => [qw(junk1 junk2)], + groups => { + default => [ -all ], + }, +}; + +sub junk1 { 1 } +sub junk2 { 1 } + +1;