Skip to content

Commit

Permalink
Optimize Dist::Zilla::Util startup
Browse files Browse the repository at this point in the history
Load Pod::Eventual at runtime only if abstract_from_file is used.
This improves 'dzil authordeps' speed.
  • Loading branch information
dolmen committed Oct 31, 2011
1 parent 8e10b0b commit 33f59d7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/Dist/Zilla/Util.pm
Expand Up @@ -10,9 +10,16 @@ use String::RewritePrefix 0.002; # better string context behavior
{
package
Dist::Zilla::Util::PEA;
use Pod::Eventual 0.091480; # better nonpod/blank events
use base 'Pod::Eventual';
sub _new { bless {} => shift; }
@Dist::Zilla::Util::PEA::ISA = ('Pod::Eventual');
sub _new {
# Load Pod::Eventual only when used (and not yet loaded)
unless (exists $INC{'Pod/Eventual.pm'}) {
require Pod::Eventual;
Pod::Eventual->VERSION(0.091480); # better nonpod/blank events
}

bless {} => shift;
}
sub handle_nonpod {
my ($self, $event) = @_;
return if $self->{abstract};
Expand Down

0 comments on commit 33f59d7

Please sign in to comment.