[libmodule-package-rdf-perl] 21/64: add standard documents functionality
Jonas Smedegaard
js at alioth.debian.org
Fri Aug 9 22:11:54 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 effc5103488b4e8d205287bedd59aece37c7c423
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date: Mon Jul 23 15:41:09 2012 +0100
add standard documents functionality
--HG--
branch : Module-Package-RDF
---
Makefile.PL | 2 +-
lib/App/mkdist.pm | 2 +-
lib/Module/Install/Admin/StandardDocuments.pm | 66 +++++++++++++++++++++++++
lib/Module/Install/StandardDocuments.pm | 21 ++++++++
lib/Module/Package/Dist/RDF.pm | 15 +++++-
lib/Module/Package/RDF.pm | 21 +++++++-
meta/deps.pret | 1 +
7 files changed, 122 insertions(+), 6 deletions(-)
diff --git a/Makefile.PL b/Makefile.PL
index 01e5b33..2e535f2 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1 +1 @@
-use inc::Module::Package 'RDF:standard';
+use inc::Module::Package 'RDF:tobyink 0.009';
diff --git a/lib/App/mkdist.pm b/lib/App/mkdist.pm
index 7266054..ef473d5 100644
--- a/lib/App/mkdist.pm
+++ b/lib/App/mkdist.pm
@@ -4,7 +4,7 @@ use strict;
BEGIN {
$App::mkdist::AUTHORITY = 'cpan:TOBYINK';
- $App::mkdist::VERSION = '0.008';
+ $App::mkdist::VERSION = '0.009';
}
use Carp;
diff --git a/lib/Module/Install/Admin/StandardDocuments.pm b/lib/Module/Install/Admin/StandardDocuments.pm
new file mode 100644
index 0000000..ba5c874
--- /dev/null
+++ b/lib/Module/Install/Admin/StandardDocuments.pm
@@ -0,0 +1,66 @@
+package Module::Install::Admin::StandardDocuments;
+
+use 5.008;
+use strict;
+no warnings;
+
+BEGIN {
+ $Module::Install::Admin::StandardDocuments::AUTHORITY = 'cpan:TOBYINK';
+ $Module::Install::Admin::StandardDocuments::VERSION = '0.009';
+};
+
+use base 'Module::Install::Base';
+our $AUTHOR_ONLY = 1;
+
+use File::HomeDir;
+use IO::All 'io';
+
+sub clone_standard_documents
+{
+ my $self = shift;
+ foreach ($self->_get_standard_documents)
+ {
+ $self->_copy_standard_document($_);
+ }
+ 1;
+}
+
+sub _get_standard_document_library
+{
+ io->catdir(
+ File::HomeDir->my_home,
+ 'perl5',
+ 'standard-documents',
+ );
+}
+
+sub _get_standard_documents
+{
+ my $io = shift->_get_standard_document_library;
+ unless ($io->exists)
+ {
+ warn "$io does not exist!\n";
+ return;
+ }
+ return $io->All_Files;
+}
+
+sub _copy_standard_document
+{
+ my ($self, $doc) = @_;
+
+ my $base = $self->_get_standard_document_library;
+ (my $relative = substr($doc, length $base)) =~ s{^[/\\]}{};
+ $relative = io->file($relative);
+
+ if ($doc->mtime < $relative->mtime)
+ {
+ warn "$relative is newer than $doc!\n";
+ return [];
+ }
+
+ $doc > $relative;
+ ["$relative"];
+}
+
+1;
diff --git a/lib/Module/Install/StandardDocuments.pm b/lib/Module/Install/StandardDocuments.pm
new file mode 100644
index 0000000..f0aa857
--- /dev/null
+++ b/lib/Module/Install/StandardDocuments.pm
@@ -0,0 +1,21 @@
+package Module::Install::StandardDocuments;
+
+use 5.008;
+use strict;
+no warnings;
+
+BEGIN {
+ $Module::Install::StandardDocuments::AUTHORITY = 'cpan:TOBYINK';
+ $Module::Install::StandardDocuments::VERSION = '0.009';
+};
+
+use base 'Module::Install::Base';
+our $AUTHOR_ONLY = 1;
+
+sub clone_standard_documents
+{
+ my $self = shift;
+ $self->admin->clone_standard_documents(@_) if $self->is_admin;
+}
+
+1;
diff --git a/lib/Module/Package/Dist/RDF.pm b/lib/Module/Package/Dist/RDF.pm
index 1b57c04..23f449a 100644
--- a/lib/Module/Package/Dist/RDF.pm
+++ b/lib/Module/Package/Dist/RDF.pm
@@ -10,7 +10,7 @@ use strict;
BEGIN {
$Module::Package::Dist::RDF::AUTHORITY = 'cpan:TOBYINK';
- $Module::Package::Dist::RDF::VERSION = '0.008';
+ $Module::Package::Dist::RDF::VERSION = '0.009';
@Module::Package::Dist::RDF::ISA = 'Module::Package::Dist';
}
@@ -27,9 +27,20 @@ sub _main
use strict;
BEGIN {
$Module::Package::Dist::RDF::standard::AUTHORITY = 'cpan:TOBYINK';
- $Module::Package::Dist::RDF::standard::VERSION = '0.008';
+ $Module::Package::Dist::RDF::standard::VERSION = '0.009';
@Module::Package::Dist::RDF::standard::ISA = 'Module::Package::Dist::RDF';
}
}
+{
+ package Module::Package::Dist::RDF::tobyink;
+ use 5.005;
+ use strict;
+ BEGIN {
+ $Module::Package::Dist::RDF::tobyink::AUTHORITY = 'cpan:TOBYINK';
+ $Module::Package::Dist::RDF::tobyink::VERSION = '0.009';
+ @Module::Package::Dist::RDF::tobyink::ISA = 'Module::Package::Dist::RDF';
+ }
+}
+
1;
diff --git a/lib/Module/Package/RDF.pm b/lib/Module/Package/RDF.pm
index cafa5b4..70bef9d 100644
--- a/lib/Module/Package/RDF.pm
+++ b/lib/Module/Package/RDF.pm
@@ -10,6 +10,7 @@ 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::StandardDocuments 0 ();
use Module::Install::RDF 0.006 ();
use Module::Install::DOAP 0.002 ();
use Module::Install::DOAPChangeSets 0.203 ();
@@ -18,7 +19,7 @@ use Log::Log4perl 0 qw(:easy);
BEGIN {
$Module::Package::RDF::AUTHORITY = 'cpan:TOBYINK';
- $Module::Package::RDF::VERSION = '0.008';
+ $Module::Package::RDF::VERSION = '0.009';
}
use Moo;
@@ -68,8 +69,24 @@ sub write_deps_list {}
use 5.010;
BEGIN {
$Module::Package::RDF::standard::AUTHORITY = 'cpan:TOBYINK';
- $Module::Package::RDF::standard::VERSION = '0.008';
+ $Module::Package::RDF::standard::VERSION = '0.009';
@Module::Package::RDF::standard::ISA = 'Module::Package::RDF';
+ };
+}
+
+{
+ package Module::Package::RDF::tobyink;
+ use 5.010;
+ BEGIN {
+ $Module::Package::RDF::tobyink::AUTHORITY = 'cpan:TOBYINK';
+ $Module::Package::RDF::tobyink::VERSION = '0.009';
+ @Module::Package::RDF::tobyink::ISA = 'Module::Package::RDF';
+ };
+ sub main
+ {
+ my $self = shift;
+ $self->mi->clone_standard_documents;
+ $self->SUPER::main(@_);
}
}
diff --git a/meta/deps.pret b/meta/deps.pret
index 800bb7c..79495b8 100644
--- a/meta/deps.pret
+++ b/meta/deps.pret
@@ -22,6 +22,7 @@
requires p`Test::RDF::DOAP::Version 0.007`;
requires p`Getopt::Long`;
requires p`Getopt::ArgvFile`;
+ requires p`File::HomeDir`;
requires p`URI::file 4.0`;
test_requires p`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