++ed by:
SIMBABQUE

1 PAUSE user

Petr Šabata
and 1 contributors

NAME

Tangerine - Examine perl files and report dependency metadata

SYNOPSIS

    use Tangerine;
    use version 0.77;

    my $scanner = Tangerine->new(file => $file, mode => 'all');
    $scanner->run;

    print "$file contains the following modules: ".
        join q/, /, sort keys %{$scanner->package}."\n";

    print "$file requires Exporter, at runtime, on the following lines: ".
        join q/, /, sort map $_->line, @{$scanner->runtime->{Exporter}}."\n";

    my $v = 0;
    for (@{$scanner->compile->{'Test::More'}}) {
        $v = $_->version if $_->version && qv($v) < qv($_->version)
    }
    print "The minimum version of Test::More required by $file is $v.\n";

DESCRIPTION

Tangerine examines perl files and reports dependency metadata -- provided modules, and both compile-time and run-time dependencies, along with line numbers, versions and possibly other related information.

Currently, PPI is used for the initial parsing and statement extraction.

CONSTRUCTOR

new

Creates the Tangerine object. Takes the following two named arguments:

    'file', the file to examine
    'mode', determines what to look for; may be one of 'all',
        'package', 'compile', or 'runtime'.

Both arguments are optional, however, 'file' needs to be set before running the scanner, e.g.

    my $scanner = Tangerine->new;
    $scanner->file($file);
    $scanner->run;

METHODS

run

Runs the analysis.

package

Returns a hash reference. Keys are the modules provided, values references to lists of Tangerine::Occurence objects.

compile

Returns a hash reference. Keys are the modules required at compile-time, values references to lists of Tangerine::Occurence objects.

runtime

Returns a hash reference. Keys are the modules required at run-time, values references to lists of Tangerine::Occurence objects.

provides
requires
uses

Deprecated. These are provided for backwards compatibility only.

SEE ALSO

Tangerine::Occurence

REPOSITORY

https://github.com/contyk/tangerine.pm

AUTHOR

Petr Šabata <contyk@redhat.com>

COPYRIGHT AND LICENSE

Copyright (c) 2014-2016 Petr Šabata

See LICENSE for licensing details.