« blib/lib/Perl/Dist/Asset/Module.pm
↑ Summary
blib/lib/auto/share/dist/Perl-Dist/vanilla/perl-5.10.0/lib/CPAN/Config.pm »
| 1 | package Perl::Dist::Asset::PAR; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Carp (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Params::Util qw{ _STRING }; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use Perl::Dist::Asset (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use vars qw{$VERSION @ISA}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | $VERSION = '1.16'; | |||||||||
| 11 | 1 | @ISA = 'Perl::Dist::Asset'; | |||||||||
| 12 | } | ||||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | use Object::Tiny qw{ | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | name | ||||||||||
| 16 | 1 | }; | |||||||||
| 17 | |||||||||||
| 18 | =pod | ||||||||||
| 19 | |||||||||||
| 20 | =head1 NAME | ||||||||||
| 21 | |||||||||||
| 22 | Perl::Dist::Asset::PAR - "Binary .par package" asset for a Win32 Perl | ||||||||||
| 23 | |||||||||||
| 24 | =head1 SYNOPSIS | ||||||||||
| 25 | |||||||||||
| 26 | my $binary = Perl::Dist::Asset::PAR->new( | ||||||||||
| 27 | name => 'dmake', | ||||||||||
| 28 | ); | ||||||||||
| 29 | |||||||||||
| 30 | # Or usually more like this: | ||||||||||
| 31 | $perl_dist_inno_obj->install_par( | ||||||||||
| 32 | name => 'Perl-Dist-PrepackagedPAR-libexpat', | ||||||||||
| 33 | url => 'http://parrepository.de/Perl-Dist-PrepackagedPAR-libexpat-2.0.1-MSWin32-x86-multi-thread-anyversion.par', | ||||||||||
| 34 | ); | ||||||||||
| 35 | |||||||||||
| 36 | =head1 DESCRIPTION | ||||||||||
| 37 | |||||||||||
| 38 | B<Perl::Dist::Asset::PAR> is a data class that provides encapsulation | ||||||||||
| 39 | and error checking for a "binary .par package" to be installed in a | ||||||||||
| 40 | L<Perl::Dist>-based Perl distribution. | ||||||||||
| 41 | |||||||||||
| 42 | It is normally created on the fly by the L<Perl::Dist::Inno> C<install_par> | ||||||||||
| 43 | method (and other things that call it). The C<install_par> routine | ||||||||||
| 44 | is currently implemented in this file and monkey-patched into | ||||||||||
| 45 | L<Perl::Dist::Inno> namespace. This will hopefully change in future. | ||||||||||
| 46 | |||||||||||
| 47 | The specification of the location to retrieve the package is done via | ||||||||||
| 48 | the standard mechanism implemented in L<Perl::Dist::Asset>. | ||||||||||
| 49 | |||||||||||
| 50 | The C<install_to> argument of the L<Perl::Dist::Asset::Library> Perl::Dist asset | ||||||||||
| 51 | is nto currently supported by the PAR asset. | ||||||||||
| 52 | See L<PAR FILE FORMAT EXTENSIONS> below for details on how non-Perl binaries | ||||||||||
| 53 | are installed. | ||||||||||
| 54 | |||||||||||
| 55 | =head1 METHODS | ||||||||||
| 56 | |||||||||||
| 57 | This class inherits from L<Perl::Dist::Asset> and shares its API. | ||||||||||
| 58 | |||||||||||
| 59 | =cut | ||||||||||
| 60 | |||||||||||
| 61 | |||||||||||
| 62 | |||||||||||
| 63 | |||||||||||
| 64 | ##################################################################### | ||||||||||
| 65 | # Constructor and Accessors | ||||||||||
| 66 | |||||||||||
| 67 | =pod | ||||||||||
| 68 | |||||||||||
| 69 | =head2 new | ||||||||||
| 70 | |||||||||||
| 71 | The C<new> constructor takes a series of parameters, validates then | ||||||||||
| 72 | and returns a new B<Perl::Dist::Asset::PAR> object. | ||||||||||
| 73 | |||||||||||
| 74 | It inherits all the params described in the L<Perl::Dist::Asset> C<new> | ||||||||||
| 75 | method documentation, and adds some additional params. | ||||||||||
| 76 | |||||||||||
| 77 | =over 4 | ||||||||||
| 78 | |||||||||||
| 79 | =item name | ||||||||||
| 80 | |||||||||||
| 81 | The required C<name> param is the logical (arbitrary) name of the package | ||||||||||
| 82 | for the purposes of identification. A sensible default would be the name of | ||||||||||
| 83 | the primary Perl module in the package. | ||||||||||
| 84 | |||||||||||
| 85 | =back | ||||||||||
| 86 | |||||||||||
| 87 | The C<new> constructor returns a B<Perl::Dist::Asset::PAR> object, | ||||||||||
| 88 | or throws an exception (dies) if an invalid param is provided. | ||||||||||
| 89 | |||||||||||
| 90 | =cut | ||||||||||
| 91 | |||||||||||
| 92 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 93 | 0 | my $self = shift->SUPER::new(@_); | |||||||||
| 94 | |||||||||||
| 95 | # Check params | ||||||||||
| 96 | 0 | ▶ | unless ( _STRING($self->name) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 97 | 0 | Carp::croak("Missing or invalid name param"); | |||||||||
| 98 | } | ||||||||||
| 99 | |||||||||||
| 100 | 0 | return $self; | |||||||||
| 101 | } | ||||||||||
| 102 | |||||||||||
| 103 | 1 | 1; | |||||||||
| 104 | |||||||||||
| 105 | =pod | ||||||||||
| 106 | |||||||||||
| 107 | =head1 PAR FILE FORMAT EXTENSIONS | ||||||||||
| 108 | |||||||||||
| 109 | This concerns packagers of .par binaries only. | ||||||||||
| 110 | A .par usually mostly contains the blib/ directory after making a Perl module. | ||||||||||
| 111 | For use with Perl::Dist::Asset::PAR, there are currently three more subdirectories | ||||||||||
| 112 | which will be installed: | ||||||||||
| 113 | |||||||||||
| 114 | blib/c/lib => goes into the c/lib library directory for non-Perl extensions | ||||||||||
| 115 | blib/c/bin => goes into the c/bin executable/dll directory for non-Perl extensions | ||||||||||
| 116 | blib/c/include => goes into the c/include header directory for non-Perl extensions | ||||||||||
| 117 | blib/c/share => goes into the c/share share directory for non-Perl extensions | ||||||||||
| 118 | |||||||||||
| 119 | =head1 SUPPORT | ||||||||||
| 120 | |||||||||||
| 121 | Bugs should be reported via the CPAN bug tracker at | ||||||||||
| 122 | |||||||||||
| 123 | L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Dist> | ||||||||||
| 124 | |||||||||||
| 125 | For other issues, contact the author. | ||||||||||
| 126 | |||||||||||
| 127 | =head1 AUTHOR | ||||||||||
| 128 | |||||||||||
| 129 | Steffen Mueller E<lt>smueller@cpan.orgE<gt> | ||||||||||
| 130 | |||||||||||
| 131 | =head1 SEE ALSO | ||||||||||
| 132 | |||||||||||
| 133 | L<Perl::Dist>, L<Perl::Dist::Inno>, L<Perl::Dist::Asset> | ||||||||||
| 134 | |||||||||||
| 135 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 136 | |||||||||||
| 137 | Copyright 2008 Steffen Mueller, borrowing heavily from | ||||||||||
| 138 | Adam Kennedy's code. | ||||||||||
| 139 | |||||||||||
| 140 | This program is free software; you can redistribute | ||||||||||
| 141 | it and/or modify it under the same terms as Perl itself. | ||||||||||
| 142 | |||||||||||
| 143 | The full text of the license can be found in the | ||||||||||
| 144 | LICENSE file included with this module. | ||||||||||
| 145 | |||||||||||
| 146 | =cut | ||||||||||