diff -Nru libmodule-extract-use-perl-1.03/Changes libmodule-extract-use-perl-1.04/Changes --- libmodule-extract-use-perl-1.03/Changes 2012-08-02 16:41:09.000000000 +0000 +++ libmodule-extract-use-perl-1.04/Changes 2014-01-04 11:19:24.000000000 +0000 @@ -1,5 +1,9 @@ # Changes for Module::Extract::Use +1.04 - Sat Jan 4 06:19:01 2014 + * Get rid of MYMETA + * Update test data structures for latest behavior + 1.03 - Thu Aug 2 11:40:34 2012 * Note the "pragma" field in the module details (RT 78728) diff -Nru libmodule-extract-use-perl-1.03/MANIFEST libmodule-extract-use-perl-1.04/MANIFEST --- libmodule-extract-use-perl-1.03/MANIFEST 2012-08-02 16:41:10.000000000 +0000 +++ libmodule-extract-use-perl-1.04/MANIFEST 2014-01-04 11:19:25.000000000 +0000 @@ -2,17 +2,21 @@ corpus/PackageImports.pm corpus/PackageVersion.pm corpus/Repeated.pm +corpus/RT79273.pm examples/extract_modules lib/Module/Extract/Use.pm LICENSE Makefile.PL MANIFEST This list of files +MANIFEST.SKIP README 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 -META.yml Module meta-data (added by MakeMaker) +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -Nru libmodule-extract-use-perl-1.03/MANIFEST.SKIP libmodule-extract-use-perl-1.04/MANIFEST.SKIP --- libmodule-extract-use-perl-1.03/MANIFEST.SKIP 1970-01-01 00:00:00.000000000 +0000 +++ libmodule-extract-use-perl-1.04/MANIFEST.SKIP 2014-01-04 11:19:24.000000000 +0000 @@ -0,0 +1,64 @@ + +#!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 + + +\.travis\.yml +\.releaserc +\.lwpcookies +Module-.* diff -Nru libmodule-extract-use-perl-1.03/META.json libmodule-extract-use-perl-1.04/META.json --- libmodule-extract-use-perl-1.03/META.json 1970-01-01 00:00:00.000000000 +0000 +++ libmodule-extract-use-perl-1.04/META.json 2014-01-04 11:19:25.000000000 +0000 @@ -0,0 +1,49 @@ +{ + "abstract" : "Extract the modules that a modules uses", + "author" : [ + "brian d foy " + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112150", + "keywords" : [ + "ppi", + "parsing", + "static-analysis", + "modules" + ], + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Module-Extract-Use", + "no_index" : { + "directory" : [ + "corpus" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : 0 + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : 0 + } + }, + "runtime" : { + "requires" : { + "PPI" : 0, + "Test::More" : 0, + "Test::Output" : 0 + } + } + }, + "release_status" : "stable", + "resources" : {}, + "version" : "1.04" +} diff -Nru libmodule-extract-use-perl-1.03/META.yml libmodule-extract-use-perl-1.04/META.yml --- libmodule-extract-use-perl-1.03/META.yml 2012-08-02 16:41:10.000000000 +0000 +++ libmodule-extract-use-perl-1.04/META.yml 2014-01-04 11:19:25.000000000 +0000 @@ -1,35 +1,29 @@ ---- #YAML:1.0 -name: Module-Extract-Use -version: 1.03 -abstract: Extract the modules that a modules uses +--- +abstract: 'Extract the modules that a modules uses' author: - - brian d foy -license: perl -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 + - 'brian d foy ' build_requires: - ExtUtils::MakeMaker: 0 -requires: - perl: 5.006 - PPI: 0 - Test::More: 0 - Test::Output: 0 -resources: - repository: git://github.com/briandfoy/module--extract--use.git -no_index: - dir: - - corpus - directory: - - t - - inc - - corpus -generated_by: ExtUtils::MakeMaker version 6.55_02 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + ExtUtils::MakeMaker: 0 +configure_requires: + ExtUtils::MakeMaker: 0 +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112150' keywords: - - ppi - - parsing - - static-analysis - - modules + - ppi + - parsing + - static-analysis + - modules +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: Module-Extract-Use +no_index: + directory: + - corpus +requires: + PPI: 0 + Test::More: 0 + Test::Output: 0 +resources: {} +version: 1.04 diff -Nru libmodule-extract-use-perl-1.03/Makefile.PL libmodule-extract-use-perl-1.04/Makefile.PL --- libmodule-extract-use-perl-1.03/Makefile.PL 2012-08-02 16:41:09.000000000 +0000 +++ libmodule-extract-use-perl-1.04/Makefile.PL 2014-01-04 11:19:24.000000000 +0000 @@ -1,4 +1,4 @@ -use ExtUtils::MakeMaker; +use ExtUtils::MakeMaker 6.48; require 5.008; @@ -17,26 +17,20 @@ 'Test::Output' => '0', }, - ( - $ExtUtils::MakeMaker::VERSION ge '6.48' ? - ( - MIN_PERL_VERSION => 5.006, - - META_MERGE => { - resources => { - repository => 'git://github.com/briandfoy/module--extract--use.git', - }, - keywords => [ qw( ppi parsing static-analysis modules ) ], - no_index => { - dir => [ qw(corpus) ], - directory => [ qw(corpus) ], + META_MERGE => { + resources => { + repository => { + type => 'git', + url => 'git@github.com:briandfoy/module-extract-use.git', + web => 'https://github.com/briandfoy/module-extract-use', }, - }, - ) - : - () - ), + }, + keywords => [ qw( ppi parsing static-analysis modules ) ], + no_index => { + dir => [ qw(corpus) ], + directory => [ qw(corpus) ], + }, + }, clean => { FILES => q|Module-Extract-Use-*| }, - ); diff -Nru libmodule-extract-use-perl-1.03/corpus/RT79273.pm libmodule-extract-use-perl-1.04/corpus/RT79273.pm --- libmodule-extract-use-perl-1.03/corpus/RT79273.pm 1970-01-01 00:00:00.000000000 +0000 +++ libmodule-extract-use-perl-1.04/corpus/RT79273.pm 2014-01-04 11:19:24.000000000 +0000 @@ -0,0 +1,9 @@ +# https://rt.cpan.org/Ticket/Display.html?id=79273 + +package Controller; + +use parent 'CGI::Snapp'; + +use Capture::Tiny 'capture'; + +1; diff -Nru libmodule-extract-use-perl-1.03/debian/changelog libmodule-extract-use-perl-1.04/debian/changelog --- libmodule-extract-use-perl-1.03/debian/changelog 2012-08-04 21:58:27.000000000 +0000 +++ libmodule-extract-use-perl-1.04/debian/changelog 2014-01-11 22:40:12.000000000 +0000 @@ -1,3 +1,16 @@ +libmodule-extract-use-perl (1.04-1) unstable; urgency=low + + [ Salvatore Bonaccorso ] + * Change Vcs-Git to canonical URI (git://anonscm.debian.org) + * Change search.cpan.org based URIs to metacpan.org based URIs + + [ gregor herrmann ] + * New upstream release. + * Update years of copyright. + * Declare compliance with Debian Policy 3.9.5. + + -- gregor herrmann Sat, 11 Jan 2014 23:40:06 +0100 + libmodule-extract-use-perl (1.03-1) unstable; urgency=low * Team upload. diff -Nru libmodule-extract-use-perl-1.03/debian/control libmodule-extract-use-perl-1.04/debian/control --- libmodule-extract-use-perl-1.03/debian/control 2012-08-04 21:58:27.000000000 +0000 +++ libmodule-extract-use-perl-1.04/debian/control 2014-01-11 22:40:12.000000000 +0000 @@ -1,25 +1,28 @@ Source: libmodule-extract-use-perl +Maintainer: Debian Perl Group +Uploaders: Jonathan Yu , + Ryan Niebur , + gregor herrmann , + Jotam Jr. Trejo Section: perl Priority: optional Build-Depends: debhelper (>= 8) Build-Depends-Indep: perl, - libppi-perl, - libtest-output-perl, - libtest-pod-perl, - libtest-pod-coverage-perl, - libtest-manifest-perl -Maintainer: Debian Perl Group -Uploaders: Jonathan Yu , Ryan Niebur , - gregor herrmann , Jotam Jr. Trejo -Standards-Version: 3.9.3 -Homepage: http://search.cpan.org/dist/Module-Extract-Use/ -Vcs-Git: git://git.debian.org/pkg-perl/packages/libmodule-extract-use-perl.git + libppi-perl, + libtest-output-perl, + libtest-pod-perl, + libtest-pod-coverage-perl, + libtest-manifest-perl +Standards-Version: 3.9.5 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libmodule-extract-use-perl.git +Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libmodule-extract-use-perl.git +Homepage: https://metacpan.org/release/Module-Extract-Use/ Package: libmodule-extract-use-perl Architecture: all -Depends: ${misc:Depends}, ${perl:Depends}, - libppi-perl +Depends: ${misc:Depends}, + ${perl:Depends}, + libppi-perl Description: Perl module to extract which modules some code uses Module::Extract::Use extracts the names of the modules used in a file using a static analysis. It uses PPI (Perl Parsing Interface) to tokenize and extract diff -Nru libmodule-extract-use-perl-1.03/debian/copyright libmodule-extract-use-perl-1.04/debian/copyright --- libmodule-extract-use-perl-1.03/debian/copyright 2012-08-04 21:58:27.000000000 +0000 +++ libmodule-extract-use-perl-1.04/debian/copyright 2014-01-11 22:40:12.000000000 +0000 @@ -1,16 +1,16 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Contact: brian d foy -Source: http://search.cpan.org/dist/Module-Extract-Use/ +Source: https://metacpan.org/release/Module-Extract-Use/ Upstream-Name: Module-Extract-Use Files: * -Copyright: 2008-2012, brian d foy +Copyright: 2008-2014, brian d foy License: Artistic or GPL-1+ Files: debian/* Copyright: 2009-2011, Jonathan Yu 2009, Ryan Niebur - 2009, gregor herrmann + 2009-2014, gregor herrmann 2011, Jotam Jr. Trejo License: Artistic or GPL-1+ diff -Nru libmodule-extract-use-perl-1.03/debian/watch libmodule-extract-use-perl-1.04/debian/watch --- libmodule-extract-use-perl-1.03/debian/watch 2012-08-04 21:58:27.000000000 +0000 +++ libmodule-extract-use-perl-1.04/debian/watch 2014-01-11 22:40:12.000000000 +0000 @@ -1,4 +1,2 @@ -# format version number, currently 3; this line is compulsory! version=3 -# URL to the package page followed by a regex to search -http://search.cpan.org/dist/Module-Extract-Use/ .*/Module-Extract-Use-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ +https://metacpan.org/release/Module-Extract-Use/ .*/Module-Extract-Use-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ diff -Nru libmodule-extract-use-perl-1.03/lib/Module/Extract/Use.pm libmodule-extract-use-perl-1.04/lib/Module/Extract/Use.pm --- libmodule-extract-use-perl-1.03/lib/Module/Extract/Use.pm 2012-08-02 16:41:09.000000000 +0000 +++ libmodule-extract-use-perl-1.04/lib/Module/Extract/Use.pm 2014-01-04 11:19:24.000000000 +0000 @@ -7,11 +7,11 @@ use subs qw(); use vars qw($VERSION); -$VERSION = '1.03'; +$VERSION = '1.04'; =head1 NAME -Module::Extract::Use - Pull out the modules a module uses +Module::Extract::Use - Pull out the modules a module explicitly uses =head1 SYNOPSIS @@ -33,7 +33,10 @@ 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. +uses of modules, such as C. It only reports modules +that the file loads directly. Modules loaded with C or C, +for instance, will will be in the import list for those pragmas but +won't have separate entries in the data this module returns. =cut @@ -147,6 +150,7 @@ grep { ! $Seen{ $_->{module} }++ && $_->{module} } map { my $hash = bless { + content => $_->content, pragma => $_->pragma, module => $_->module, imports => [ $self->_list_contents( $_->arguments ) ], @@ -223,7 +227,7 @@ =head1 COPYRIGHT AND LICENSE -Copyright (c) 2008-2012, brian d foy, All Rights Reserved. +Copyright (c) 2008-2014, brian d foy, All Rights Reserved. You may redistribute this under the same terms as Perl itself. diff -Nru libmodule-extract-use-perl-1.03/t/imports.t libmodule-extract-use-perl-1.04/t/imports.t --- libmodule-extract-use-perl-1.03/t/imports.t 2012-08-02 16:41:09.000000000 +0000 +++ libmodule-extract-use-perl-1.04/t/imports.t 2014-01-04 11:19:24.000000000 +0000 @@ -22,6 +22,7 @@ my $details = $extor->get_modules_with_details( $file ); is( scalar @$details, 10, 'There are the right number of hits' ); +#diag( Dumper( $details ) ); use Data::Dumper; is_deeply( $details, expected(), 'The data structures match' ); } @@ -33,9 +34,11 @@ 'pragma' => '', 'version' => undef, 'imports' => [], - 'module' => 'URI' + 'module' => 'URI', + 'content' => 'use URI;', }, { + 'content' => 'use CGI qw(:standard);', 'pragma' => '', 'version' => undef, 'imports' => [ @@ -44,6 +47,7 @@ 'module' => 'CGI' }, { + 'content' => 'use LWP::Simple 1.23 qw(getstore);', 'pragma' => '', 'version' => '1.23', 'imports' => [ @@ -52,6 +56,7 @@ 'module' => 'LWP::Simple' }, { + 'content' => 'use File::Basename (\'basename\', \'dirname\');', 'pragma' => '', 'version' => undef, 'imports' => [ @@ -61,6 +66,7 @@ 'module' => 'File::Basename' }, { + 'content' => 'use File::Spec::Functions qw(catfile rel2abs);', 'pragma' => '', 'version' => undef, 'imports' => [ @@ -70,6 +76,7 @@ 'module' => 'File::Spec::Functions' }, { + 'content' => 'use autodie \':open\';', 'pragma' => 'autodie', 'version' => undef, 'imports' => [ @@ -78,6 +85,7 @@ 'module' => 'autodie' }, { + 'content' => 'use strict q\'refs\';', 'pragma' => 'strict', 'version' => undef, 'imports' => [ @@ -86,7 +94,8 @@ 'module' => 'strict' }, { - 'pragma' => 'warnings', + 'content' => 'use warnings q;', + 'pragma' => 'warnings', 'version' => undef, 'imports' => [ 'redefine' @@ -94,7 +103,8 @@ 'module' => 'warnings' }, { - 'pragma' => '', + 'content' => 'use Buster "brush";', + 'pragma' => '', 'version' => undef, 'imports' => [ 'brush' @@ -102,7 +112,8 @@ 'module' => 'Buster' }, { - 'pragma' => '', + 'content' => 'use Mimi qq{string};', + 'pragma' => '', 'version' => undef, 'imports' => [ 'string' diff -Nru libmodule-extract-use-perl-1.03/t/rt/79273.t libmodule-extract-use-perl-1.04/t/rt/79273.t --- libmodule-extract-use-perl-1.03/t/rt/79273.t 1970-01-01 00:00:00.000000000 +0000 +++ libmodule-extract-use-perl-1.04/t/rt/79273.t 2014-01-04 11:19:24.000000000 +0000 @@ -0,0 +1,46 @@ +#!/usr/bin/perl +use strict; + +use Test::More tests => 6; +use File::Basename; +use File::Spec::Functions qw(catfile); + +my $class = "Module::Extract::Use"; +use_ok( $class ); + +my $extor = $class->new; +isa_ok( $extor, $class ); +can_ok( $extor, 'get_modules_with_details' ); + + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # +# Try it with a file that has repeated use lines +# I should only get unique names +{ +my $file = catfile( qw(corpus RT79273.pm) ); +ok( -e $file, "Test file [$file] is there" ); + +my $details = $extor->get_modules_with_details( $file ); +is( scalar @$details, 2, 'There are the right number of hits' ); + +is_deeply( $details, expected(), 'The data structures match' ); +} + +sub expected { + return [ + { + 'content' => 'use parent \'CGI::Snapp\';', + 'pragma' => 'parent', + 'version' => undef, + 'imports' => [qw(CGI::Snapp)], + 'module' => 'parent' + }, + { + 'content' => 'use Capture::Tiny \'capture\';', + 'pragma' => '', + 'version' => undef, + 'imports' => [qw(capture)], + 'module' => 'Capture::Tiny' + }, + ]; + } diff -Nru libmodule-extract-use-perl-1.03/t/test_manifest libmodule-extract-use-perl-1.04/t/test_manifest --- libmodule-extract-use-perl-1.03/t/test_manifest 2012-08-02 16:41:09.000000000 +0000 +++ libmodule-extract-use-perl-1.04/t/test_manifest 2014-01-04 11:19:24.000000000 +0000 @@ -4,3 +4,4 @@ get_modules.t imports.t versions.t +rt/79273.t diff -Nru libmodule-extract-use-perl-1.03/t/versions.t libmodule-extract-use-perl-1.04/t/versions.t --- libmodule-extract-use-perl-1.03/t/versions.t 2012-08-02 16:41:09.000000000 +0000 +++ libmodule-extract-use-perl-1.04/t/versions.t 2014-01-04 11:19:24.000000000 +0000 @@ -22,6 +22,7 @@ my $details = $extor->get_modules_with_details( $file ); is( scalar @$details, 3 ); +#diag( Dumper( $details ) ); use Data::Dumper; is_deeply( $details, expected() ); print Dumper( $details ), "\n"; use Data::Dumper; @@ -31,22 +32,25 @@ sub expected { return [ { - 'pragma' => '', + 'content' => 'use HTTP::Size 1.23;', + 'pragma' => '', 'version' => '1.23', 'imports' => [], - 'module' => 'HTTP::Size' + 'module' => 'HTTP::Size' }, { - 'pragma' => '', + 'content' => 'use YAML::Syck 1.54 qw(LoadFile);', + 'pragma' => '', 'version' => '1.54', 'imports' => [ qw(LoadFile) ], - 'module' => 'YAML::Syck' + 'module' => 'YAML::Syck' }, { - 'pragma' => '', + 'content' => 'use LWP::Simple 6.1 qw(getstore);', + 'pragma' => '', 'version' => '6.1', 'imports' => [ qw(getstore) ], - 'module' => 'LWP::Simple' + 'module' => 'LWP::Simple' } ];