[libmodule-install-doapchangesets-perl] 23/47: 0.202 - minor improvements, including dcs:blame

Jonas Smedegaard js at alioth.debian.org
Fri Aug 9 14:08:41 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libmodule-install-doapchangesets-perl.

commit 030daf8e2de0724e95b7f0fc8731b48cb0e506ca
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date:   Wed Jan 18 14:49:10 2012 +0000

    0.202 - minor improvements, including dcs:blame
    
    --HG--
    branch : Module-Install-DOAPChangeSets
---
 TODO                                       |    2 -
 lib/Module/Install/Admin/DOAPChangeSets.pm |    2 +-
 lib/Module/Install/DOAPChangeSets.pm       |    2 +-
 lib/RDF/DOAP/ChangeSets.pm                 |   73 ++++++++++++++++++++--------
 meta/changes.ttl                           |   12 +++++
 5 files changed, 66 insertions(+), 25 deletions(-)

diff --git a/TODO b/TODO
deleted file mode 100644
index c846af3..0000000
--- a/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-- Write and release Module-Install-RDF
-- Document relationship between that distribution and this one
diff --git a/lib/Module/Install/Admin/DOAPChangeSets.pm b/lib/Module/Install/Admin/DOAPChangeSets.pm
index 737809a..01a8158 100644
--- a/lib/Module/Install/Admin/DOAPChangeSets.pm
+++ b/lib/Module/Install/Admin/DOAPChangeSets.pm
@@ -10,7 +10,7 @@ use File::Slurp qw(slurp);
 use URI::file;
 use Module::Install::Base;
 
-our $VERSION = '0.201';
+our $VERSION = '0.202';
 
 sub _make_dcs
 {
diff --git a/lib/Module/Install/DOAPChangeSets.pm b/lib/Module/Install/DOAPChangeSets.pm
index b252f79..2ff64f4 100644
--- a/lib/Module/Install/DOAPChangeSets.pm
+++ b/lib/Module/Install/DOAPChangeSets.pm
@@ -4,7 +4,7 @@ use 5.008;
 use parent qw(Module::Install::Base);
 use strict;
 
-our $VERSION = '0.201';
+our $VERSION = '0.202';
 our $AUTHOR_ONLY = 1;
 
 sub write_doap_changes {
diff --git a/lib/RDF/DOAP/ChangeSets.pm b/lib/RDF/DOAP/ChangeSets.pm
index d57f71b..e771382 100644
--- a/lib/RDF/DOAP/ChangeSets.pm
+++ b/lib/RDF/DOAP/ChangeSets.pm
@@ -30,7 +30,7 @@ use RDF::Trine;
 use RDF::Query;
 use Text::Wrap;
 
-our $VERSION = '0.201';
+our $VERSION = '0.202';
 
 =head1 DESCRIPTION
 
@@ -232,30 +232,43 @@ sub to_string
 			$rv.= $version->{'revision'};
 			$rv.= sprintf('  %s', $version->{'issued'})
 				if $version->{'issued'};
-			$rv.= sprintf("\n# %s", $version->{'name'})
+			$rv.= sprintf("  # %s", $version->{'name'})
 				if $version->{'name'};
 			$rv.= "\n\n";
 			
-			my @changes = sort {
-				$a->{type} cmp $b->{type} or $a->{label} cmp $b->{label}
-				} values %{$version->{'c'}};
-			
-			# foreach change
-			foreach my $change (@changes)
-			{
-				my $sigil = '';
-				if (defined $change->{'type'} and ref($change->{'type'}) eq 'ARRAY')
+			my @changes = map
 				{
-					$sigil = join ' ',
-						sort
-						map { m!doap.changeset.(.+)$!; $1; }
-						grep { m!doap.changeset.(.+)$! }
-						@{ $change->{'type'} };
-					$sigil = "(${sigil}) " if length $sigil;
+					my $change = $_;
+					
+					my $sigil = '';
+					if (defined $change->{'type'} and ref($change->{'type'}) eq 'ARRAY')
+					{
+						$sigil = join ' ',
+							sort
+							map { m!doap.changeset.(.+)$!; $1; }
+							grep { m!doap.changeset.(.+)$! }
+							@{ $change->{'type'} };
+						$sigil = "(${sigil}) " if length $sigil;
+					}
+					# Bullet point
+					my $ret = wrap(' - ', '   ', sprintf("%s%s", $sigil, $change->{'label'})) . "\n";
+					
+					my %blame = %{ $change->{blame} || {}};
+					foreach $b (values %blame)
+					{
+						if (defined $b->{nick})
+							{ $ret .= sprintf("   ++\$%s\n", $b->{nick}) }
+						elsif (defined $b->{name})
+							{ $ret .= sprintf("   ++\"%s\"\n", $b->{name}) }
+						elsif (defined $b->{uri})
+							{ $ret .= sprintf("   ++q<%s>\n", $b->{uri}) }
+					}
+					
+					$ret;
 				}
-				# Bullet point
-				$rv.= wrap(' - ', '   ', sprintf("%s%s", $sigil, $change->{'label'})) . "\n";
-			}
+				values %{$version->{'c'}};
+			
+			$rv.= join q{}, sort @changes;
 			$rv.= "\n";
 		}
 		
@@ -489,6 +502,12 @@ sub _release_data__current
 			?version dcs:changeset [ dcs:item ?item ] .
 			OPTIONAL { ?item a ?itemtype . }
 			OPTIONAL { ?item rdfs:label ?itemlabel . }
+			OPTIONAL {
+				?item dcs:blame ?blame .
+				OPTIONAL { ?blame foaf:nick ?blamenick . }
+				OPTIONAL { ?blame foaf:name ?blamename . }
+				OPTIONAL { ?blame rdfs:label ?blamename . }
+			}
 		}
 	}
 	";
@@ -515,7 +534,18 @@ sub _release_data__current
 			push @{ $projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'type'} }, $row->{'itemtype'}->uri
 				if UNIVERSAL::isa($row->{'itemtype'}, 'RDF::Trine::Node::Resource')
 				and $row->{'itemtype'}->uri ne 'http://ontologi.es/doap-changeset#Change';
-		}
+			$projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'blame'} = {};
+			
+			if (UNIVERSAL::isa($row->{'blame'}, 'RDF::Trine::Node'))
+			{
+				my $b = $row->{'blame'}->as_ntriples;
+				$projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'blame'}->{$b} = {
+						uri  => $row->{'blame'}->is_resource ? $row->{'blame'}->uri : undef,
+						name => $row->{'blamename'}&&$row->{'blamename'}->is_literal ? $row->{'blamename'}->literal_value : undef,
+						nick => $row->{'blamenick'}&&$row->{'blamenick'}->is_literal ? $row->{'blamenick'}->literal_value : undef,
+					};
+			}
+		}		
 	}
 }
 
@@ -562,6 +592,7 @@ sub _release_data__legacy
 			my $c = $row->{'itemlabel'}->as_ntriples;
 			$projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'label'} = $row->{'itemlabel'}->literal_value
 				if UNIVERSAL::isa($row->{'itemlabel'}, 'RDF::Trine::Node::Literal');
+			$projects->{$p}->{'v'}->{$v}->{'c'}->{$c}->{'blame'} = {};
 				
 			if (UNIVERSAL::isa($row->{'itemtype'}, 'RDF::Trine::Node::Resource'))
 			{
diff --git a/meta/changes.ttl b/meta/changes.ttl
index 19f1461..617592d 100644
--- a/meta/changes.ttl
+++ b/meta/changes.ttl
@@ -171,3 +171,15 @@ my:v_0-201
 		dcs:versus my:v_0-200 ;
 		dcs:item   [ a dcs:Packaging ; rdfs:label "Upgrade Module::Package::RDF version."@en ] 
 	] .
+
+my:project :release my:v_0-202 .
+my:v_0-202
+	a               :Version ;
+	dc:issued       "2012-01-18"^^xsd:date ;
+	:revision       "0.202"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/Module-Install-DOAPChangeSets-0.202.tar.gz> ;
+	dcs:changeset [
+		dcs:versus my:v_0-201 ;
+		dcs:item   [ a dcs:Addition ; rdfs:label "Support 'dcs:blame'."@en ] ;
+		dcs:item   [ rdfs:label "Improved sort order of change items within each version."@en ]
+	] .

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmodule-install-doapchangesets-perl.git



More information about the Pkg-perl-cvs-commits mailing list