Permalink
Browse files

Merge pull request #1 from rjbs/no-mouse

don't require Mouse if we have Moose
  • Loading branch information...
sartak committed Sep 15, 2011
2 parents d3e3de7 + 810f08f commit 8daf3242fa89ff8f73862193ab0ceaea74532079
Showing with 34 additions and 1 deletion.
  1. +4 −1 dist.ini
  2. +30 −0 inc/MakeMaker.pm
View
@@ -11,9 +11,12 @@ copyright_holder = Best Practical Solutions
[@Filter]
bundle = @Classic
remove = PodVersion
+remove = MakeMaker
+
+[=inc::MakeMaker]
+; authordep Dist::Zilla::Plugin::MakeMaker::Awesome
[PodWeaver]
[Prereqs]
-Mouse = 0.40
perl = 5.006_002
View
@@ -0,0 +1,30 @@
+package inc::MakeMaker;
+use Moose;
+extends 'Dist::Zilla::Plugin::MakeMaker::Awesome';
+
+use namespace::autoclean;
+
+override _build_WriteMakefile_dump => sub {
+ my ($self) = @_;
+
+ my $str = super;
+
+ $str .= ";\n\n";
+
+ $str .= <<'END_NONSENSE';
+$WriteMakefileArgs{PREREQ_PM} ||= {};
+
+if (eval { require Moose }) {
+ # we have any version of Moose; good enough! -- rjbs, 2011-09-15
+} else {
+ # No Moose? Well, we need *something* to test with, so we'll ask for the
+ # lighter-weight one, Mouse. -- rjbs, 2011-09-15
+ $WriteMakefileArgs{PREREQ_PM}{Mouse} = '0.40';
+}
+
+END_NONSENSE
+
+ return $str;
+};
+
+1;

0 comments on commit 8daf324

Please sign in to comment.