Permalink
Browse files

imported

  • Loading branch information...
domm committed Feb 12, 2012
0 parents commit 578061eeaba38807ff39a476468baceec569b838
Showing with 5,823 additions and 0 deletions.
  1. +26 −0 Build.PL
  2. +99 −0 Changes
  3. +22 −0 MANIFEST
  4. +32 −0 META.yml
  5. +32 −0 Makefile.PL
  6. +29 −0 README
  7. +46 −0 example/cpan.pl
  8. +304 −0 lib/Module/ExtractUse.pm
  9. +4,722 −0 lib/Module/ExtractUse/Grammar.pm
  10. +64 −0 lib/Module/ExtractUse/grammar
  11. +9 −0 t/01_load.t
  12. +72 −0 t/10_basic.t
  13. +34 −0 t/20_parse_self.t
  14. +75 −0 t/21_comment.t
  15. +78 −0 t/22_eval.t
  16. +79 −0 t/23_universal_require.t
  17. +29 −0 t/24_version.t
  18. +27 −0 t/25_utf8.t
  19. +28 −0 t/80_failing.t
  20. +8 −0 xt/pod.t
  21. +8 −0 xt/pod_coverage.t
@@ -0,0 +1,26 @@
use strict;
use 5.008;
use Module::Build;
use File::Spec::Functions;
my $build = Module::Build->new(
module_name => 'Module::ExtractUse',
license => 'perl',
requires => {
'perl' => '5.008',
'Parse::RecDescent'=>'1.94',
'Pod::Strip'=>'1.00',
},
build_requires=> {
'Test::More'=>'0',
'Test::Deep'=>'0.087',
'Test::NoWarnings'=>'0',
'Test::Pod'=>'0',
'Test::Pod::Coverage'=>'0',
'UNIVERSAL::require'=>'0',
},
create_makefile_pl=>'passthrough',
);
$build->create_build_script;
99 Changes
@@ -0,0 +1,99 @@
#-----------------------------------------------------------------
# Changes for Module::ExtractUse
#-----------------------------------------------------------------
TODO:
- autogenerate the grammer during ./Build
- take a look at 'use parent'
0.23 2008-04-26 22:14:28
- fixed bug regarding 'use utf8' which was interpreted as 'utf'
0.22 2007-11-16
- added 'use warnings' again to the Grammer... grr, stupid grammer
generator
0.21 2007-11-14
- fixed Bug reported by hanekomu via IRC:
Modules::ExtractUse breaks if it is used with UNIVERSAL::require
so I renamed the grammer tokens 'use' and 'require'. No API changes,
but if you use the grammer directly, you'll have to adapt to the new
names ('token_use' and 'token_reqire')
0.20 2007-11-07
- resolved RT #30414 by applying the patch submitted by
David Landgren
- rearranged code to better fit my current Perl style
- added 'use warnings' to Module::ExtractUse::Grammer for that
extra kwalitee point
0.19 2007-04-21
- resolved RT #22953 reported by David R Throop
documentation error in SYNOPSIS
- resolved RT #24066 reported by Jose Pedro Oliveira
license clarification
- some doc cleanup
- added more Test modules to build_requires
- no actual code changes where done in this release
0.18 2006-06-19
- resolved [rt.cpan.org #19302] reported by DAGOLDEN@cpan.org
(thanks for the hint!)
we can now handle stuff like:
my $ver=1.22;
eval "use Test::Pod $ver;"
- moved Test::* prereq into build_requires
0.17 2005-11-07
- switched to new Changes format
- updated dependencies (Pod::Strip instead of Pod::Simple)
0.16 2005-09-01
- added test provided by BRICAS (thanks a lot)
- removed bug reported by BRICAS
- updated docs and various stuff
- find uses in eval
0.15 2004-10-01
- use Pod::Strip instead of Pod::Simple subclass hack
- added accessor method C<files>
- updated docs
- added t/pod.t and t/pod_coverage.t
- adapted test suite to new data structure / accessors
- resolved rt.cpan.org ticket #7013 "Parser should remember previously
scanned modules" (Michael G. Schwern) by shuffling various data
structures around
- switched to Module::Build
0.11 2004-07-20
- resolved rt.cpan.org ticket #7012 "uses preceded by a comment can be
ignored" by applying the patch by Michael G. Schwern. Thanks!
0.10 2003-06-08
- accelerated the parsing:
- Parse a statement instead of a whole module
- Befor parsing, check with a regex if the statement
contains 'use' or 'require'
- Enhanced grammer (thanks to $::RD_TRACE)
0.5 2003-04-18
- added precompilation of grammar to Makefile.PL
- changed @found to @::found
- init @::found in start-rule instead via startup-action
0.3 2003-03-31
- sort of working
@@ -0,0 +1,22 @@
Build.PL
Changes
example/cpan.pl
lib/Module/ExtractUse.pm
lib/Module/ExtractUse/grammar
lib/Module/ExtractUse/Grammar.pm
Makefile.PL
MANIFEST
META.yml
README
t/01_load.t
t/10_basic.t
t/20_parse_self.t
t/21_comment.t
t/22_eval.t
t/23_universal_require.t
t/24_version.t
t/25_utf8.t
t/80_failing.t
TODO
xt/pod.t
xt/pod_coverage.t
@@ -0,0 +1,32 @@
---
name: Module-ExtractUse
version: 0.23
author:
- 'Thomas Klausner <domm@zsi.at>'
abstract: Find out what modules are used
license: perl
resources:
license: http://dev.perl.org/licenses/
requires:
Parse::RecDescent: 1.94
Pod::Strip: 1.00
perl: 5.008
build_requires:
Test::Deep: 0.087
Test::More: 0
Test::NoWarnings: 0
Test::Pod: 0
Test::Pod::Coverage: 0
UNIVERSAL::require: 0
provides:
Module::ExtractUse:
file: lib/Module/ExtractUse.pm
version: 0.23
Module::ExtractUse::Grammar:
file: lib/Module/ExtractUse/Grammar.pm
Parse::RecDescent::Module::ExtractUse::Grammar:
file: lib/Module/ExtractUse/Grammar.pm
generated_by: Module::Build version 0.280801
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
version: 1.2
@@ -0,0 +1,32 @@
# Note: this file was auto-generated by Module::Build::Compat version 0.2808_01
require 5.008;
unless (eval "use Module::Build::Compat 0.02; 1" ) {
print "This module requires Module::Build to install itself.\n";
require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt
(' Install Module::Build now from CPAN?', 'y');
unless ($yn =~ /^y/i) {
die " *** Cannot install without Module::Build. Exiting ...\n";
}
require Cwd;
require File::Spec;
require CPAN;
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
CPAN::Shell->install('Module::Build::Compat');
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
or die "Couldn't install Module::Build, giving up.\n";
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
Module::Build::Compat->run_build_pl(args => \@ARGV);
require Module::Build;
Module::Build::Compat->write_makefile(build_class => 'Module::Build');
29 README
@@ -0,0 +1,29 @@
Module/ExtractUse version 0.04
==============================
Module::ExtractUse is basically a Parse::RecDescent grammar to parse
Perl code. It tries very hard to find all modules (whether pragmas,
Core, or from CPAN) used by the parsed code.
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
Parse::RecDescent
Pod::Simple
Test::More (only for the testsuite)
COPYRIGHT AND LICENCE
Copyright (C) 2003 Thomas Klausner
@@ -0,0 +1,46 @@
#!/usr/bin/perl -w
use strict;
use CPANPLUS::Backend;
use File::Find;
use Module::ExtractUse;
my $cp=new CPANPLUS::Backend;
my $filter=shift @ARGV || '^Class::DBI$';
my $hide_own=1;
my $mod_search=$cp->search(type=>'module',
list => [$filter]);
my %seen;
foreach my $module (values %{$mod_search}) {
my $package=$module->package;
next unless $package;
next if $seen{$package}++;
print "*** CHECKING DISTRIBUTION $package\n";
$module->fetch || next;
my $extracted_to=$module->extract;
find(\&find_pms,$extracted_to);
}
sub find_pms {
return unless /\.pm$/;
return if $File::Find::dir=~m|/t/|;
my $p=Module::ExtractUse->new;
my @used=$p->extract_use($_)->array;
print "\n$File::Find::dir $_\n * ";
print join("\n * ",@used),"\n";;
}
Oops, something went wrong.

0 comments on commit 578061e

Please sign in to comment.