NAME
Perl::PrereqScanner::Scanner::Hint - Plugin for Perl::PrereqScanner
looking for ## REQUIRE:
comments
VERSION
Version v0.1.1, released on 2016-12-28 20:18 UTC.
WHAT?
Perl::PrereqScanner::Scanner::Hint
(or just Scanner::Hint
for brevity) is a plugin for Perl::PrereqScanner
tool. Scanner::Hint
looks for # REQUIRE: ModuleName VersionRange
comments in the code.
This is Perl::PrereqScanner::Scanner::Hint
module documentation. Read this if you are going to hack or extend Manifest::Write
.
If you want to specify implicit prerequisites directly in Perl code, read the user manual. General topics like getting source, building, installing, bug reporting and some others are covered in the README.
SYNOPSIS
use Perl::PrereqScanner;
my $scanner = Perl::PrereqScanner->new( {
extra_scanners => [ qw{ Hint } ],
} );
my $prereqs = $scanner->scan_file( $path );
DESCRIPTION
This is a trivial scanner which utilizes power of Perl::PrereqScanner
and PPI
.
OBJECT METHODS
scan_for_prereqs
my $doc = PPI::Document->new( ... );
my $req = CPAN::Meta::Requirements->new;
$self->scan_for_prereqs( $doc, $req );
The method scans document $doc
, which is expected to be an objects of PPI::Document
class. The methods looks for comments starting with # REQUIRE:
, and adds found requirements to $req
, by calling $req->add_string+requirement
. $req
is expected to be an object of CPAN::Meta::Requirements
class.
SEE ALSO
AUTHOR
Van de Bugger <van.de.bugger@gmail.com>
COPYRIGHT AND LICENSE
Copyright (C) 2015, 2016 Van de Bugger
License GPLv3+: The GNU General Public License version 3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.