Skip to content

Commit

Permalink
Add plugin_search_component function to WellWell::Core.
Browse files Browse the repository at this point in the history
  • Loading branch information
racke committed Oct 24, 2010
1 parent 278b1d0 commit f8e4d13
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/WellWell/Core.pm
Expand Up @@ -22,6 +22,12 @@ package WellWell::Core;
use strict;
use warnings;

use vars qw/@ISA @EXPORT_OK/;

require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw/plugin_search_component/;

use Vend::Config;

use WellWell::Cart;
Expand Down Expand Up @@ -79,6 +85,20 @@ sub plugin_scan_sub {
"$plref->{$plugin}->{directory}/pages");
}
}

# store in catalog configuration
$Vend::Cfg->{PluginRepository} = $plref;
}

sub plugin_search_component {
my ($name) = @_;
my ($plugin, $ref);

while (($plugin, $ref) = each %{$Vend::Cfg->{PluginRepository}}) {
if (-f "$ref->{directory}/components/$name") {
return $ref;
}
}
}

sub hooks {
Expand Down

0 comments on commit f8e4d13

Please sign in to comment.