Created
January 8, 2016 22:13
-
-
Save ugexe/afcbbf0c76220c150546 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless $dist.depends.first(/'panda' | 'Panda::'/) | |
|| $dist.build-depends.first(/'panda' | 'Panda::'/) | |
|| $dist.test-depends.first(/'panda' | 'Panda::'/) { | |
my $legacy-fixer-code = q:to/END_LEGACY_FIX/; | |
class Build { | |
method isa($what) { | |
return True if $what.^name eq 'Panda::Builder'; | |
callsame; | |
} | |
END_LEGACY_FIX | |
my $legacy-code = $builder-path.IO.slurp; | |
$legacy-code.subst-mutate(/'use Panda::' \w+ ';'/, '', :g); | |
$legacy-code.subst-mutate('class Build is Panda::Builder {', "{$legacy-fixer-code}\n"); | |
$builder-path = "{$builder-path.absolute}.zef".IO; | |
try { $builder-path.spurt($legacy-code) } || $builder-path.subst-mutate(/'.zef'$/, ''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment