fixed up several broken URLs (minor but annoying)
[gitolite.git] / src / lib / Gitolite / Triggers.pm
blob16e8aa651e5c5eaa01a2b925e2e4c722141726b9
1 package Gitolite::Triggers;
3 # load and run triggered modules
4 # ----------------------------------------------------------------------
6 #<<<
7 @EXPORT = qw(
8 );
9 #>>>
10 use Exporter 'import';
12 use Gitolite::Rc;
13 use Gitolite::Common;
15 use strict;
16 use warnings;
18 # ----------------------------------------------------------------------
20 sub run {
21 my ( $module, $sub, @args ) = @_;
22 $module = "Gitolite::Triggers::$module" if $module !~ /^Gitolite::/;
24 eval "require $module";
25 _die "$@" if $@;
26 my $subref;
27 eval "\$subref = \\\&$module" . "::" . "$sub";
28 _die "module '$module' does not exist or does not have sub '$sub'" unless ref($subref) eq 'CODE';
30 $subref->(@args);