Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
fix duckpan query <module> command
Browse files Browse the repository at this point in the history
modules can be specified with PluginType::Plugin, i.e. Goodie::ABC
multiple modules can also be specified
  • Loading branch information
majuscule committed Jan 26, 2013
1 parent 82c344a commit 9f39dfc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/App/DuckPAN/DDG.pm
Expand Up @@ -16,8 +16,12 @@ sub get_blocks_from_current_dir {
my $finder = Module::Pluggable::Object->new(
search_path => ['lib/DDG/Spice','lib/DDG/Goodie','lib/DDG/Fathead','lib/DDG/Longtail'],
);
my @plugins = $finder->plugins;
push @args, sort { $a cmp $b } @plugins;
if (scalar @args == 0) {
my @plugins = $finder->plugins;
push @args, sort { $a cmp $b } @plugins;
} else {
@args = map { $_ = "lib::DDG::$_" unless m,^lib(::|/)DDG,; $_; } @args;
}
@args = map {
$_ =~ s!/!::!g;
my @parts = split('::',$_);
Expand Down Expand Up @@ -54,4 +58,4 @@ sub get_blocks_from_current_dir {
return \@blocks;
}

1;
1;

0 comments on commit 9f39dfc

Please sign in to comment.