App-cpantimes
view release on metacpan or search on metacpan
sub build_bourne_env_declaration {
my $class = shift;
my($name, $value) = @_;
return qq{export ${name}="${value}"\n};
}
sub build_csh_env_declaration {
my $class = shift;
my($name, $value) = @_;
return qq{setenv ${name} "${value}"\n};
}
sub build_win32_env_declaration {
my $class = shift;
my($name, $value) = @_;
return qq{set ${name}=${value}\n};
}
sub setup_env_hash_for {
my ($class, $path) = @_;
my %envs = $class->build_environment_vars_for($path, INTERPOLATE_ENV);
@ENV{keys %envs} = values %envs;
}
sub build_environment_vars_for {
my ($class, $path, $interpolate) = @_;
return (
PERL_LOCAL_LIB_ROOT => $path,
PERL_MB_OPT => "--install_base ${path}",
PERL_MM_OPT => "INSTALL_BASE=${path}",
PERL5LIB => join($Config{path_sep},
$class->install_base_arch_path($path),
$class->install_base_perl_path($path),
(($ENV{PERL5LIB}||()) ?
($interpolate == INTERPOLATE_ENV
? ($ENV{PERL5LIB})
: (($^O ne 'MSWin32') ? '$PERL5LIB' : '%PERL5LIB%' ))
: ())
),
PATH => join($Config{path_sep},
$class->install_base_bin_path($path),
($interpolate == INTERPOLATE_ENV
? ($ENV{PATH}||())
: (($^O ne 'MSWin32') ? '$PATH' : '%PATH%' ))
),
)
}
1;
LOCAL_LIB
$fatpacked{"parent.pm"} = <<'PARENT';
package parent;
use strict;
use vars qw($VERSION);
$VERSION = '0.225';
sub import {
my $class = shift;
my $inheritor = caller(0);
if ( @_ and $_[0] eq '-norequire' ) {
shift @_;
} else {
for ( my @filename = @_ ) {
if ( $_ eq $inheritor ) {
warn "Class '$inheritor' tried to inherit from itself\n";
};
s{::|'}{/}g;
require "$_.pm"; # dies if the file is not found
}
}
{
no strict 'refs';
push @{"$inheritor\::ISA"}, @_;
};
};
"All your base are belong to us"
__END__
PARENT
$fatpacked{"version.pm"} = <<'VERSION';
#!perl -w
package version;
use 5.005_04;
use strict;
use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv);
$VERSION = 0.88;
$CLASS = 'version';
#--------------------------------------------------------------------------#
# Version regexp components
#--------------------------------------------------------------------------#
# Fraction part of a decimal version number. This is a common part of
# both strict and lax decimal versions
my $FRACTION_PART = qr/\.[0-9]+/;
# First part of either decimal or dotted-decimal strict version number.
# Unsigned integer with no leading zeroes (except for zero itself) to
# avoid confusion with octal.
my $STRICT_INTEGER_PART = qr/0|[1-9][0-9]*/;
# First part of either decimal or dotted-decimal lax version number.
# Unsigned integer, but allowing leading zeros. Always interpreted
# as decimal. However, some forms of the resulting syntax give odd
# results if used as ordinary Perl expressions, due to how perl treats
# octals. E.g.
# version->new("010" ) == 10
#--------------------------------------------------------------------------#
eval "use version::vxs $VERSION";
if ( $@ ) { # don't have the XS version installed
eval "use version::vpp $VERSION"; # don't tempt fate
die "$@" if ( $@ );
push @ISA, "version::vpp";
local $^W;
*version::qv = \&version::vpp::qv;
*version::declare = \&version::vpp::declare;
*version::_VERSION = \&version::vpp::_VERSION;
if ($] >= 5.009000 && $] < 5.011004) {
no strict 'refs';
*version::stringify = \&version::vpp::stringify;
*{'version::(""'} = \&version::vpp::stringify;
*version::new = \&version::vpp::new;
*version::parse = \&version::vpp::parse;
}
}
else { # use XS module
push @ISA, "version::vxs";
local $^W;
*version::declare = \&version::vxs::declare;
*version::qv = \&version::vxs::qv;
*version::_VERSION = \&version::vxs::_VERSION;
*version::vcmp = \&version::vxs::VCMP;
if ($] >= 5.009000 && $] < 5.011004) {
no strict 'refs';
*version::stringify = \&version::vxs::stringify;
*{'version::(""'} = \&version::vxs::stringify;
*version::new = \&version::vxs::new;
*version::parse = \&version::vxs::parse;
}
}
# Preloaded methods go here.
sub import {
no strict 'refs';
my ($class) = shift;
# Set up any derived class
unless ($class eq 'version') {
local $^W;
*{$class.'::declare'} = \&version::declare;
*{$class.'::qv'} = \&version::qv;
}
my %args;
if (@_) { # any remaining terms are arguments
map { $args{$_} = 1 } @_
}
else { # no parameters at all on use line
%args =
(
qv => 1,
'UNIVERSAL::VERSION' => 1,
);
}
my $callpkg = caller();
if (exists($args{declare})) {
*{$callpkg.'::declare'} =
sub {return $class->declare(shift) }
unless defined(&{$callpkg.'::declare'});
}
if (exists($args{qv})) {
*{$callpkg.'::qv'} =
sub {return $class->qv(shift) }
unless defined(&{$callpkg.'::qv'});
}
if (exists($args{'UNIVERSAL::VERSION'})) {
local $^W;
*UNIVERSAL::VERSION
= \&version::_VERSION;
}
if (exists($args{'VERSION'})) {
*{$callpkg.'::VERSION'} = \&version::_VERSION;
}
if (exists($args{'is_strict'})) {
*{$callpkg.'::is_strict'} = \&version::is_strict
unless defined(&{$callpkg.'::is_strict'});
}
if (exists($args{'is_lax'})) {
*{$callpkg.'::is_lax'} = \&version::is_lax
unless defined(&{$callpkg.'::is_lax'});
}
}
sub is_strict { defined $_[0] && $_[0] =~ qr/ \A $STRICT \z /x }
sub is_lax { defined $_[0] && $_[0] =~ qr/ \A $LAX \z /x }
1;
VERSION
$fatpacked{"Version/Requirements.pm"} = <<'VERSION_REQUIREMENTS';
use strict;
use warnings;
package Version::Requirements;
BEGIN {
$Version::Requirements::VERSION = '0.101020';
}
# ABSTRACT: a set of version requirements for a CPAN dist
use Carp ();
use Scalar::Util ();
use version 0.77 (); # the ->parse method
sub new {
my ($class) = @_;
return bless {} => $class;
}
( run in 1.562 second using v1.01-cache-2.11-cpan-e1769b4cff6 )