{"id":16304841,"url":"https://github.com/moznion/perl-prereqscanner-lite","last_synced_at":"2025-03-22T19:35:03.492Z","repository":{"id":15168925,"uuid":"17896677","full_name":"moznion/Perl-PrereqScanner-Lite","owner":"moznion","description":"Lightweight Prereqs Scanner for Perl","archived":false,"fork":false,"pushed_at":"2017-11-17T07:02:52.000Z","size":95,"stargazers_count":11,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T14:15:13.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://metacpan.org/release/Perl-PrereqScanner-Lite","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moznion.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-19T08:20:00.000Z","updated_at":"2021-03-08T18:10:41.000Z","dependencies_parsed_at":"2022-08-25T08:20:27.959Z","dependency_job_id":null,"html_url":"https://github.com/moznion/Perl-PrereqScanner-Lite","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2FPerl-PrereqScanner-Lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2FPerl-PrereqScanner-Lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2FPerl-PrereqScanner-Lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2FPerl-PrereqScanner-Lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/Perl-PrereqScanner-Lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245013747,"owners_count":20547175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T21:04:57.351Z","updated_at":"2025-03-22T19:35:03.127Z","avatar_url":"https://github.com/moznion.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/moznion/Perl-PrereqScanner-Lite.svg?branch=master)](https://travis-ci.org/moznion/Perl-PrereqScanner-Lite) [![Coverage Status](https://img.shields.io/coveralls/moznion/Perl-PrereqScanner-Lite/master.svg?style=flat)](https://coveralls.io/r/moznion/Perl-PrereqScanner-Lite?branch=master)\n# NAME\n\nPerl::PrereqScanner::Lite - Lightweight Prereqs Scanner for Perl\n\n# SYNOPSIS\n\n    use Perl::PrereqScanner::Lite;\n\n    my $scanner = Perl::PrereqScanner::Lite-\u003enew;\n    $scanner-\u003eadd_extra_scanner('Moose'); # add extra scanner for moose style\n    my $modules = $scanner-\u003escan_file('path/to/file');\n\n# DESCRIPTION\n\nPerl::PrereqScanner::Lite is the lightweight prereqs scanner for perl.\nThis scanner uses [Compiler::Lexer](https://metacpan.org/pod/Compiler::Lexer) as tokenizer, therefore processing speed is really fast.\n\n# METHODS\n\n## new($opt)\n\nCreate a scanner instance.\n\n`$opt` must be hash reference. It accepts following keys of hash:\n\n- extra\\_scanners\n\n    It specifies extra scanners. This item must be array reference.\n\n    e.g.\n\n        my $scanner = Perl::PrereqScanner::Lite-\u003enew(\n            extra_scanners =\u003e [qw/Moose Version/]\n        );\n\n    See also [\"add\\_extra\\_scanner($scanner\\_name)\"](#add_extra_scanner-scanner_name).\n\n- no\\_prereq\n\n    It specifies to use `## no prereq` or not. Please see also [\"ADDITIONAL NOTATION\"](#additional-notation).\n\n## scan\\_file($file\\_path)\n\nScan and figure out prereqs which is instance of `CPAN::Meta::Requirements` by file path.\n\n## scan\\_string($string)\n\nScan and figure out prereqs which is instance of `CPAN::Meta::Requirements` by source code string written in perl.\n\ne.g.\n\n    open my $fh, '\u003c', __FILE__;\n    my $string = do { local $/; \u003c$fh\u003e };\n    my $modules = $scanner-\u003escan_string($string);\n\n## scan\\_module($module\\_name)\n\nScan and figure out prereqs which is instance of `CPAN::Meta::Requirements` by module name.\n\ne.g.\n\n    my $modules = $scanner-\u003escan_module('Perl::PrereqScanner::Lite');\n\n## scan\\_tokens($tokens)\n\nScan and figure out prereqs which is instance of `CPAN::Meta::Requirements` by tokens of [Compiler::Lexer](https://metacpan.org/pod/Compiler::Lexer).\n\ne.g.\n\n    open my $fh, '\u003c', __FILE__;\n    my $string = do { local $/; \u003c$fh\u003e };\n    my $tokens = Compiler::Lexer-\u003enew-\u003etokenize($string);\n    my $modules = $scanner-\u003escan_tokens($tokens);\n\n## add\\_extra\\_scanner($scanner\\_name)\n\nAdd extra scanner to scan and figure out prereqs. This module loads extra scanner such as `Perl::PrereqScanner::Lite::Scanner::$scanner_name` if specifying scanner name through this method.\n\nIf you want to specify an extra scanner from external package without `Perl::PrereqScanner::Lite::` prefix, you can prepend `+` to `$scanner_name`. Like so `+Your::Awesome::Scanner`.\n\nExtra scanners that are default supported are followings;\n\n- [Perl::PrereqScanner::Lite::Scanner::Moose](https://metacpan.org/pod/Perl::PrereqScanner::Lite::Scanner::Moose)\n- [Perl::PrereqScanner::Lite::Scanner::Version](https://metacpan.org/pod/Perl::PrereqScanner::Lite::Scanner::Version)\n\n# ADDITIONAL NOTATION\n\nIf `no_prereq` is enabled by `new()` (like so: `Perl::PrereqScanner::Lite-\u003enew({no_prereq =\u003e 1})`),\nthis module recognize `## no prereq` optional comment. The requiring declaration with this comment on the same line will be ignored as prereq.\n\nFor example\n\n    use Foo;\n    use Bar; ## no prereq\n\nIn this case `Foo` is the prereq, however `Bar` is ignored.\n\n# SPEED COMPARISON\n\n## Plain\n\n                                Rate   Perl::PrereqScanner Perl::PrereqScanner::Lite\n    Perl::PrereqScanner       8.57/s                    --                      -97%\n    Perl::PrereqScanner::Lite  246/s                 2770%                        --\n\n## With Moose scanner\n\n                                Rate   Perl::PrereqScanner Perl::PrereqScanner::Lite\n    Perl::PrereqScanner       9.00/s                    --                      -94%\n    Perl::PrereqScanner::Lite  152/s                 1587%                        --\n\n# NOTES\n\nThis is a quotation from [https://github.com/moznion/Perl-PrereqScanner-Lite/issues/13](https://github.com/moznion/Perl-PrereqScanner-Lite/issues/13).\n\nYes, it's true. This design is so ugly and not smart.\nSo I have to redesign and reimplement this module, and I have some plans.\n\nIf you have a mind to expand this module by implementing external scanner,\nplease be careful.\nEvery `scan_*` calls must not affect to any others through the\nsingleton of this module (called it `$c` in [https://github.com/moznion/Perl-PrereqScanner-Lite/blob/c03638b2e2a39d92f4d7df360af5a6be65dc417a/lib/Perl/PrereqScanner/Lite/Scanner/Moose.pm#L8](https://github.com/moznion/Perl-PrereqScanner-Lite/blob/c03638b2e2a39d92f4d7df360af5a6be65dc417a/lib/Perl/PrereqScanner/Lite/Scanner/Moose.pm#L8)).\n\n# SEE ALSO\n\n[Perl::PrereqScanner](https://metacpan.org/pod/Perl::PrereqScanner), [Compiler::Lexer](https://metacpan.org/pod/Compiler::Lexer)\n\n# LICENSE\n\nCopyright (C) moznion.\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\n# AUTHOR\n\nmoznion \u003cmoznion@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fperl-prereqscanner-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Fperl-prereqscanner-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fperl-prereqscanner-lite/lists"}