| 1 | package Perl::Maker; | ||||||||||||
| 2 | 1 | ▶ | use 5.008003; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use Mouse; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use YAML::XS; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use File::ShareDir; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use Getopt::Long; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 1 | ▶ | use IPC::Run; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 1 | $Perl::Maker::VERSION = '0.01'; | |||||||||||
| 11 | |||||||||||||
| 12 | 1 | has action => (is => 'ro'); | |||||||||||
| 13 | 0 | ▶ | has args => (is => 'ro', default => sub {[]}); | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||
| 14 | 1 | has file => (is => 'ro'); | |||||||||||
| 15 | |||||||||||||
| 16 | 0 | ▶ | around BUILDARGS => sub { | ||||||||||
|
Subroutine
__ANON__: not called CC=5 SCAR=34.0
| |||||||||||||
| 17 | 0 | my ($orig, $class, $script, @args) = @_; | |||||||||||
| 18 | 0 | my $hash = {}; | |||||||||||
| 19 | |||||||||||||
| 20 | 0 | while (1) { | |||||||||||
| 21 | 0 | ▶ | if (not @args) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 22 | 0 | $hash->{action} = 'help'; | |||||||||||
| 23 | 0 | last; | |||||||||||
| 24 | } | ||||||||||||
| 25 | 0 | ▶ | if ($args[0] !~ /^-/) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | 0 | $hash->{action} = shift(@args); | |||||||||||
| 27 | 0 | last; | |||||||||||
| 28 | } | ||||||||||||
| 29 | 0 | local @ARGV = @args; | |||||||||||
| 30 | 0 | GetOptions( | |||||||||||
| 31 | |||||||||||||
| 32 | ); | ||||||||||||
| 33 | 0 | @args = @ARGV; | |||||||||||
| 34 | } | ||||||||||||
| 35 | 0 | ▶ | $hash->{file} = shift(@args) || ''; | ||||||||||
|
Condition0%0/2
shift @args || ''
MC/DC0%0/1
shift @args || ''
shift @args
Truth table0%0/2
A
A= shift @args
| |||||||||||||
| 36 | 0 | ▶ | die "Extra arguments '@args'\n" if @args; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 37 | |||||||||||||
| 38 | 0 | $class->$orig($hash); | |||||||||||
| 39 | 1 | }; | |||||||||||
| 40 | |||||||||||||
| 41 | 0 | ▶ | sub run { | ||||||||||
|
Subroutine
run: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 42 | 0 | my $self = shift; | |||||||||||
| 43 | 0 | my $action = $self->action; | |||||||||||
| 44 | 0 | my $method = "handle_$action"; | |||||||||||
| 45 | 0 | ▶ | die "'action' command not supported\n" | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 46 | unless $self->can($method); | ||||||||||||
| 47 | 0 | $self->$method(@{$self->args}); | |||||||||||
| 48 | } | ||||||||||||
| 49 | |||||||||||||
| 50 | 0 | ▶ | sub handle_new { | ||||||||||
|
Subroutine
handle_new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 51 | 0 | my $self = shift; | |||||||||||
| 52 | } | ||||||||||||
| 53 | |||||||||||||
| 54 | 0 | ▶ | sub handle_make { | ||||||||||
|
Subroutine
handle_make: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 55 | 0 | my $self = shift; | |||||||||||
| 56 | } | ||||||||||||
| 57 | |||||||||||||
| 58 | 0 | ▶ | sub write_makefile { | ||||||||||
|
Subroutine
write_makefile: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 59 | 0 | die "Perl::Maker does not work!\n"; | |||||||||||
| 60 | } | ||||||||||||
| 61 | |||||||||||||
| 62 | 1 | 1; | |||||||||||
| 63 | |||||||||||||
| 64 | =enccoding utf8 | ||||||||||||
| 65 | |||||||||||||
| 66 | =head1 NAME | ||||||||||||
| 67 | |||||||||||||
| 68 | Perl::Maker - Make a Custom Perl with Modules | ||||||||||||
| 69 | |||||||||||||
| 70 | =head1 SYNOPSIS | ||||||||||||
| 71 | |||||||||||||
| 72 | > perl-maker --make ingy-perl-maker.yaml | ||||||||||||
| 73 | > make install | ||||||||||||
| 74 | |||||||||||||
| 75 | > make perlbrew | ||||||||||||
| 76 | > make debian | ||||||||||||
| 77 | > make dmg | ||||||||||||
| 78 | > make rpm | ||||||||||||
| 79 | > make msi | ||||||||||||
| 80 | |||||||||||||
| 81 | =head1 STATUS | ||||||||||||
| 82 | |||||||||||||
| 83 | This software is pre-alpha quality. Don't use it yet. | ||||||||||||
| 84 | |||||||||||||
| 85 | =head1 DESCRIPTION | ||||||||||||
| 86 | |||||||||||||
| 87 | Perl::Maker creates a custom Perl installation, complete with an | ||||||||||||
| 88 | entire set of modules, based on a simple YAML specification. You can | ||||||||||||
| 89 | share the installation as a system package (like Debian for instance). | ||||||||||||
| 90 | You can also share the YAML specification, or use an existing one from | ||||||||||||
| 91 | somebody else. | ||||||||||||
| 92 | |||||||||||||
| 93 | The point of Perl::Maker is to make usable Perl installations that are | ||||||||||||
| 94 | shareable. In many situations (especially in production environments), | ||||||||||||
| 95 | it is critical not just to require that Perl and some modules to be | ||||||||||||
| 96 | installed, but specific versions of things that are configured a | ||||||||||||
| 97 | specific way. | ||||||||||||
| 98 | |||||||||||||
| 99 | With Perl::Maker, you specify all your requirements in a clean and | ||||||||||||
| 100 | simple YAML file. Perl::Maker will turn this into a Makefile. Then you | ||||||||||||
| 101 | simply invoke C<make> to do all the necessary work. Since the Makefile | ||||||||||||
| 102 | targets know all their dependencies, when you make small changes to the | ||||||||||||
| 103 | YAML file, only the minimum work to accomplish your goals will be | ||||||||||||
| 104 | performed. | ||||||||||||
| 105 | |||||||||||||
| 106 | =head1 USAGE | ||||||||||||
| 107 | |||||||||||||
| 108 | Perl::Maker installs a command line tool called C<perl-maker>. This | ||||||||||||
| 109 | section explains the commands you can use. | ||||||||||||
| 110 | |||||||||||||
| 111 | =over | ||||||||||||
| 112 | |||||||||||||
| 113 | =item perl-maker --new filename.yaml | ||||||||||||
| 114 | |||||||||||||
| 115 | This will create a sample Perl::Maker YAML specification for you. | ||||||||||||
| 116 | |||||||||||||
| 117 | =item perl-maker --make filename.yaml | ||||||||||||
| 118 | |||||||||||||
| 119 | This will generate a C<Makefile> from the YAML specification. | ||||||||||||
| 120 | |||||||||||||
| 121 | =back | ||||||||||||
| 122 | |||||||||||||
| 123 | =head1 TARGETS | ||||||||||||
| 124 | |||||||||||||
| 125 | This section describes the targets that you can use in the C<Makefile>, | ||||||||||||
| 126 | to do various tasks. | ||||||||||||
| 127 | |||||||||||||
| 128 | =over | ||||||||||||
| 129 | |||||||||||||
| 130 | =item make install | ||||||||||||
| 131 | |||||||||||||
| 132 | This will build everything and install it for you. | ||||||||||||
| 133 | |||||||||||||
| 134 | =item make debian | ||||||||||||
| 135 | |||||||||||||
| 136 | This will make a Debian package that you can share and install on Debian | ||||||||||||
| 137 | based systems. | ||||||||||||
| 138 | |||||||||||||
| 139 | =item make dmg | ||||||||||||
| 140 | |||||||||||||
| 141 | This will make a Mac OS X distribution. | ||||||||||||
| 142 | |||||||||||||
| 143 | =item make perlbrew | ||||||||||||
| 144 | |||||||||||||
| 145 | Build and install in your perlbrew location. | ||||||||||||
| 146 | |||||||||||||
| 147 | =back | ||||||||||||
| 148 | |||||||||||||
| 149 | =head1 AUTHOR | ||||||||||||
| 150 | |||||||||||||
| 151 | Ingy döt Net <ingy@cpan.org> | ||||||||||||
| 152 | |||||||||||||
| 153 | =head1 COPYRIGHT | ||||||||||||
| 154 | |||||||||||||
| 155 | Copyright (c) 2011. Ingy döt Net. | ||||||||||||
| 156 | |||||||||||||
| 157 | This program is free software; you can redistribute it and/or modify it | ||||||||||||
| 158 | under the same terms as Perl itself. | ||||||||||||
| 159 | |||||||||||||
| 160 | See http://www.perl.com/perl/misc/Artistic.html | ||||||||||||
| 161 | |||||||||||||
| 162 | =cut | ||||||||||||