line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Changes::Parser::Free; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1290
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
5
|
2
|
|
|
2
|
|
1790
|
use DateTime::Format::DateParse; |
|
2
|
|
|
|
|
21038
|
|
|
2
|
|
|
|
|
27
|
|
6
|
2
|
|
|
2
|
|
57
|
use DateTime::Format::W3CDTF; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
12
|
|
7
|
2
|
|
|
2
|
|
45
|
use Module::Changes; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
19
|
|
8
|
2
|
|
|
2
|
|
51
|
use Perl::Version; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
15
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
73
|
use base 'Module::Changes::Parser'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1057
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub parse_string { |
18
|
0
|
|
|
0
|
1
|
|
my ($self, $content) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $changes = Module::Changes->make_object_for_type('entire'); |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my @parts = split /\n\n(?=\w)/ => $content; |
23
|
0
|
|
|
|
|
|
for (@parts) { 1 while chomp } |
|
0
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
(my $name = shift @parts) =~ s/.*\s//; |
26
|
0
|
|
|
|
|
|
$changes->name($name); |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
for my $part (@parts) { |
29
|
0
|
|
|
|
|
|
my ($version_line, $rel_change_lines) = split /\n/, $part, 2; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
my ($version, $date_str) = split /\s+/, $version_line, 2; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# rudimentary support for german dates; a bit arbitrary, I know... |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
my %map = ( |
36
|
|
|
|
|
|
|
Mo => 'Mon', |
37
|
|
|
|
|
|
|
Di => 'Tue', |
38
|
|
|
|
|
|
|
Mi => 'Wed', |
39
|
|
|
|
|
|
|
Do => 'Thu', |
40
|
|
|
|
|
|
|
Fr => 'Fri', |
41
|
|
|
|
|
|
|
Sa => 'Sat', |
42
|
|
|
|
|
|
|
So => 'Sun', |
43
|
|
|
|
|
|
|
Mai => 'May', |
44
|
|
|
|
|
|
|
Okt => 'Oct', |
45
|
|
|
|
|
|
|
Dez => 'Dec', |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
while (my ($orig, $replacement) = each %map) { |
49
|
0
|
|
|
|
|
|
$date_str =~ s/\b\Q$orig\E\b/$replacement/g; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my $date = DateTime::Format::DateParse->parse_datetime($date_str); |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my $release = Module::Changes->make_object_for_type('release'); |
55
|
0
|
|
|
|
|
|
$release->version(Perl::Version->new($version)); |
56
|
0
|
|
|
|
|
|
$release->date($date); |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
my @rel_changes = split /^(?=\s+- )/m, $rel_change_lines; |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
for my $rel_change (@rel_changes) { |
61
|
0
|
|
|
|
|
|
1 while chomp $rel_change; |
62
|
0
|
0
|
|
|
|
|
if ($rel_change =~ /^(\s+-\s+)/) { |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# take off an equal amount of indenting from each line |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
my $indent = length $1; |
67
|
0
|
|
|
|
|
|
my @lines = split /\n/ => $rel_change; |
68
|
0
|
|
|
|
|
|
substr($_, 0, $indent, '') for @lines; |
69
|
0
|
|
|
|
|
|
$release->changes_push(join ' ' => @lines); |
70
|
|
|
|
|
|
|
} else { |
71
|
0
|
|
|
|
|
|
die "can't determine indent from\n$rel_change\n"; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
$changes->releases_push($release); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
$changes; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |