File Coverage

lib/Don/Mendo.pm
Criterion Covered Total %
statement 31 31 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 3 3 100.0
total 42 42 100.0


line stmt bran cond sub pod time code
1 1     1   29187 use lib qw( ../../lib ); # for syntax checking -*-CPerl-*-
  1         3  
  1         6  
2              
3             package Don::Mendo;
4              
5 1     1   119 use warnings;
  1         3  
  1         31  
6 1     1   6 use strict;
  1         6  
  1         42  
7 1     1   13 use Carp;
  1         2  
  1         129  
8              
9             our $VERSION = "0.0.7";
10              
11             # Other recommended modules (uncomment to use):
12             # use IO::Prompt;
13             # use Perl6::Export;
14             # use Perl6::Slurp;
15             # use Perl6::Say;
16              
17 1     1   492 use Don::Mendo::Jornada;
  1         3  
  1         264  
18              
19             # Module implementation here
20             sub new {
21 1     1 1 220 my $class = shift;
22 1         3833 my $text = join("",);
23 1         5131 $text =~ s/(\s+\d+\s+ )//gs;
24 1         30 my $self = { _text => $text };
25 1         5 bless $self, $class;
26 1         2594 my @jornadas = split(/\s{39}\s+JORNADA/, $text );
27 1         10 $self->{'_intro'} = $jornadas[0];
28              
29 1         6 for my $j( @jornadas[1..4] ) { #4 journeys only, first is intro
30 4         21 my $esta_jornada = new Don::Mendo::Jornada ($j );
31 4         6 push @{$self->{'_jornadas'}}, $esta_jornada;
  4         11  
32             }
33 1         8 return $self;
34            
35             }
36              
37             sub text {
38 1     1 1 1363 my $self = shift;
39 1         6 return $self->{'text'};
40             }
41              
42             sub jornadas {
43 4     4 1 8 my $self = shift;
44 4         11 return $self->{'_jornadas'};
45             }
46              
47             1; # Magic true value required at end of module
48              
49              
50             =encoding utf8
51              
52             =head1 NAME
53              
54              
55             Don::Mendo - Modules for "La venganza de Don Mendo", Sir Mendo's revenge.
56              
57             =head1 VERSION
58              
59             This document describes Don::Mendo version 0.0.3.
60              
61             =head1 SYNOPSIS
62              
63             use Don::Mendo;
64             my $don_mendo = new Don::Mendo;
65             my $first_act = $don_mendo->jornadas->[0]; #Acts in the play are
66             #"jornadas"
67             $first_act->tell(); #Print the whole act
68             my $lines_for_mendo = $first_act->lines_for_character('Mendo');
69             #Just the lines for the main character
70            
71             =head1 DESCRIPTION
72              
73             A structured module for "La venganza de Don Mendo", by D. Pedro Muñoz
74             Seca, a play written in 1918 and widely known and represented in
75             Spain. The text was converted from a PDF found in
76             L
77             Plan>.
78             It's old enough to be in the public domain, so I guess there's no
79             problem here.
80            
81              
82             =head1 INTERFACE
83              
84             =head2 new()
85              
86             Parses the text and sets up journeys, characters, lines and
87             everything.
88              
89             =head2 text()
90              
91             Returns the whole text, in the original version
92              
93             =head2 jornadas()
94              
95             Returns an arrayref with the 4 journeys that constitute the play
96              
97             =head1 DEPENDENCIES
98              
99             Just the basic test and Carp modules
100              
101             =head1 INCOMPATIBILITIES
102              
103             This should be compatible with everything, up to and including
104             Shakespeare, dada theater, and improv.
105              
106              
107             =head1 BUGS AND LIMITATIONS
108              
109             It's not clear from the book if Don Mendo is beautiful or ugly as
110             monkey's ass. You can wait for the next version of Don Mendo to
111             fix this, but I wouldn't hold my breath.
112              
113             Please report any bugs or feature requests to
114             C, or through the web interface at
115             L.
116              
117             =head1 Acknowledgements
118              
119             The author is grateful to the Madrid Perl Mongers, for having a
120             look at the code and using it in their talks, specially Diego
121             Kuperman and Joaquin Ferrero.
122            
123             =head1 AUTHOR
124              
125             JJ Merelo C<< >>
126              
127              
128             =head1 LICENCE AND COPYRIGHT
129              
130             Copyright (c) 2008, JJ Merelo C<< >>. All rights reserved.
131              
132             This module is free software; you can redistribute it and/or
133             modify it under the same terms as Perl itself. See L.
134              
135              
136             =head1 DISCLAIMER OF WARRANTY
137              
138             BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
139             FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
140             OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
141             PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
142             EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
143             WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
144             ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
145             YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
146             NECESSARY SERVICING, REPAIR, OR CORRECTION.
147              
148             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
149             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
150             REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
151             LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
152             OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
153             THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
154             RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
155             FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
156             SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
157             SUCH DAMAGES.
158              
159             =cut
160              
161             __DATA__