line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hubot::Scripts::rules; |
2
|
|
|
|
|
|
|
$Hubot::Scripts::rules::VERSION = '0.1.9'; |
3
|
1
|
|
|
1
|
|
1377
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
164
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my @rules = ( |
7
|
|
|
|
|
|
|
"1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.", |
8
|
|
|
|
|
|
|
"2. A robot must obey any orders given to it by human beings, except where such orders would conflict with the First Law.", |
9
|
|
|
|
|
|
|
"3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law." |
10
|
|
|
|
|
|
|
); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub load { |
13
|
0
|
|
|
0
|
0
|
|
my ( $class, $robot ) = @_; |
14
|
|
|
|
|
|
|
$robot->respond( |
15
|
|
|
|
|
|
|
qr/(what are )?the (three |3 )?(rules|laws)/i, |
16
|
|
|
|
|
|
|
sub { |
17
|
0
|
|
|
0
|
|
|
shift->send(@rules); |
18
|
|
|
|
|
|
|
} |
19
|
0
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Hubot::Scripts::rules |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 VERSION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
version 0.1.9 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
hubot the rules - make sure hubot still knows the rules. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 AUTHOR |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Jonas Genannt <jonas.genannt@capi2name.de> |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This software is copyright (c) 2013 by Jonas Genannt. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
45
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |