~ubuntu-branches/ubuntu/wily/libmodule-install-doapchangesets-perl/wily

« back to all changes in this revision

Viewing changes to lib/RDF/DOAP/ChangeSets.pm

  • Committer: Package Import Robot
  • Author(s): Jonas Smedegaard, upstream, Salvatore Bonaccorso, Jonas Smedegaard
  • Date: 2013-07-16 16:23:02 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130716162302-luo7o2atty26gxpc
Tags: 0.205-1
[ upstream ]
* New release.
  + Support 'dcs:fixes'.

[ Salvatore Bonaccorso ]
* Use canonical hostname (anonscm.debian.org) in Vcs-Git URI.

[ Jonas Smedegaard ]
* Add README.source emphasizing control.in file as *not* a
  show-stopper for contributions, referring to wiki page for details.
* Stop track upstream prereleases.
* Drop patch 1001: Build problem turned out to be (and fixed by now)
  in CDBS.
* Bump packaging license to GPL-3+, and extend copyrigt coverage for
  myself to include current year.
* (Build-)depend on liblist-moreutils-perl.
* Update copyright coverage for convenience code copies and main
  upstream author.
* Bump standards-version to 3.9.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
use RDF::Trine;
10
10
use RDF::Query;
11
11
use Text::Wrap;
 
12
use List::MoreUtils qw(uniq);
12
13
 
13
 
our $VERSION = '0.203';
 
14
our $VERSION = '0.205';
14
15
 
15
16
sub new
16
17
{
162
163
                                        if (defined $change->{'type'} and ref($change->{'type'}) eq 'ARRAY')
163
164
                                        {
164
165
                                                $sigil = join ' ',
 
166
                                                        uniq
165
167
                                                        sort
166
168
                                                        map { m!doap.changeset.(.+)$!; $1; }
167
169
                                                        grep { m!doap.changeset.(.+)$! }
171
173
                                        # Bullet point
172
174
                                        my $ret = wrap(' - ', '   ', sprintf("%s%s", $sigil, $change->{'label'})) . "\n";
173
175
                                        
 
176
                                        for (sort keys %{ $change->{issue} || {}})
 
177
                                        {
 
178
                                                m{^http://purl\.org/NET/cpan-uri/rt/ticket/([0-9]+)$}
 
179
                                                        ? ($ret .= sprintf("   Fixes RT#%s\n", $1)) :
 
180
                                                m{^(?:tdb:.*)https://rt\.cpan\.org/Ticket/Display\.html\?id=([0-9]+)$}
 
181
                                                        ? ($ret .= sprintf("   Fixes RT#%s\n", $1)) :
 
182
                                                m{^(?:tdb:.*)https://github.com/.*/issues/([0-9]+)$}
 
183
                                                        ? ($ret .= sprintf("   Fixes GH#%s\n", $1)) :
 
184
                                                ();
 
185
                                        }
 
186
                                        
174
187
                                        my %blame = %{ $change->{blame} || {}};
175
188
                                        foreach $b (values %blame)
176
189
                                        {
397
410
        my $projects = $self->{'projects'};
398
411
        
399
412
        my $sparql = "
 
413
        PREFIX dbug: <http://ontologi.es/doap-bugs#>
400
414
        PREFIX dc: <http://purl.org/dc/terms/>
401
415
        PREFIX dcs: <http://ontologi.es/doap-changeset#>
402
416
        PREFIX doap: <http://usefulinc.com/ns/doap#>
420
434
                                OPTIONAL { ?blame foaf:name ?blamename . }
421
435
                                OPTIONAL { ?blame rdfs:label ?blamename . }
422
436
                        }
 
437
                        OPTIONAL { ?item dcs:fixes ?issue . }
423
438
                }
424
439
        }
425
440
        ";
448
463
                                and $row->{'itemtype'}->uri ne 'http://ontologi.es/doap-changeset#Change';
449
464
                        $projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'blame'} = {};
450
465
                        
 
466
                        if (UNIVERSAL::isa($row->{'issue'}, 'RDF::Trine::Node::Resource'))
 
467
                        {
 
468
                                $projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'issue'}->{ $row->{'issue'}->uri }++;
 
469
                                push @{ $projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'type'} },
 
470
                                        q[http://ontologi.es/doap-changeset#Bugfix];
 
471
                        }
 
472
                
451
473
                        if (UNIVERSAL::isa($row->{'blame'}, 'RDF::Trine::Node'))
452
474
                        {
453
475
                                my $b = $row->{'blame'}->as_ntriples;