Skip to content
This repository
tag: 0.9915
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 33 lines (27 sloc) 0.933 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
name 'bundle';
description 'Support scanning dependencies from Bundle:: modules';
author 'Tatsuhiko Miyagawa';

api_version 0.1;

hook find_deps => sub {
    my $args = shift;

    if ($args->{module} =~ m!^Bundle::!) {
        my @module = split /::/, $args->{module};
        my $base = $module[-1] . ".pm";
        my $lib = join("/", "lib", @module) . ".pm";

        for my $file (grep -e, ($base, $lib)) {
            $self->chat("Scanning $file for bundle dependencies...");
            open my $pod, "<$file" or next;
            my $in_contents;
            while (<$pod>) {
                if (/^=head\d\s+CONTENTS/) {
                    $in_contents = 1;
                } elsif (/^=/) {
                    $in_contents = 0;
                } elsif ($in_contents) {
                    /^([\w:]+)\s/
                        and $args->{deps}->{$1} ||= 0;
                }
            }
        }
    }
};

Something went wrong with that request. Please try again.