File Coverage

blib/lib/App/TailRabbit/Growl.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package App::TailRabbit::Growl;
2 1     1   1259 use Moose;
  0            
  0            
3             use Mac::Growl;
4             use MooseX::Types::Moose qw/ Bool /;
5             use namespace::autoclean;
6              
7             our $VERSION = '0.001';
8              
9             extends 'App::TailRabbit';
10              
11             has sticky => (
12             is => 'ro',
13             isa => Bool,
14             default => 0,
15             );
16              
17             my @names = ("App::TailRabbit::Growl");
18             my $as_app = 'GrowlHelperApp.app';
19              
20             before run => sub {
21             Mac::Growl::RegisterNotifications($as_app, \@names, [$names[0]], $as_app);
22             };
23              
24             sub notify {
25             my ($self, $payload, $routing_key, $message) = @_;
26             Mac::Growl::PostNotification($as_app, $names[0], '', $payload, $self->sticky, 1);
27             }
28              
29             __PACKAGE__->meta->make_immutable;
30             1;
31              
32             =head1 NAME
33              
34             App::TailRabbit::Growl - Listen to a RabbitMQ exchange and emit the messages to Growl.
35              
36             =head1 SYNOPSIS
37              
38             tail_reabbit_growl --sticky --exchange_name firehose --routing_key # --rabbitmq_user guest --rabbitmq_user guest --rabbitmq_host localhost
39              
40             =head1 DESCRIPTION
41              
42             Simple module to consume messages from a RabitMQ message queue.
43              
44             =head1 BUGS
45              
46             =over
47              
48             =item Virtually no docs
49              
50             =item All the same bugs as L<App::TailRabbit>
51              
52             =item Probably several more
53              
54             =back
55              
56             =head1 SEE ALSO
57              
58             L<Net::RabbitFoot>, L<Mac::Growl>.
59              
60             =head1 AUTHOR
61              
62             Tomas (t0m) Doran C<< <bobtfish@bobtfish.net> >>.
63              
64             =head1 COPYRIGHT & LICENSE
65              
66             Copyright the above author(s).
67              
68             Licensed under the same terms as perl itself.
69              
70             =cut