[libmodule-package-rdf-perl] 08/64: Misc mini improvements; use Pretdsl

Jonas Smedegaard js at alioth.debian.org
Fri Aug 9 22:11:51 UTC 2013


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

js pushed a commit to branch master
in repository libmodule-package-rdf-perl.

commit 3449ee95eed3dd49d052243694e51b4270e2a7fa
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date:   Wed Jul 4 22:11:59 2012 +0100

    Misc mini improvements; use Pretdsl
    
    --HG--
    branch : Module-Package-RDF
---
 lib/Module/Package/Dist/RDF.pm   |   24 +++++++-----
 lib/Module/Package/RDF.pm        |   36 ++++++++++-------
 lib/Module/Package/RDF/Create.pm |   80 +++++++++++++++-----------------------
 meta/deps.ttl                    |   53 +++++++++++++------------
 4 files changed, 93 insertions(+), 100 deletions(-)

diff --git a/lib/Module/Package/Dist/RDF.pm b/lib/Module/Package/Dist/RDF.pm
index 3f64834..7e15a5b 100644
--- a/lib/Module/Package/Dist/RDF.pm
+++ b/lib/Module/Package/Dist/RDF.pm
@@ -1,21 +1,14 @@
 package Module::Package::Dist::RDF;
 
 use 5.008003;
+use base qw[Module::Package::Dist];
+use strict;
+
 BEGIN {
 	$Module::Package::Dist::RDF::AUTHORITY = 'cpan:TOBYINK';
 	$Module::Package::Dist::RDF::VERSION   = '0.005';
 }
 
-package Module::Package::Dist::RDF::standard;
-
-use 5.008003;
-use strict;
-use base qw[Module::Package::Dist];
-BEGIN {
-	$Module::Package::Dist::RDF::standard::AUTHORITY = 'cpan:TOBYINK';
-	$Module::Package::Dist::RDF::standard::VERSION   = '0.005';
-}
-
 sub _main
 {
 	my ($self) = @_;
@@ -23,4 +16,15 @@ sub _main
 	$self->mi->auto_install;
 }
 
+{
+	package Module::Package::Dist::RDF::standard;
+	use 5.008003;
+	use strict;
+	BEGIN {
+		$Module::Package::Dist::RDF::standard::AUTHORITY = 'cpan:TOBYINK';
+		$Module::Package::Dist::RDF::standard::VERSION   = '0.005';
+		@Module::Package::Dist::RDF::standard::ISA       = 'Module::Package::Dist::RDF';
+	}
+}
+
 1;
diff --git a/lib/Module/Package/RDF.pm b/lib/Module/Package/RDF.pm
index f32422d..03d4521 100644
--- a/lib/Module/Package/RDF.pm
+++ b/lib/Module/Package/RDF.pm
@@ -1,31 +1,24 @@
 package Module::Package::RDF;
 
 use 5.008003;
-BEGIN {
-	$Module::Package::RDF::AUTHORITY = 'cpan:TOBYINK';
-	$Module::Package::RDF::VERSION   = '0.005';
-}
-
-package Module::Package::RDF::standard;
-
-use 5.008003;
 use strict;
 
-use RDF::Trine 0.133 ();
+use RDF::Trine 0.135 ();
+use RDF::TriN3 0.200 ();
 use Module::Package 0.30 ();
 use Module::Install::AutoInstall 0 ();
 use Module::Install::AutoLicense 0.08 ();
 use Module::Install::AutoManifest 0 ();
 use Module::Install::ReadmeFromPod 0.12 ();
-use Module::Install::RDF 0.002 ();
+use Module::Install::RDF 0.006 ();
 use Module::Install::DOAP 0.002 ();
-use Module::Install::DOAPChangeSets 0.201 ();
+use Module::Install::DOAPChangeSets 0.203 ();
 use Module::Install::TrustMetaYml 0.001 ();
 use Log::Log4perl 0 qw(:easy);
 
 BEGIN {
-        $Module::Package::RDF::standard::AUTHORITY = 'cpan:TOBYINK';
-        $Module::Package::RDF::standard::VERSION   = '0.005';
+	$Module::Package::RDF::AUTHORITY = 'cpan:TOBYINK';
+	$Module::Package::RDF::VERSION   = '0.005';
 }
 
 use Moo;
@@ -70,6 +63,16 @@ sub all_from
 
 sub write_deps_list {}
 
+{
+	package Module::Package::RDF::standard;
+	use 5.008003;
+	BEGIN {
+		$Module::Package::RDF::standard::AUTHORITY = 'cpan:TOBYINK';
+		$Module::Package::RDF::standard::VERSION   = '0.005';
+		@Module::Package::RDF::standard::ISA       = 'Module::Package::RDF';
+	}
+}
+
 __END__
 
 =head1 NAME
@@ -80,7 +83,7 @@ Module::Package::RDF - drive your distribution with RDF
 
 In your Makefile.PL:
 
-  use inc::Module::Package 'RDF:standard';
+  use inc::Module::Package 'RDF';
 
 That's all folks!
 
@@ -94,6 +97,11 @@ Currently this module only defines the C<:standard> flavour.
 
 =head2 :standard
 
+This is the default, so the following are equivalent:
+
+  use inc::Module::Package 'RDF';
+  use inc::Module::Package 'RDF:standard';
+
 In addition to the inherited behavior, this flavour uses the following plugins:
 
 =over
diff --git a/lib/Module/Package/RDF/Create.pm b/lib/Module/Package/RDF/Create.pm
index af774a0..84c36a2 100644
--- a/lib/Module/Package/RDF/Create.pm
+++ b/lib/Module/Package/RDF/Create.pm
@@ -1,6 +1,6 @@
 package Module::Package::RDF::Create;
 
-use common::sense;
+use strict;
 
 BEGIN {
 	$Module::Package::RDF::Create::AUTHORITY = 'cpan:TOBYINK';
@@ -50,7 +50,7 @@ sub _fill_in_template
 	my ($self, $template) = @_;
 	$template = $self->_get_template($template) unless ref $template;
 	
-	my %hash;
+	my %hash = ( mpr_version => $Module::Package::RDF::VERSION );
 	while (my ($k, $v) = each %$self)
 	{
 		$hash{$k} = ref $v ? \$v : $v;
@@ -157,7 +157,7 @@ sub set_defaults
 		if (@mr)
 		{
 			$self->{requires} = sprintf(";\n\t:requires %s",
-				(join ' , ', (map { my ($pkg, $ver) = split /\s+/, $_; ($ver =~ /^v?[0-9\._]+/) ? "\"$pkg $ver\"" : "\"$pkg\"" } @mr))
+				(join ' , ', (map { my ($pkg, $ver) = split /\s+/, $_; ($ver =~ /^v?[0-9\._]+/) ? "p`$pkg $ver`" : "p`$pkg`" } @mr))
 				);
 		}
 		else
@@ -351,62 +351,45 @@ WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 COMMENCE Makefile.PL
-use inc::Module::Package 'RDF:standard';
+use inc::Module::Package 'RDF {$mpr_version}';
 
-COMMENCE meta/changes.ttl
+COMMENCE meta/changes.pret
 # This file acts as the project's changelog.
 
- at prefix :        <http://usefulinc.com/ns/doap#> .
- at prefix dcs:     <http://ontologi.es/doap-changeset#> .
- at prefix dc:      <http://purl.org/dc/terms/> .
- at prefix dist:    <http://purl.org/NET/cpan-uri/dist/{URI::Escape::uri_escape($dist_name)}/> .
- at prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
- at prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
-
-dist:project :release dist:{$version_ident} .
-dist:{$version_ident}
-	a               :Version ;
-	dc:issued       "{DateTime->now->ymd('-')}"^^xsd:date ;
-	:revision       "{$version}"^^xsd:string ;
-	:file-release   <{$backpan}{URI::Escape::uri_escape($dist_name)}-{$version}.tar.gz> ;
-	rdfs:label      "Initial release" .
-
-COMMENCE meta/doap.ttl
+`{$dist_name} {$version} cpan:{uc $author->{cpanid}}`
+	issued  {DateTime->now->ymd('-')};
+	label   "Initial release".
+
+COMMENCE meta/doap.pret
 # This file contains general metadata about the project.
 
- at prefix :        <http://usefulinc.com/ns/doap#> .
- at prefix dc:      <http://purl.org/dc/terms/> .
- at prefix foaf:    <http://xmlns.com/foaf/0.1/> .
- at prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
- at prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
+ at prefix : <http://usefulinc.com/ns/doap#>.
 
-<http://purl.org/NET/cpan-uri/dist/{URI::Escape::uri_escape($dist_name)}/project>
-	a               :Project ;
+`{$dist_name}`
 	:programming-language "Perl" ;
-	:name           "{$dist_name}" ;
-	:shortdesc      "{$abstract}" ;
-	:homepage       <https://metacpan.org/release/{URI::Escape::uri_escape($dist_name)}> ;
-	:download-page  <https://metacpan.org/release/{URI::Escape::uri_escape($dist_name)}> ;
-	:bug-database   <http://rt.cpan.org/Dist/Display.html?Queue={URI::Escape::uri_escape($dist_name)}> ;
-	:created        "{DateTime->now->ymd('-')}"^^xsd:date ;
-	:license        <{$licence->url}> ;
-	:developer      [ a foaf:Person ; foaf:name "{$author->{name}}" ; foaf:mbox <mailto:{$author->{mbox}}> ] .
+	:shortdesc            "{$abstract}";
+	:homepage             <https://metacpan.org/release/{URI::Escape::uri_escape($dist_name)}>;
+	:download-page        <https://metacpan.org/release/{URI::Escape::uri_escape($dist_name)}>;
+	:bug-database         <http://rt.cpan.org/Dist/Display.html?Queue={URI::Escape::uri_escape($dist_name)}>;
+	:created              {DateTime->now->ymd('-')};
+	:license              <{$licence->url}> ;
+	:developer            cpan:{uc $author->{cpanid}}
 
 <{$licence->url}>
-	dc:title        "{$licence->name}" .
-
-COMMENCE meta/makefile.ttl
-# This file provides instructions for packaging.
+	dc:title  "{$licence->name}".
 
- at prefix : <http://purl.org/NET/cpan-uri/terms#> .
+cpan:{uc $author->{cpanid}}
+	foaf:name  "{$author->{name}}";
+	foaf:mbox  <mailto:{$author->{mbox}}>.
 
-<http://purl.org/NET/cpan-uri/dist/{URI::Escape::uri_escape($dist_name)}/project>
-	:perl_version_from _:main ;
-	:version_from _:main ;
-	:readme_from _:main ;
-	:test_requires "Test::More 0.61" {$requires} .
+COMMENCE meta/makefile.pret
+# This file provides instructions for packaging.
 
-_:main <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#fileName> "{$module_filename}" .
+`{$dist_name}`
+	perl_version_from m`{$module_name}`;
+	version_from      m`{$module_name}`;
+	readme_from       m`{$module_name}`;
+	test_requires     p`Test::More 0.61` {$requires} .
 
 COMMENCE t/01basic.t
 use Test::More tests => 1;
@@ -423,8 +406,7 @@ use Test::More;
 use Test::Pod::Coverage;
 
 my @modules = qw({$module_name});
-pod_coverage_ok($_, "$_ is covered")
-	foreach @modules;
+pod_coverage_ok($_, "$_ is covered") for @modules;
 done_testing(scalar @modules);
 
 COMMENCE xt/03meta_uptodate.t
diff --git a/meta/deps.ttl b/meta/deps.ttl
index a13513a..0b89829 100644
--- a/meta/deps.ttl
+++ b/meta/deps.ttl
@@ -1,30 +1,29 @@
 @prefix : <http://purl.org/NET/cpan-uri/terms#> .
 
 <http://purl.org/NET/cpan-uri/dist/Module-Package-RDF/project>
-	:requires
-		"Module::Package 0.30" ,
-		"Module::Install 1.04" ,
-		"Module::Install::RDF 0.004" ,
-		"Module::Install::DOAP 0.004" ,
-		"Module::Install::DOAPChangeSets 0.201" ,
-		"Module::Install::AutoLicense 0.08" ,
-		"Module::Install::ReadmeFromPod 0.12" ,
-		"Module::Install::AutoManifest" ,
-		"Module::Install::TrustMetaYml 0.001" ,
-		"Module::Install::AutoInstall 0" ,
-		"RDF::Trine 0.133" ,
-		"Log::Log4perl" ,
-		"URI::Escape",
-		"Software::License",
-		"Carp",
-		"IO::All",
-		"Text::Template",
-		"DateTime",
-		"Test::Pod",
-		"Test::Pod::Coverage",
-		"Test::RDF::DOAP::Version",
-		"Getopt::Long" ,
-		"Getopt::ArgvFile" ,
-		"URI::file 4.0" ;
-	:test_requires
-		"Test::More 0.61" .
+	:requires "Module::Package 0.30" ;
+	:requires "Module::Install 1.04" ;
+	:requires "Module::Install::RDF 0.006" ;
+	:requires "Module::Install::DOAP 0.004" ;
+	:requires "Module::Install::DOAPChangeSets 0.203" ;
+	:requires "Module::Install::AutoLicense 0.08" ;
+	:requires "Module::Install::ReadmeFromPod 0.12" ;
+	:requires "Module::Install::AutoManifest" ;
+	:requires "Module::Install::TrustMetaYml 0.001" ;
+	:requires "Module::Install::AutoInstall 0" ;
+	:requires "RDF::Trine 0.135" ;
+	:requires "RDF::TriN3 0.200" ;
+	:requires "Log::Log4perl" ;
+	:requires "URI::Escape";
+	:requires "Software::License";
+	:requires "IO::All";
+	:requires "Text::Template";
+	:requires "DateTime";
+	:requires "Test::Pod";
+	:requires "Test::Pod::Coverage";
+	:requires "Test::RDF::DOAP::Version";
+	:requires "Getopt::Long" ;
+	:requires "Getopt::ArgvFile" ;
+	:requires "URI::file 4.0" ;
+	:test_requires "Test::More 0.61" ;
+	.

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



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