From: Shawn M Moore Date: Sun, 28 Sep 2008 17:29:16 +0000 (+0000) Subject: Notify us of what versions of everything we have from Mouse::Util (and if it even... X-Git-Tag: 0.19~186 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=00136d64cc7c83ea95e623e045d0aa2963e7eb2a;p=gitmo%2FMouse.git Notify us of what versions of everything we have from Mouse::Util (and if it even loaded) --- diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index f437a6c..388a5a6 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -179,6 +179,8 @@ our %dependencies = ( }, ); +our %loaded; + our @EXPORT_OK = map { keys %$_ } values %dependencies; our %EXPORT_TAGS = ( all => \@EXPORT_OK, @@ -191,6 +193,8 @@ for my $module_name (keys %dependencies) { eval "require $module_name; 1"; }; + $loaded{$module_name} = $loaded; + for my $method_name (keys %{ $dependencies{ $module_name } }) { my $producer = $dependencies{$module_name}{$method_name}; my $implementation; diff --git a/t/000-load.t b/t/000-load.t index a075550..a78968a 100644 --- a/t/000-load.t +++ b/t/000-load.t @@ -5,3 +5,17 @@ use Test::More tests => 1; use_ok 'Mouse'; +diag "Soft dependency versions:"; +for my $module_name (keys %Mouse::Util::loaded) { + my $version; + if ($Mouse::Util::loaded{$module_name}) { + no strict 'refs'; + $version = ${$module_name . '::VERSION'}; + } + else { + $version = "(provided by Mouse::Util)"; + } + + diag " $module_name: $version"; +} +