Skip to content

Commit

Permalink
remove automatic HTTP::Tiny dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Jan 21, 2011
1 parent 8d38ba1 commit a5d6607
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 0 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ my $prereq_pm = {
'Test::Harness' => 2.62,
'Test::More' => 0, # MSCHWERN;
# Test-Simple-0.62.tar.gz;
'HTTP::Tiny' => 0, # should go away again before next stable release --andk,20110120
};
if ($^O eq "darwin") {
$prereq_pm->{'File::HomeDir'} = 0.69;
Expand Down
18 changes: 18 additions & 0 deletions t/04clean_load.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
use strict;
eval 'use warnings';

my %has_deps = (
'blib/lib/CPAN/HTTP/Client.pm' => {
'HTTP::Tiny' => '0.005',
},
);

my @modules;
use File::Find;
find(\&list_modules, 'blib/lib');
Expand All @@ -27,10 +33,22 @@ foreach my $file (@modules) {

sub list_modules {
return if $_ !~ /\.pm$/;
return if _missing_deps($File::Find::name);
push @modules, $File::Find::name;
return;
}

sub _missing_deps {
my $file = shift;
if ( my $deps = $has_deps{$file} ) {
while ( my ($mod, $ver) = each %$deps ) {
eval "require $mod; $mod->VERSION($ver); 1"
or return 1;
}
}
return;
}

END {
unlink 'err';
unlink 'out';
Expand Down

0 comments on commit a5d6607

Please sign in to comment.