File Coverage

blib/lib/Hubot/Scripts/rules.pm
Criterion Covered Total %
statement 6 9 66.6
branch n/a
condition n/a
subroutine 2 4 50.0
pod 0 1 0.0
total 8 14 57.1


line stmt bran cond sub pod time code
1             package Hubot::Scripts::rules;
2             $Hubot::Scripts::rules::VERSION = '0.1.10';
3 1     1   988 use strict;
  1         1  
  1         33  
4 1     1   3 use warnings;
  1         1  
  1         123  
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.10
31              
32             =head1 SYNOPSIS
33              
34             hubot the rules - make sure hubot still knows the rules.
35              
36             =head1 AUTHOR
37              
38             Jonas Genannt
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