line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Socialtext::WikiObject::PreBlock; |
2
|
3
|
|
|
3
|
|
56063
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
100
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
81
|
|
4
|
3
|
|
|
3
|
|
16
|
use base 'Socialtext::WikiObject'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1194
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Socialtext::WikiObject::PreBlock - Parse out the first '.pre' block |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=cut |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 METHODS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head2 parse_wikitext() |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Override parent method to load the pre block |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub parse_wikitext { |
23
|
5
|
|
|
5
|
1
|
11
|
my $self = shift; |
24
|
5
|
|
|
|
|
9
|
my $wikitext = shift; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Load the YAML |
27
|
5
|
|
|
|
|
27
|
$wikitext =~ s/^.*?\.pre\n(.+)\.pre.+$/$1/s; |
28
|
5
|
|
|
|
|
14
|
chomp $wikitext; |
29
|
5
|
|
|
|
|
10
|
$wikitext .= "\n"; |
30
|
5
|
|
|
|
|
22
|
$self->{_pre_block} = $wikitext; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 pre_block |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Return the parsed .pre block |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
5
|
|
|
5
|
1
|
28
|
sub pre_block { $_[0]->{_pre_block} } |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 AUTHOR |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Luke Closs, C<< >> |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 BUGS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
48
|
|
|
|
|
|
|
L. |
49
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
50
|
|
|
|
|
|
|
your bug as I make changes. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Copyright 2007 Luke Closs, all rights reserved. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
57
|
|
|
|
|
|
|
under the same terms as Perl itself. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |