Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

don't require Mouse if we have Moose #1

Merged
merged 2 commits into from

2 participants

@rjbs

This should be a pretty straightforward change.

We now use Ævar's MakeMaker::Awesome to get a reliable way to muck with the Makefile.PL contents. Then we add a "add Mouse 0.40 only if Moose not loadable."

No hassle for anyone but me, I think! :)

@sartak sartak merged commit 8daf324 into sartak:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 15, 2011
  1. @rjbs
  2. @rjbs
This page is out of date. Refresh to see the latest.
Showing with 34 additions and 1 deletion.
  1. +4 −1 dist.ini
  2. +30 −0 inc/MakeMaker.pm
View
5 dist.ini
@@ -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
30 inc/MakeMaker.pm
@@ -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;
Something went wrong with that request. Please try again.