7 use vars qw($VERSION @AVAILABLE);
10 our(@ISA, @EXPORT, @EXPORT_OK, @AVAILABLE);
15 my $me = $INC{"Generators.pm"};
16 die "Couldn't find myself in \@INC, which is required to load the generators!" if ("$me" eq "");
18 if (opendir(D,"$me/Generators")) {
19 foreach my $gen (readdir(D)) {
20 next if ($gen =~ /^\.\.?$/);
21 require "${me}/Generators/$gen";
23 push(@AVAILABLE, $gen);
26 my $gens = join(', ', @AVAILABLE);
29 push @EXPORT_OK, qw(available);
37 my ($gen, $git_dir, $out_dir, $rel_dir, %build_structure) = @_;
38 return eval("Generators::${gen}::generate(\$git_dir, \$out_dir, \$rel_dir, \%build_structure)") if grep(/^$gen$/, @AVAILABLE);
39 die "Generator \"${gen}\" is not available!\nAvailable generators are: @AVAILABLE\n";