line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hubot::Scripts::ping; |
2
|
|
|
|
|
|
|
$Hubot::Scripts::ping::VERSION = '0.1.10'; |
3
|
1
|
|
|
1
|
|
2995
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
117
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub load { |
7
|
0
|
|
|
0
|
0
|
|
my ( $class, $robot ) = @_; |
8
|
0
|
|
|
0
|
|
|
$robot->respond( qr/ping$/i, sub { shift->reply('PONG') } ); |
|
0
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$robot->respond( |
10
|
|
|
|
|
|
|
qr/die$/i, |
11
|
|
|
|
|
|
|
sub { |
12
|
0
|
|
|
0
|
|
|
shift->send('Goodbye, cruel world.'); |
13
|
0
|
|
|
|
|
|
$robot->shutdown; |
14
|
|
|
|
|
|
|
} |
15
|
0
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
1; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Hubot::Scripts::ping |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 VERSION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
version 0.1.10 |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
hubot ping - bot will pong me |
31
|
|
|
|
|
|
|
hubot die - shutdown robot |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 AUTHOR |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Hyungsuk Hong |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |