Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

init

  • Loading branch information...
commit 6aad3aa1d0eb95b72c604b08117975ffefad6eea 0 parents
@miyagawa authored
6 .gitignore
@@ -0,0 +1,6 @@
+MYMETA.*
+META.yml
+Makefile
+inc/
+pm_to_blib
+*~
2  .shipit
@@ -0,0 +1,2 @@
+steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN
+git.push_to = origin
4 Changes
@@ -0,0 +1,4 @@
+Revision history for Perl extension Module::Install::CPANfile
+
+0.01 Thu Apr 12 19:46:19 2012
+ - original version
19 MANIFEST
@@ -0,0 +1,19 @@
+.gitignore
+Changes
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/ReadmeFromPod.pm
+inc/Module/Install/Repository.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+lib/Module/Install/CPANfile.pm
+Makefile.PL
+MANIFEST This list of files
+META.yml
+README
+t/00_compile.t
+xt/pod.t
15 MANIFEST.SKIP
@@ -0,0 +1,15 @@
+\bRCS\b
+\bCVS\b
+\.svn/
+\.git/
+^MANIFEST\.
+^Makefile$
+~$
+\.old$
+^blib/
+^pm_to_blib
+^MakeMaker-\d
+\.gz$
+\.cvsignore
+\.shipit
+MYMETA
10 Makefile.PL
@@ -0,0 +1,10 @@
+use lib 'lib'; # bootstrap
+use inc::Module::Install;
+all_from 'lib/Module/Install/CPANfile.pm';
+readme_from('lib/Module/Install/CPANfile.pm');
+build_requires 'Test::More', 0.88;
+test_requires 'Test::Requires';
+auto_set_repository();
+auto_provides;
+cpanfile;
+WriteAll;
20 README
@@ -0,0 +1,20 @@
+NAME
+ Module::Install::CPANfile - Include cpanfile
+
+SYNOPSIS
+ use Module::Install::CPANfile;
+
+DESCRIPTION
+ Module::Install::CPANfile is
+
+AUTHOR
+ Tatsuhiko Miyagawa <miyagawa@bulknews.net>
+
+COPYRIGHT
+ Copyright 2012- Tatsuhiko Miyagawa
+
+LICENSE
+ This library is free software; you can redistribute it and/or modify it
+ under the same terms as Perl itself.
+
+SEE ALSO
3  cpanfile
@@ -0,0 +1,3 @@
+on 'develop' => sub {
+ requires 'Module::CPANfile', '0.9004';
+};
85 lib/Module/Install/CPANfile.pm
@@ -0,0 +1,85 @@
+package Module::Install::CPANfile;
+
+use strict;
+use 5.008_001;
+our $VERSION = '0.01';
+
+use Module::CPANfile;
+use base qw(Module::Install::Base);
+
+sub cpanfile {
+ my $self = shift;
+ $self->include($_) for qw( Module::CPANfile Module::CPANfile::Environment Module::CPANfile::Result );
+
+ my $specs = Module::CPANfile->load->prereq_specs;
+
+ while (my($phase, $requirements) = each %$specs) {
+ while (my($type, $requirement) = each %$requirements) {
+ if (my $command = $self->command_for($phase, $type)) {
+ while (my($mod, $ver) = each %$requirement) {
+ $self->$command($mod, $ver);
+ }
+ }
+ }
+ }
+}
+
+sub command_for {
+ my($self, $phase, $type) = @_;
+
+ if ($type eq 'conflicts') {
+ warn 'conflicts is not supported';
+ return;
+ }
+
+ if ($phase eq 'develop') {
+ if ($INC{"Module/Install/AuthorRequires.pm"}) {
+ return 'author_requires';
+ } else {
+ warn "develop phase is ignored unless Module::Install::AuthorRequires is loaded";
+ return;
+ }
+ }
+
+ if ($type eq 'recommends' or $type eq 'suggests') {
+ return 'recommends';
+ }
+
+ return "${phase}_requires";
+}
+
+1;
+__END__
+
+=encoding utf-8
+
+=for stopwords
+
+=head1 NAME
+
+Module::Install::CPANfile - Include cpanfile
+
+=head1 SYNOPSIS
+
+ use Module::Install::CPANfile;
+
+=head1 DESCRIPTION
+
+Module::Install::CPANfile is
+
+=head1 AUTHOR
+
+Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt>
+
+=head1 COPYRIGHT
+
+Copyright 2012- Tatsuhiko Miyagawa
+
+=head1 LICENSE
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+=cut
4 t/00_compile.t
@@ -0,0 +1,4 @@
+use strict;
+use Test::More tests => 1;
+
+BEGIN { use_ok 'Module::Install::CPANfile' }
4 xt/pod.t
@@ -0,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
Please sign in to comment.
Something went wrong with that request. Please try again.