Skip to content

Commit

Permalink
Added Melody::Test::Util to git repo. Was left out from an earlier co…
Browse files Browse the repository at this point in the history
…mmit from what I can tell.
  • Loading branch information
tima committed Oct 7, 2010
1 parent 4d6df81 commit 077bfa9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions t/lib/Melody/Util/Test.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package Melody::Util::Test;
use strict;
use warnings;

use File::Spec;

sub find_addon_libs {
my $addons_full_path = shift;
my @libs;
opendir ADDONS, $addons_full_path;
my @addons = readdir ADDONS;
closedir ADDONS;
for (@addons) {
my $plugin_full_path = File::Spec->catdir($addons_full_path, $_);
next unless -d $plugin_full_path;
next if $_ eq '..';
opendir SUBDIR, $plugin_full_path;
my @plugin_files = readdir SUBDIR;
closedir SUBDIR;
for my $file (@plugin_files) {
if ($file eq 'lib' || $file eq 'extlib') {
my $plib = File::Spec->catdir($plugin_full_path, $file);
unshift @libs, $plib if -d $plib;
}
}
}
return \@libs;
}

1;

0 comments on commit 077bfa9

Please sign in to comment.