Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- prepan_url -> prepan and the method now takes a hash

- use $meta.resources.X_prepan instead of $meta.resources.PrePAN
  • Loading branch information...
commit 6d9c6cc1b4c0e55b167883808b66d8b7132cf695 1 parent ba4a337
@kentaro authored
View
12 Changes
@@ -1,4 +1,12 @@
Revision history for Perl extension Module::Install::PrePAN
-0.01 Wed Nov 9 17:50:43 2011
- - original version
+0.02 2011-11-10
+
+ [API CHANGE]
+ - prepan_url -> prepan and the method now takes a hash
+
+ [INTENAL CHANGE]
+ - use $meta.resources.X_prepan instead of $meta.resources.PrePAN
+
+0.01 2011-11-09
+ - original version
View
2  MANIFEST
@@ -19,7 +19,7 @@ META.yml
README
README.pod
t/00_compile.t
-t/01_basic.t
+t/01_prepan.t
xt/01_podspell.t
xt/02_perlcritic.t
xt/03_pod.t
View
4 Makefile.PL
@@ -9,7 +9,9 @@ name 'Module-Install-PrePAN';
all_from 'lib/Module/Install/PrePAN.pm';
readme_from 'lib/Module/Install/PrePAN.pm';
-prepan_url 'http://prepan.org/module/3Yz7PYrBJG';
+prepan module_url => 'http://prepan.org/module/3Yz7PYrBJG',
+ author_url => 'http://prepan.org/user/3XR97nG2Gi';
+
auto_set_repository;
tests 't/*.t';
View
41 lib/Module/Install/PrePAN.pm
@@ -8,10 +8,16 @@ our $VERSION = '0.01';
use base qw(Module::Install::Base);
-sub prepan_url {
- my ($self, $url) = @_;
- Carp::croak 'missing parameter: $url' if !defined $url;
- $self->resources(PrePAN => $url);
+my %SCHEMA = (
+ module_url => 1,
+ author_url => 1,
+);
+
+sub prepan {
+ my ($self, %args) = @_;
+ my @invalid_keys = grep { !$SCHEMA{$_} } keys %args;
+ Carp::croak "invalid keys: " . join ', ', @invalid_keys if @invalid_keys;
+ $self->resources(X_prepan => \%args);
}
!!1;
@@ -22,17 +28,36 @@ __END__
=head1 NAME
-Module::Install::PrePAN - Designate a URL of PrePAN page of a module
+Module::Install::PrePAN - Designate resources at PrePAN related to a
+module
=head1 SYNOPSIS
# Makefile.PL
- prepan_url 'http://prepan.org/module/3Yz7PYrBJG';
+ prepan module_url => 'http://prepan.org/module/3Yz7PYrBJG',
+ author_url => 'http://prepan.org/user/3XR97nG2Gi';
=head1 DESCRIPTION
-Module::Install::PrePAN is a Module::Install extension to designate a
-URL of PrePan page where you requested reviews for your module.
+Module::Install::PrePAN is a Module::Install extension to designate
+some resources at PrePAN, social reviewing site for Perl modules
+(L<http://prepan.org/>).
+
+=head1 METHODS
+
+=head2 prepan ( I<%args> )
+
+Adds resources at PrePAN passed in as C<%args> under
+$meta.resources.X_prepan.
+
+CPAN META Spec version 1.4 specifies that unofficial keys under
+$meta.resource must include at least one upper-case letter but version
+2 doesn't. Besides, ver.2 formalized all custom keys not listed in the
+official spec use "x_" or "X_". Ver.2 has been a draft yet so that
+toolchains haven't supported the new spec around $meta.resources. See
+L<CPAN::Meta::Spec> and L<CPAN::Meta::History> for details.
+
+This module uses the key "X_prepan" because of that.
=head1 AUTHOR
View
9 t/01_basic.t
@@ -1,9 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-
-subtest 'pass' => sub {
- pass;
-};
-
-done_testing;
View
12 t/01_prepan.t
@@ -0,0 +1,12 @@
+use strict;
+use warnings;
+use Test::More;
+use Test::Fatal;
+
+use Module::Install::PrePAN;
+
+subtest 'prepan' => sub {
+ pass;
+};
+
+done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.