line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Growl::Any; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
69060
|
use 5.008_001; |
|
4
|
|
|
|
|
25
|
|
|
4
|
|
|
|
|
147
|
|
4
|
4
|
|
|
4
|
|
22
|
use strict; |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
137
|
|
5
|
4
|
|
|
4
|
|
1137
|
use warnings; |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
223
|
|
6
|
4
|
50
|
|
4
|
|
20
|
use constant _DEBUG => $ENV{GROWL_ANY_DEBUG} ? 1 : 0; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
2039
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $backend; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# already loaded? |
13
|
|
|
|
|
|
|
foreach my $module(keys %INC) { |
14
|
|
|
|
|
|
|
if($module =~ m{\A Growl/Any/ }xms && $module !~ m{ /Base.pm \z}xms) { |
15
|
|
|
|
|
|
|
$backend = $module; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
print STDERR "$backend loaded.\n" if _DEBUG; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# try to find the backend |
22
|
|
|
|
|
|
|
if(!$backend) { |
23
|
|
|
|
|
|
|
my @backends = qw( |
24
|
|
|
|
|
|
|
MacGrowl |
25
|
|
|
|
|
|
|
CocoaGrowl |
26
|
|
|
|
|
|
|
GrowlNotifySend |
27
|
|
|
|
|
|
|
DesktopNotify |
28
|
|
|
|
|
|
|
GrowlGNTP |
29
|
|
|
|
|
|
|
NetGrowlClient |
30
|
|
|
|
|
|
|
NetGrowl |
31
|
|
|
|
|
|
|
Win32MSAgent |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Null |
34
|
|
|
|
|
|
|
IOHandle |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
if (my $default_backend = $ENV{GROWL_ANY_DEFAULT_BACKEND}) { |
37
|
|
|
|
|
|
|
unshift @backends, $default_backend; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
foreach my $b(@backends) { |
41
|
|
|
|
|
|
|
my $file = "Growl/Any/$b.pm"; |
42
|
|
|
|
|
|
|
print STDERR "try to load $file ... " if _DEBUG; |
43
|
|
|
|
|
|
|
if(eval { require $file }) { |
44
|
|
|
|
|
|
|
$backend = $file; |
45
|
|
|
|
|
|
|
print STDERR "ok.\n" if _DEBUG; |
46
|
|
|
|
|
|
|
last; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
else { |
49
|
|
|
|
|
|
|
print STDERR "not ok.\n" if _DEBUG; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
$backend =~ s{/}{::}xmsg; |
55
|
|
|
|
|
|
|
$backend =~ s/\.pm \z//xms; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
our @ISA = ($backend); |
58
|
|
|
|
|
|
|
|
59
|
3
|
|
|
3
|
1
|
40
|
sub backend { $backend } |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
__END__ |