line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RDF::DOAP::Project; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
4
|
|
|
|
|
|
|
our $VERSION = '0.103'; |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
16
|
use Moose; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
19
|
|
7
|
|
|
|
|
|
|
extends qw(RDF::DOAP::Resource); |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
16011
|
use RDF::DOAP::Person; |
|
2
|
|
|
|
|
115
|
|
|
2
|
|
|
|
|
114
|
|
10
|
2
|
|
|
2
|
|
1185
|
use RDF::DOAP::Version; |
|
2
|
|
|
|
|
179
|
|
|
2
|
|
|
|
|
130
|
|
11
|
2
|
|
|
2
|
|
1075
|
use RDF::DOAP::Repository; |
|
2
|
|
|
|
|
72
|
|
|
2
|
|
|
|
|
110
|
|
12
|
2
|
|
|
2
|
|
18
|
use RDF::DOAP::Types -types; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
17
|
|
13
|
2
|
|
|
2
|
|
11998
|
use RDF::DOAP::Utils -traits; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
21
|
|
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
838
|
use RDF::Trine::Namespace qw(rdf rdfs owl xsd); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
16
|
|
16
|
|
|
|
|
|
|
my $doap = 'RDF::Trine::Namespace'->new('http://usefulinc.com/ns/doap#'); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has $_ => ( |
19
|
|
|
|
|
|
|
traits => [ WithURI ], |
20
|
|
|
|
|
|
|
is => 'ro', |
21
|
|
|
|
|
|
|
isa => String, |
22
|
|
|
|
|
|
|
coerce => 1, |
23
|
|
|
|
|
|
|
uri => do { (my $x = $_) =~ s/_/-/g; $doap->$x }, |
24
|
|
|
|
|
|
|
) for qw(name shortdesc created description programming_language os ); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has release => ( |
27
|
|
|
|
|
|
|
traits => [ WithURI ], |
28
|
|
|
|
|
|
|
is => 'ro', |
29
|
|
|
|
|
|
|
isa => ArrayRef[Version], |
30
|
|
|
|
|
|
|
coerce => 1, |
31
|
|
|
|
|
|
|
uri => $doap->release, |
32
|
|
|
|
|
|
|
multi => 1, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has $_ => ( |
36
|
|
|
|
|
|
|
traits => [ WithURI, Gathering ], |
37
|
|
|
|
|
|
|
is => 'ro', |
38
|
|
|
|
|
|
|
isa => ArrayRef[Person], |
39
|
|
|
|
|
|
|
coerce => 1, |
40
|
|
|
|
|
|
|
multi => 1, |
41
|
|
|
|
|
|
|
uri => $doap->$_, |
42
|
|
|
|
|
|
|
gather_as => ['maintainer'], |
43
|
|
|
|
|
|
|
) for qw( maintainer ); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has $_ => ( |
46
|
|
|
|
|
|
|
traits => [ WithURI, Gathering ], |
47
|
|
|
|
|
|
|
is => 'ro', |
48
|
|
|
|
|
|
|
isa => ArrayRef[Person], |
49
|
|
|
|
|
|
|
coerce => 1, |
50
|
|
|
|
|
|
|
multi => 1, |
51
|
|
|
|
|
|
|
uri => $doap->$_, |
52
|
|
|
|
|
|
|
gather_as => ['contributor'], |
53
|
|
|
|
|
|
|
) for qw( developer documenter ); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
has $_ => ( |
56
|
|
|
|
|
|
|
traits => [ WithURI, Gathering ], |
57
|
|
|
|
|
|
|
is => 'ro', |
58
|
|
|
|
|
|
|
isa => ArrayRef[Person], |
59
|
|
|
|
|
|
|
coerce => 1, |
60
|
|
|
|
|
|
|
multi => 1, |
61
|
|
|
|
|
|
|
uri => $doap->$_, |
62
|
|
|
|
|
|
|
gather_as => ['thanks'], |
63
|
|
|
|
|
|
|
) for qw( translator tester helper ); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
has $_ => ( |
66
|
|
|
|
|
|
|
traits => [ WithURI ], |
67
|
|
|
|
|
|
|
is => 'ro', |
68
|
|
|
|
|
|
|
isa => Identifier, |
69
|
|
|
|
|
|
|
coerce => 1, |
70
|
|
|
|
|
|
|
uri => do { (my $x = $_) =~ s/_/-/g; $doap->$x }, |
71
|
|
|
|
|
|
|
) for qw( wiki bug_database mailing_list download_page ); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
has $_ => ( |
74
|
|
|
|
|
|
|
traits => [ WithURI ], |
75
|
|
|
|
|
|
|
is => 'ro', |
76
|
|
|
|
|
|
|
isa => ArrayRef[Identifier], |
77
|
|
|
|
|
|
|
coerce => 1, |
78
|
|
|
|
|
|
|
uri => do { (my $x = $_) =~ s/_/-/g; $doap->$x }, |
79
|
|
|
|
|
|
|
multi => 1, |
80
|
|
|
|
|
|
|
) for qw( homepage old_homepage license download_mirror screenshots category support_forum developer_forum ); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
has repository => ( |
83
|
|
|
|
|
|
|
traits => [ WithURI ], |
84
|
|
|
|
|
|
|
is => 'ro', |
85
|
|
|
|
|
|
|
isa => ArrayRef[Repository], |
86
|
|
|
|
|
|
|
coerce => 1, |
87
|
|
|
|
|
|
|
multi => 1, |
88
|
|
|
|
|
|
|
uri => $doap->repository, |
89
|
|
|
|
|
|
|
); |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub rdf_load_all |
92
|
|
|
|
|
|
|
{ |
93
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
94
|
0
|
|
|
|
|
0
|
my ($model) = @_; |
95
|
0
|
|
|
|
|
0
|
map $class->rdf_load($_, $model), $model->subjects($rdf->type, $doap->Project); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub gather_all_maintainers |
99
|
|
|
|
|
|
|
{ |
100
|
0
|
|
|
0
|
0
|
0
|
require RDF::DOAP::Utils; |
101
|
0
|
|
|
|
|
0
|
my $self = shift; |
102
|
0
|
|
|
|
|
0
|
RDF::DOAP::Utils::gather_objects($self, 'maintainer'); |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub gather_all_contributors |
106
|
|
|
|
|
|
|
{ |
107
|
0
|
|
|
0
|
0
|
0
|
require RDF::DOAP::Utils; |
108
|
0
|
|
|
|
|
0
|
my $self = shift; |
109
|
0
|
|
|
|
|
0
|
RDF::DOAP::Utils::gather_objects($self, 'contributor'); |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub gather_all_thanks |
113
|
|
|
|
|
|
|
{ |
114
|
0
|
|
|
0
|
0
|
0
|
require RDF::DOAP::Utils; |
115
|
0
|
|
|
|
|
0
|
my $self = shift; |
116
|
0
|
|
|
|
|
0
|
RDF::DOAP::Utils::gather_objects($self, 'thanks'); |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub sorted_releases |
120
|
|
|
|
|
|
|
{ |
121
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
122
|
|
|
|
|
|
|
my @rels = sort { |
123
|
12
|
0
|
0
|
|
|
351
|
($a->revision and $b->revision and version->parse($a->revision) cmp version->parse($b->revision)) or |
|
|
|
0
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
33
|
|
|
|
|
124
|
|
|
|
|
|
|
($a->issued and $b->issued and $a->issued cmp $b->issued) or |
125
|
|
|
|
|
|
|
($a->rdf_about and $b->rdf_about and $a->rdf_about->as_ntriples cmp $b->rdf_about->as_ntriples) |
126
|
1
|
|
|
|
|
2
|
} @{$self->release}; |
|
1
|
|
|
|
|
33
|
|
127
|
1
|
|
|
|
|
7
|
return \@rels; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub changelog |
131
|
|
|
|
|
|
|
{ |
132
|
1
|
|
|
1
|
0
|
214
|
my $self = shift; |
133
|
|
|
|
|
|
|
|
134
|
1
|
|
|
|
|
2
|
my @releases = @{ $self->sorted_releases }; |
|
1
|
|
|
|
|
6
|
|
135
|
1
|
|
|
|
|
4
|
my @filtered_releases; |
136
|
1
|
|
|
|
|
6
|
while (@releases) { |
137
|
7
|
|
|
|
|
18
|
my $next = shift @releases; |
138
|
7
|
100
|
|
|
|
35
|
if (@releases) { |
139
|
6
|
|
|
|
|
11
|
my $found_catchup = undef; |
140
|
6
|
|
|
|
|
18
|
for my $i (reverse(0 .. $#releases)) { |
141
|
26
|
50
|
|
|
|
36
|
for my $cs (@{ $releases[$i]->changesets || [] }) { |
|
26
|
|
|
|
|
628
|
|
142
|
26
|
100
|
100
|
|
|
731
|
if ($cs->has_versus and $cs->versus->revision eq $next->revision) { |
143
|
1
|
|
|
|
|
4
|
$found_catchup = $i; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
} |
147
|
6
|
100
|
|
|
|
18
|
if ($found_catchup) { |
148
|
1
|
|
|
|
|
6
|
my @intermediates = splice(@releases, 0, $found_catchup); |
149
|
1
|
|
|
|
|
4
|
push @filtered_releases, $next->changelog_section; |
150
|
1
|
|
|
|
|
5
|
push @filtered_releases, map $_->_changelog_section_header, @intermediates; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
else { |
153
|
5
|
|
|
|
|
17
|
push @filtered_releases, $next->changelog_section; |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
else { |
157
|
1
|
|
|
|
|
5
|
push @filtered_releases, $next->changelog_section; |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
|
161
|
1
|
|
|
|
|
8
|
return join "\n", |
162
|
|
|
|
|
|
|
$self->_changelog_header, |
163
|
|
|
|
|
|
|
reverse @filtered_releases; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
sub _changelog_header |
167
|
|
|
|
|
|
|
{ |
168
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
169
|
1
|
|
|
|
|
29
|
my @lines = ( |
170
|
|
|
|
|
|
|
$self->name, |
171
|
|
|
|
|
|
|
("=" x length($self->name)), |
172
|
|
|
|
|
|
|
"", |
173
|
|
|
|
|
|
|
); |
174
|
|
|
|
|
|
|
push @lines, sprintf('%-14s%s', "$_->[0]:", $_->[1]) |
175
|
1
|
|
|
|
|
28
|
for grep defined($_->[1]), ( |
176
|
|
|
|
|
|
|
["Created" => $self->created], |
177
|
1
|
50
|
|
|
|
28
|
map(["Home page"=>$_], @{$self->homepage||[]}), |
178
|
|
|
|
|
|
|
["Bug tracker" => $self->bug_database], |
179
|
|
|
|
|
|
|
["Wiki" => $self->wiki], |
180
|
|
|
|
|
|
|
["Mailing list" => $self->mailing_list], |
181
|
1
|
50
|
|
|
|
28
|
map(["Maintainer"=>$_->to_string], @{$self->maintainer||[]}), |
182
|
|
|
|
|
|
|
); |
183
|
1
|
|
|
|
|
54
|
return join("\n", @lines)."\n"; |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
1; |