Module-Extract-Use-1.051/000755 000765 000024 00000000000 14166623171 015354 5ustar00brianstaff000000 000000 Module-Extract-Use-1.051/LICENSE000644 000765 000024 00000017354 14166623167 016400 0ustar00brianstaff000000 000000 The Module::Extract::Use module is licensed under under
the Artistic License 2.0.
Artistic License 2.0
Copyright (c) 2000-2006, The Perl Foundation.
http://www.perlfoundation.org/artistic_license_2_0
Preamble
This license establishes the terms under which a given free software
Package may be copied, modified, distributed, and/or redistributed.
The intent is that the Copyright Holder maintains some artistic
control over the development of that Package while still keeping the
Package available as open source and free software.
You are always permitted to make arrangements wholly outside of this
license directly with the Copyright Holder of a given Package. If the
terms of this license do not permit the full use that you propose to
make of the Package, you should contact the Copyright Holder and seek
a different licensing arrangement.
Definitions
"Copyright Holder" means the individual(s) or organization(s) named in
the copyright notice for the entire Package.
"Contributor" means any party that has contributed code or other
material to the Package, in accordance with the Copyright Holder's
procedures.
"You" and "your" means any person who would like to copy, distribute,
or modify the Package.
"Package" means the collection of files distributed by the Copyright
Holder, and derivatives of that collection and/or of those files. A
given Package may consist of either the Standard Version, or a
Modified Version.
"Distribute" means providing a copy of the Package or making it
accessible to anyone else, or in the case of a company or
organization, to others outside of your company or organization.
"Distributor Fee" means any fee that you charge for Distributing this
Package or providing support for this Package to another party. It
does not mean licensing fees.
"Standard Version" refers to the Package if it has not been modified,
or has been modified only in ways explicitly requested by the
Copyright Holder.
"Modified Version" means the Package, if it has been changed, and such
changes were not explicitly requested by the Copyright Holder.
"Original License" means this Artistic License as Distributed with the
Standard Version of the Package, in its current version or as it may
be modified by The Perl Foundation in the future.
"Source" form means the source code, documentation source, and
configuration files for the Package.
"Compiled" form means the compiled bytecode, object code, binary, or
any other form resulting from mechanical transformation or translation
of the Source form.
Permission for Use and Modification Without Distribution
(1) You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that
you do not Distribute the Modified Version.
Permissions for Redistribution of the Standard Version
(2) You may Distribute verbatim copies of the Source form of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distributor Fee, provided that you duplicate
all of the original copyright notices and associated disclaimers. At
your discretion, such verbatim copies may or may not include a
Compiled form of the Package.
(3) You may apply any bug fixes, portability changes, and other
modifications made available from the Copyright Holder. The resulting
Package will still be considered the Standard Version, and as such
will be subject to the Original License.
Distribution of Modified Versions of the Package as Source
(4) You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs
from the Standard Version, including, but not limited to, documenting
any non-standard features, executables, or modules, and provided that
you do at least ONE of the following:
(a) make the Modified Version available to the Copyright Holder of the
Standard Version, under the Original License, so that the Copyright
Holder may include your modifications in the Standard Version.
(b) ensure that installation of your Modified Version does not prevent
the user installing or running the Standard Version. In addition, the
Modified Version must bear a name that is different from the name of
the Standard Version.
(c) allow anyone who receives a copy of the Modified Version to make
the Source form of the Modified Version available to others under
(i) the Original License or
(ii) a license that permits the licensee to freely copy, modify and
redistribute the Modified Version using the same licensing terms that
apply to the copy that the licensee received, and requires that the
Source form of the Modified Version, and of any works derived from it,
be made freely available in that license fees are prohibited but
Distributor Fees are allowed.
Distribution of Compiled Forms of the Standard Version or Modified
Versions without the Source
(5) You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
get the Source of the Standard Version. Such instructions must be
valid at the time of your distribution. If these instructions, at any
time while you are carrying out such distribution, become invalid, you
must provide new instructions on demand or cease further distribution.
If you provide valid instructions or cease distribution within thirty
days after you become aware that the instructions are invalid, then
you do not forfeit any of your rights under this license.
(6) You may Distribute a Modified Version in Compiled form without the
Source, provided that you comply with Section 4 with respect to the
Source of the Modified Version.
Aggregating or Linking the Package
(7) You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
Package. Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
apply to the use and Distribution of the Standard or Modified Versions
as included in the aggregation.
(8) You are permitted to link Modified and Standard Versions with
other works, to embed the Package in a larger work of your own, or to
build stand-alone binary or bytecode versions of applications that
include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.
Items That are Not Considered Part of a Modified Version
(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
the Package to be a Modified Version. In addition, such works are not
considered parts of the Package itself, and are not subject to the
terms of this license.
General Provisions
(10) Any use, modification, and distribution of the Standard or
Modified Versions is governed by this Artistic License. By using,
modifying or distributing the Package, you accept this license. Do not
use, modify, or distribute the Package, if you do not accept this
license.
(11) If your Modified Version has been derived from a Modified Version
made by someone other than you, you are nevertheless required to
ensure that your Modified Version complies with the requirements of
this license.
(12) This license does not grant you the right to use any trademark,
service mark, tradename, or logo of the Copyright Holder.
(13) This license includes the non-exclusive, worldwide,
free-of-charge patent license to make, have made, use, offer to sell,
sell, import and otherwise transfer the Package with respect to any
patent claims licensable by the Copyright Holder that are necessarily
infringed by the Package. If you institute patent litigation
Module-Extract-Use-1.051/Changes000644 000765 000024 00000004317 14166623167 016661 0ustar00brianstaff000000 000000 Revision history for Perl module Module::Extract::Use
1.051 2022-01-09T18:16:19Z
* Fix up t/rt/79273.t regression, GitHub #7
1.049 2022-01-08T21:24:03Z
* No code changes. Fix a link in the README.pod.
1.047 2020-04-26T13:06:59Z
* extract_modules now has a -e switch to exclude core modules
1.046 2020-04-26T12:46:56Z
* Small pod fix
1.045 2019-12-19T12:19:24Z
* Fix test for extracting modules from parent and base
1.044 2019-12-18T02:38:56Z
* Bump this to a user release.
1.043_02 2019-12-17T12:55:00Z
* Small fixes
1.043_01 2019-12-17T12:29:57Z
* handle a couple of new cases:
- include the modules specified by parent or base
- find the require's in expressions, like `my $r = require Foo`
1.043 2017-02-03T03:24:02Z
* Clarified license (GitHub issue #3 https://github.com/briandfoy/module-extract-use/issues/3)
1.042 2017-02-01T02:46:27Z
* The -l and -j options work on the list of namespaces from all
files together instead of the list per file. Otherwise strict
and warnings always show up multiple times!
1.041 2017-02-01T01:58:04Z
* Add JSON and simple list outputs for examples/extract_modules
1.04 - 2014-01-04
* Get rid of MYMETA
* Update test data structures for latest behavior
1.03 - 2012-08-02
* Note the "pragma" field in the module details (RT 78728)
1.02 - 2011-11-01
* Adjusted no_index. No code changes.
1.01 - 2011-03-30
* Promote to a stable version
* Some files moved around, and I updated the copyright statements
for downstream ease.
0.18 - 2011-03-21
Implemented get_modules_with_details to extract the
version and import lists for a use().
0.16 - 2009-06-10
* Small distro cleanups and new META_MERGE hotness. No need
to upgrade.
0.15 - 2009-05-31
* Debian wants the man pages, so I guess I'll make them
after all
0.14 - 2009-05-20
* Adjust PPI bits to look for 'require' bits too
* Add extract_modules example from Jonathan Yu
0.13 - 2008-10-29
* Only return unique elements, so remove the duplicates
from the return list
0.12 - 2008-10-29
* No more carping. Check the value of $object->error after a call
to see if anything bad happened.
0.11 - 2008-10-28
* Bump to a release version
0.10_01 - 2008-08-15
* First release of a module to pull out the package names
Module-Extract-Use-1.051/corpus/000755 000765 000024 00000000000 14166623170 016666 5ustar00brianstaff000000 000000 Module-Extract-Use-1.051/MANIFEST000644 000765 000024 00000001037 14166623171 016506 0ustar00brianstaff000000 000000 Changes
corpus/PackageImports.pm
corpus/PackageVersion.pm
corpus/Repeated.pm
corpus/RT79273.pm
corpus/state_require.pm
examples/extract_modules
INSTALL.SKIP
lib/Module/Extract/Use.pm
LICENSE
Makefile.PL
MANIFEST This list of files
MANIFEST.SKIP
README.pod
t/get_modules.t
t/imports.t
t/load.t
t/pod.t
t/pod_coverage.t
t/rt/79273.t
t/test_manifest
t/versions.t
xt/changes.t
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
Module-Extract-Use-1.051/t/000755 000765 000024 00000000000 14166623170 015616 5ustar00brianstaff000000 000000 Module-Extract-Use-1.051/xt/000755 000765 000024 00000000000 14166623170 016006 5ustar00brianstaff000000 000000 Module-Extract-Use-1.051/README.pod000644 000765 000024 00000007571 14166623167 017034 0ustar00brianstaff000000 000000 =pod
=encoding utf8
=for HTML
=for HTML
=for HTML
=for HTML
=for HTML
=for HTML
=for HTML
=head1 The Module::Extract::Use module
This is the I for the L Perl module.
You're probably looking at this because you don't know where else to
find what you're looking for. Read this once and you might never have
to read one again for any Perl module.
=head2 Documentation
To read about L, look at the embedded
documentation in the module itself. Inside the distribution, you can
format it with L:
% perldoc lib/Module/Extract/Use.pm
If you have already installed the module, you can specify the module
name instead of the file location:
% perldoc Module::Extract::Use
You can read the documentation and inspect the meta data at
L.
The standard module documentation has example uses in the SYNOPSIS
section, but you can also look in the I directory (if it's
there), or look at the test files in I.
=head2 Installation
You can install this module with a CPAN client, which will resolve
and install the dependencies:
% cpan Module::Extract::Use
% cpanm Module::Extract::Use
You can also install directly from the distribution directory, which
will also install the dependencies:
% cpan .
% cpanm .
You could install just this module manually:
% perl Makefile.PL
% make
% make test
% make install
You probably don't want to do that unless you're fiddling with the
module and only want to run the tests without installing anything.
=head2 Source location
The meta data, such as the source repository and bug tracker, is in
I or the I files it creates. You can find that on
those CPAN web interfaces, but you can also look at files directly in
the source repository:
=over 4
=item * L
=back
If you find a problem, file a ticket in the L:
=over 4
=item * L
=back
=head2 Getting help
Although I'm happy to hear from module users in private email,
that's the best way for me to forget to do something.
Besides the issue trackers, you can find help at
L or
L, both of which have many
competent Perlers who can answer your question, almost in real time.
They might not know the particulars of this module, but they can help
you diagnose your problem.
You might like to read L.
=head2 Copyright and License
You should have received a I file, but the license is also noted
in the module files. About the only thing you can't do is pretend that
you wrote code that you didn't.
=head2 Good luck!
Enjoy,
brian d foy, bdfoy@cpan.org
=cut
Module-Extract-Use-1.051/MANIFEST.SKIP000644 000765 000024 00000002100 14166623167 017250 0ustar00brianstaff000000 000000
#!start included /usr/local/perls/perl-5.18.1/lib/5.18.1/ExtUtils/MANIFEST.SKIP
# Avoid version control files.
\bRCS\b
\bCVS\b
\bSCCS\b
,v$
\B\.svn\b
\B\.git\b
\B\.gitignore\b
\b_darcs\b
\B\.cvsignore$
# Avoid VMS specific MakeMaker generated files
\bDescrip.MMS$
\bDESCRIP.MMS$
\bdescrip.mms$
# Avoid Makemaker generated and utility files.
\bMANIFEST\.bak
\bMakefile$
\bblib/
\bMakeMaker-\d
\bpm_to_blib\.ts$
\bpm_to_blib$
\bblibdirs\.ts$ # 6.18 through 6.25 generated this
# Avoid Module::Build generated and utility files.
\bBuild$
\b_build/
\bBuild.bat$
\bBuild.COM$
\bBUILD.COM$
\bbuild.com$
# Avoid temp and backup files.
~$
\.old$
\#$
\b\.#
\.bak$
\.tmp$
\.#
\.rej$
# Avoid OS-specific files/dirs
# Mac OSX metadata
\B\.DS_Store
# Mac OSX SMB mount metadata files
\B\._
# Avoid Devel::Cover and Devel::CoverX::Covered files.
\bcover_db\b
\bcovered\b
# Avoid MYMETA files
^MYMETA\.
#!end included /usr/local/perls/perl-5.18.1/lib/5.18.1/ExtUtils/MANIFEST.SKIP
\.?appveyor.yml
\.releaserc
\.lwpcookies
Module-.*
\bMANIFEST\s\d
\bChanges\s\d
\.icloud$
\A\.github\b
Module-Extract-Use-1.051/examples/000755 000765 000024 00000000000 14166623170 017171 5ustar00brianstaff000000 000000 Module-Extract-Use-1.051/META.yml000664 000765 000024 00000001646 14166623170 016635 0ustar00brianstaff000000 000000 ---
abstract: 'Discover the modules a module explicitly uses'
author:
- 'brian d foy '
build_requires:
Test::More: '1'
Test::Output: '0'
configure_requires:
ExtUtils::MakeMaker: '6.64'
File::Spec::Functions: '0'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 2.150010'
keywords:
- ppi
- parsing
- static-analysis
- modules
license: artistic_2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Module-Extract-Use
no_index:
directory:
- t
- inc
- corpus
requires:
Getopt::Std: '0'
PPI: '0'
perl: '5.010'
resources:
bugtracker: https://github.com/briandfoy/module-extract-use/issues
homepage: https://github.com/briandfoy/module-extract-use
repository: https://github.com/briandfoy/module-extract-use.git
version: '1.051'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
Module-Extract-Use-1.051/lib/000755 000765 000024 00000000000 14166623170 016121 5ustar00brianstaff000000 000000 Module-Extract-Use-1.051/Makefile.PL000644 000765 000024 00000005514 14166623167 017340 0ustar00brianstaff000000 000000 package Module::Extract::Use;
use strict;
use warnings;
=encoding utf8
=head1 The build file for Module::Extract::Use
This build file is a modulino; it works as both a build script and
a module.
To build the distribution, run this file normally:
% perl Makefile.PL
But, it's more interesting than that. You can load it with C
and call C to get the data structure it passes to
C:
my $package = require '/path/to/Makefile.PL';
my $arguments = $package->arguments;
Note that C-ing a file makes an entry in C<%INC> for exactly
that name. If you try to C another file with the same name,
even from a different path, C thinks it has already loaded
the file. As such, I recommend you always require the full path to the
file.
The return value of the C is a package name (in this case,
the name of the main module. Use that to call the C method.
Even if this distribution needs a higher version of Perl, this bit
only needs v5.8. You can play with the data structure with a primitive
Perl.
=cut
use File::Spec::Functions qw(catfile);
my $module = __PACKAGE__;
( my $dist = $module ) =~ s/::/-/g;
my $github = 'https://github.com/briandfoy/module-extract-use';
my $main_file = catfile( 'lib', split /::/, "$module.pm" );
my %WriteMakefile = (
'MIN_PERL_VERSION' => '5.010',
'NAME' => $module,
'ABSTRACT_FROM' => $main_file,
'VERSION_FROM' => 'lib/Module/Extract/Use.pm',
'LICENSE' => 'artistic_2',
'AUTHOR' => 'brian d foy ',
'CONFIGURE_REQUIRES' => {
'ExtUtils::MakeMaker' => '6.64',
'File::Spec::Functions' => '0',
},
'BUILD_REQUIRES' => {
},
'TEST_REQUIRES' => {
'Test::More' => '1',
'Test::Output' => '0',
},
'PREREQ_PM' => {
'Getopt::Std' => '0',
'PPI' => '0',
},
'META_MERGE' => {
'meta-spec' => { version => 2 },
keywords => [ qw( ppi parsing static-analysis modules ) ],
resources => {
repository => {
type => 'git',
url => "$github.git",
web => $github,
},
bugtracker => {
web => "$github/issues",
},
homepage => $github,
},
no_index => {
dir => [ qw(corpus) ],
directory => [ qw(corpus) ],
},
},
clean => { FILES => "$dist-*" },
);
sub arguments { \%WriteMakefile }
do_it() unless caller;
sub do_it {
require File::Spec;
my $MM ='ExtUtils::MakeMaker';
my $MM_version =
eval{ "$MM " . $WriteMakefile{'CONFIGURE_REQUIRES'}{'ExtUtils::MakeMaker'} }
||
"$MM 6.64";
eval "use $MM_version; 1" or die "Could not load $MM_version: $@";
eval "use Test::Manifest 1.21"
if -e File::Spec->catfile( qw(t test_manifest) );
my $arguments = arguments();
my $minimum_perl = $arguments->{MIN_PERL_VERSION} || '5.008';
eval "require $minimum_perl;" or die $@;
WriteMakefile( %$arguments );
}
no warnings;
__PACKAGE__;
Module-Extract-Use-1.051/INSTALL.SKIP000644 000765 000024 00000000156 14166623167 017161 0ustar00brianstaff000000 000000 README\.pod
README.*
# things that might be in local directories after fooling
# around with them
\.DS_Store
Module-Extract-Use-1.051/META.json000664 000765 000024 00000003152 14166623171 017000 0ustar00brianstaff000000 000000 {
"abstract" : "Discover the modules a module explicitly uses",
"author" : [
"brian d foy "
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 7.62, CPAN::Meta::Converter version 2.150010",
"keywords" : [
"ppi",
"parsing",
"static-analysis",
"modules"
],
"license" : [
"artistic_2"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "Module-Extract-Use",
"no_index" : {
"directory" : [
"t",
"inc",
"corpus"
]
},
"prereqs" : {
"build" : {
"requires" : {}
},
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "6.64",
"File::Spec::Functions" : "0"
}
},
"runtime" : {
"requires" : {
"Getopt::Std" : "0",
"PPI" : "0",
"perl" : "5.010"
}
},
"test" : {
"requires" : {
"Test::More" : "1",
"Test::Output" : "0"
}
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/briandfoy/module-extract-use/issues"
},
"homepage" : "https://github.com/briandfoy/module-extract-use",
"repository" : {
"type" : "git",
"url" : "https://github.com/briandfoy/module-extract-use.git",
"web" : "https://github.com/briandfoy/module-extract-use"
}
},
"version" : "1.051",
"x_serialization_backend" : "JSON::PP version 4.06"
}
Module-Extract-Use-1.051/lib/Module/000755 000765 000024 00000000000 14166623170 017346 5ustar00brianstaff000000 000000 Module-Extract-Use-1.051/lib/Module/Extract/000755 000765 000024 00000000000 14166623170 020760 5ustar00brianstaff000000 000000 Module-Extract-Use-1.051/lib/Module/Extract/Use.pm000644 000765 000024 00000016075 14166623167 022071 0ustar00brianstaff000000 000000 use v5.10;
package Module::Extract::Use;
use strict;
use warnings;
no warnings;
our $VERSION = '1.051';
=encoding utf8
=head1 NAME
Module::Extract::Use - Discover the modules a module explicitly uses
=head1 SYNOPSIS
use Module::Extract::Use;
my $extor = Module::Extract::Use->new;
my @modules = $extor->get_modules( $file );
if( $extor->error ) { ... }
my $details = $extor->get_modules_with_details( $file );
foreach my $detail ( @$details ) {
printf "%s %s imports %s\n",
$detail->module, $detail->version,
join ' ', @{ $detail->imports }
}
=head1 DESCRIPTION
Extract the names of the modules used in a file using a static
analysis. Since this module does not run code, it cannot find dynamic
uses of modules, such as C. It only reports modules
that the file loads directly or are in the import lists for L
or L.
The module can handle the conventional inclusion of modules with either
C