/usr/share/perl5/RDF/DOAP/Change.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 | package RDF::DOAP::Change;
our $AUTHORITY = 'cpan:TOBYINK';
our $VERSION = '0.100';
use Moose;
extends qw(RDF::DOAP::Resource);
use RDF::DOAP::Person;
use RDF::DOAP::Types -types;
use RDF::DOAP::Utils -traits;
use List::Util qw(uniq);
use Text::Wrap qw(wrap);
use RDF::Trine::Namespace qw(rdf rdfs owl xsd);
my $doap = 'RDF::Trine::Namespace'->new('http://usefulinc.com/ns/doap#');
my $dc = 'RDF::Trine::Namespace'->new('http://purl.org/dc/terms/');
my $dcs = 'RDF::Trine::Namespace'->new('http://ontologi.es/doap-changeset#');
has blame => (
traits => [ WithURI, Gathering ],
is => 'ro',
isa => ArrayRef[Person],
coerce => 1,
uri => $dcs->blame,
multi => 1,
gather_as => ['contributor'],
);
has thanks => (
traits => [ WithURI, Gathering ],
is => 'ro',
isa => ArrayRef[Person],
coerce => 1,
uri => $dcs->thanks,
multi => 1,
gather_as => ['thanks'],
);
our %ROLES = (
$dcs->Addition => 'RDF::DOAP::Change::Addition',
$dcs->Removal => 'RDF::DOAP::Change::Removal',
$dcs->Bugfix => 'RDF::DOAP::Change::Bugfix',
$dcs->Update => 'RDF::DOAP::Change::Update',
$dcs->Regression => 'RDF::DOAP::Change::Regression',
$dcs->Documentation => 'RDF::DOAP::Change::Documentation',
$dcs->Packaging => 'RDF::DOAP::Change::Packaging',
$dcs->SecurityFix => 'RDF::DOAP::Change::SecurityFix',
$dcs->SecurityRegression => 'RDF::DOAP::Change::SecurityRegression',
);
sub BUILD
{
my $self = shift;
my @roles = grep defined, map $ROLES{$_}, @{ $self->rdf_type || [] };
push @roles, $ROLES{$dcs->Bugfix}
if $self->has_rdf_about
&& $self->has_rdf_model
&& $self->rdf_model->count_statements($self->rdf_about, $dcs->fixes, undef);
$self->Moose::Util::apply_all_roles(uniq @roles) if @roles;
}
sub changelog_entry
{
my $self = shift;
my $text = join "\n", $self->changelog_lines;
wrap(" - ", " ", $text);
}
sub changelog_lines
{
my $self = shift;
my ($notype) = @_;
my @lines;
if ($notype)
{
@lines = $self->label;
}
else
{
my @type = sort map $_->uri =~ m{(\w+)$}, @{ $self->rdf_type };
@lines = "(@type) " . $self->label;
}
for my $person (uniq sort @{$self->blame||[]}, @{$self->thanks||[]})
{
push @lines, sprintf("%s++", $person->to_string('compact'));
}
push @lines, $self->changelog_links;
return @lines;
}
sub changelog_links
{
my $self = shift;
return @{ $self->see_also || [] };
}
1;
|