From: Arthur Axel 'fREW' Schmidt Date: Tue, 31 Jul 2012 13:55:35 +0000 (-0500) Subject: Make Sub::Exporter an optional dep (which is kinda the whole point) X-Git-Tag: v0.001002~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0a1657e9562a20062806d75ff0de7dd7b570aa48;hp=e119bec04ad4614216bb129b1796646c0222adff;p=p5sagit%2FSub-Exporter-Progressive.git Make Sub::Exporter an optional dep (which is kinda the whole point) --- diff --git a/Changes b/Changes index 010442f..9fee3e6 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for {{$dist->name}} {{$NEXT}} + - Make Sub::Exporter an optional dep (which is kinda the whole point) 0.001001 2012-07-29 19:58:40 America/Chicago - Fix '-all' option for the default group diff --git a/dist.ini b/dist.ini index 3cb9e1d..18cd39e 100644 --- a/dist.ini +++ b/dist.ini @@ -22,7 +22,6 @@ repository.type = git [PodSyntaxTests] [Prereqs] -Sub::Exporter = 0 Exporter = 0 List::Util = 0 diff --git a/lib/Sub/Exporter/Progressive.pm b/lib/Sub/Exporter/Progressive.pm index d945936..0e8d042 100644 --- a/lib/Sub/Exporter/Progressive.pm +++ b/lib/Sub/Exporter/Progressive.pm @@ -34,7 +34,8 @@ WARNING my ($self, @args) = @_; if (first { ref || !m/^\w+$/ } @args) { - require Sub::Exporter; + die 'your usage of Sub::Exporter::Progressive requires Sub::Exporter to be installed' + unless eval { require Sub::Exporter }; $full_exporter ||= Sub::Exporter::build_exporter($export_data->{original}); diff --git a/t/sex.t b/t/sex.t index 7f5f0e1..8a63f89 100644 --- a/t/sex.t +++ b/t/sex.t @@ -3,6 +3,9 @@ use strict; use warnings; use Test::More; +plan skip_all => 'Sub::Exporter not installed' + unless eval { require Sub::Exporter }; + use List::Util 'first'; use lib 't/lib'; use A::Junk 'junk1' => { -as => 'junk' };