Mendo.pm

filter: Statementstmt 100% 33 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 3 / 3 totaltotal 100% 44 / 44 CC 2 SCAR 2.0
CC
2
Cov
100%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Mendo/Linea.pm ↑ Summary
1 1 ▶use lib qw( ../../lib ); # for syntax checking -*-CPerl-*-
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package Don::Mendo;
4  
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 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 ▶use Don::Mendo::Jornada;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 # Module implementation here
20 1 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
21 1 my $class = shift;
22 1 my $text = join("",<DATA>);
23 1 $text =~ s/(\s+\d+\s+ )//gs;
24 1 my $self = { _text => $text };
25 1 bless $self, $class;
26 1 my @jornadas = split(/\s{39}\s+JORNADA/, $text );
27 1 $self->{'_intro'} = $jornadas[0];
28  
29 1 for my $j( @jornadas[1..4] ) { #4 journeys only, first is intro
30 4 my $esta_jornada = new Don::Mendo::Jornada ($j );
31 4 push @{$self->{'_jornadas'}}, $esta_jornada;
32 }
33 1 return $self;
34
35 }
36  
37 1 ▶sub text {
Subroutine text: called CC=1 SCAR=0.0
Pod documented
38 1 my $self = shift;
39 1 return $self->{'text'};
40 }
41  
42 4 ▶sub jornadas {
Subroutine jornadas: called CC=1 SCAR=0.0
Pod documented
43 4 my $self = shift;
44 4 return $self->{'_jornadas'};
45 }
46  
47 1 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<www.juntadeandalucia.es/averroes/~04700442a/Mendo.pdf|Averroes
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<bug-don-mendo@rt.cpan.org>, or through the web interface at
115 L<http://rt.cpan.org>.
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<< <jj@merelo.net> >>
126  
127  
128 =head1 LICENCE AND COPYRIGHT
129  
130 Copyright (c) 2008, JJ Merelo C<< <jj@merelo.net> >>. 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<perlartistic>.
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__
« Mendo/Linea.pm ↑ Summary