From: gfx Date: Tue, 22 Sep 2009 02:25:00 +0000 (+0900) Subject: Add Mouse->moose_version for compatible Moose version, and fix Makefile.PL X-Git-Tag: 0.32~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bf9f3f91626578b969718595345b809278852891;p=gitmo%2FMouse.git Add Mouse->moose_version for compatible Moose version, and fix Makefile.PL --- diff --git a/Makefile.PL b/Makefile.PL index 2449420..4fb0040 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -12,11 +12,15 @@ tests 't/*.t t/*/*.t'; # > Fixed looks_like_number(undef) to return false for perl >= 5.009002 requires 'Scalar::Util' => 1.14; -build_requires 'Test::Exception' => 0.21; -build_requires 'Test::More' => 0.80; +test_requires 'Test::Exception' => 0.21; +test_requires 'Test::More' => 0.80; if ($Module::Install::AUTHOR) { - if (eval "package foo; use Moose; 1;") { + local @INC = ('lib', @INC); + require 'lib/Mouse.pm'; # for moose_version() + my $require_version = Mouse->moose_version; + + if (eval{ require Moose; Moose->VERSION($require_version) }) { if (eval 'use Module::Install::AuthorTests; 1') { create_moose_compatibility_test(); recursive_author_tests('xt'); @@ -24,7 +28,7 @@ if ($Module::Install::AUTHOR) { print "you don't have a M::I::AuthorTests.\n"; } } else { - print "you don't have a moose. skipping moose compatibility test\n"; + print "you don't have Moose $require_version. skipping moose compatibility test\n"; } system("author/generate-mouse-tiny.pl"); } diff --git a/lib/Mouse.pm b/lib/Mouse.pm index 771d32e..1c76f7c 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -6,6 +6,8 @@ use base 'Exporter'; our $VERSION = '0.31'; +sub moose_version(){ 0.90 } # which Mouse is a subset of + use Carp 'confess'; use Scalar::Util 'blessed'; use Mouse::Util qw(load_class is_class_loaded);