/usr/share/perl5/RDF/DOAP/Project.pm is in librdf-doap-perl 0.100-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | package RDF::DOAP::Project;
our $AUTHORITY = 'cpan:TOBYINK';
our $VERSION = '0.100';
use Moose;
extends qw(RDF::DOAP::Resource);
use RDF::DOAP::Person;
use RDF::DOAP::Version;
use RDF::DOAP::Repository;
use RDF::DOAP::Types -types;
use RDF::DOAP::Utils -traits;
use RDF::Trine::Namespace qw(rdf rdfs owl xsd);
my $doap = 'RDF::Trine::Namespace'->new('http://usefulinc.com/ns/doap#');
has $_ => (
traits => [ WithURI ],
is => 'ro',
isa => String,
coerce => 1,
uri => do { (my $x = $_) =~ s/_/-/g; $doap->$x },
) for qw(name shortdesc created description programming_language os );
has release => (
traits => [ WithURI ],
is => 'ro',
isa => ArrayRef[Version],
coerce => 1,
uri => $doap->release,
multi => 1,
);
has $_ => (
traits => [ WithURI, Gathering ],
is => 'ro',
isa => ArrayRef[Person],
coerce => 1,
multi => 1,
uri => $doap->$_,
gather_as => ['maintainer'],
) for qw( maintainer );
has $_ => (
traits => [ WithURI, Gathering ],
is => 'ro',
isa => ArrayRef[Person],
coerce => 1,
multi => 1,
uri => $doap->$_,
gather_as => ['contributor'],
) for qw( developer documenter );
has $_ => (
traits => [ WithURI, Gathering ],
is => 'ro',
isa => ArrayRef[Person],
coerce => 1,
multi => 1,
uri => $doap->$_,
gather_as => ['thanks'],
) for qw( translator tester helper );
has $_ => (
traits => [ WithURI ],
is => 'ro',
isa => Identifier,
coerce => 1,
uri => do { (my $x = $_) =~ s/_/-/g; $doap->$x },
) for qw( wiki bug_database mailing_list download_page );
has $_ => (
traits => [ WithURI ],
is => 'ro',
isa => ArrayRef[Identifier],
coerce => 1,
uri => do { (my $x = $_) =~ s/_/-/g; $doap->$x },
multi => 1,
) for qw( homepage old_homepage license download_mirror screenshots category support_forum developer_forum );
has repository => (
traits => [ WithURI ],
is => 'ro',
isa => ArrayRef[Repository],
coerce => 1,
multi => 1,
uri => $doap->repository,
);
sub rdf_load_all
{
my $class = shift;
my ($model) = @_;
map $class->rdf_load($_, $model), $model->subjects($rdf->type, $doap->Project);
}
sub gather_all_maintainers
{
require RDF::DOAP::Utils;
my $self = shift;
RDF::DOAP::Utils::gather_objects($self, 'maintainer');
}
sub gather_all_contributors
{
require RDF::DOAP::Utils;
my $self = shift;
RDF::DOAP::Utils::gather_objects($self, 'contributor');
}
sub gather_all_thanks
{
require RDF::DOAP::Utils;
my $self = shift;
RDF::DOAP::Utils::gather_objects($self, 'thanks');
}
sub sorted_releases
{
my $self = shift;
my @rels = sort {
($a->revision and $b->revision and version->parse($a->revision) cmp version->parse($b->revision)) or
($a->issued and $b->issued and $a->issued cmp $b->issued) or
($a->rdf_about and $b->rdf_about and $a->rdf_about->as_ntriples cmp $b->rdf_about->as_ntriples)
} @{$self->release};
return \@rels;
}
sub changelog
{
my $self = shift;
return join "\n",
$self->_changelog_header,
map($_->changelog_section, reverse @{ $self->sorted_releases });
}
sub _changelog_header
{
my $self = shift;
my @lines = (
$self->name,
("=" x length($self->name)),
"",
);
push @lines, sprintf('%-14s%s', "$_->[0]:", $_->[1])
for grep defined($_->[1]), (
["Created" => $self->created],
map(["Home page"=>$_], @{$self->homepage||[]}),
["Bug tracker" => $self->bug_database],
["Wiki" => $self->wiki],
["Mailing list" => $self->mailing_list],
map(["Maintainer"=>$_->to_string], @{$self->maintainer||[]}),
);
return join("\n", @lines)."\n";
}
1;
|