CGI-Kwiki
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
if (not -f $self->{file}) {
require "$self->{path}/$self->{dispatch}.pm";
mkpath "$self->{prefix}/$self->{author}";
$self->{admin} =
"$self->{name}::$self->{dispatch}"->new(_top => $self);
$self->{admin}->init;
@_ = ($class, _self => $self);
goto &{"$self->{name}::import"};
}
*{caller(0) . "::AUTOLOAD"} = $self->autoload;
}
#line 147
sub autoload {
my $self = shift;
my $caller = caller;
sub {
${"$caller\::AUTOLOAD"} =~ /([^:]+)$/ or die "Cannot autoload $caller";
unshift @_, ($self, $1);
inc/Test.pm view on Meta::CPAN
}
#line 232
sub ok ($;$$) {
croak "ok: plan before you test!" if !$planned;
local($\,$,); # guard against -l and other things that screw with
# print
my ($pkg,$file,$line) = caller($TestLevel);
my $repetition = ++$history{"$file:$line"};
my $context = ("$file at line $line".
($repetition > 1 ? " fail \#$repetition" : ''));
my $ok=0;
my $result = _to_value(shift);
my ($expected,$diag,$isregex,$regex);
if (@_ == 0) {
$ok = $result;
} else {
$expected = _to_value(shift);
inc/Test/Builder.pm view on Meta::CPAN
my($self) = shift;
return @Test_Results;
}
#line 1087
sub todo {
my($self, $pack) = @_;
$pack = $pack || $self->exported_to || $self->caller(1);
no strict 'refs';
return defined ${$pack.'::TODO'} ? ${$pack.'::TODO'}
: 0;
}
#line 1107
sub caller {
my($self, $height) = @_;
$height ||= 0;
my @caller = CORE::caller($self->level + $height + 1);
return wantarray ? @caller : $caller[0];
}
#line 1119
#line 1133
#'#
sub _sanity_check {
_whoa($Curr_Test < 0, 'Says here you ran a negative number of tests!');
inc/Test/Builder.pm view on Meta::CPAN
#line 1186
$SIG{__DIE__} = sub {
# We don't want to muck with death in an eval, but $^S isn't
# totally reliable. 5.005_03 and 5.6.1 both do the wrong thing
# with it. Instead, we use caller. This also means it runs under
# 5.004!
my $in_eval = 0;
for( my $stack = 1; my $sub = (CORE::caller($stack))[3]; $stack++ ) {
$in_eval = 1 if $sub =~ /^\(eval\)/;
}
$Test_Died = 1 unless $in_eval;
};
sub _ending {
my $self = shift;
_sanity_check();
inc/Test/More.pm view on Meta::CPAN
use 5.004;
use strict;
use Test::Builder;
# Can't use Carp because it might cause use_ok() to accidentally succeed
# even though the module being used forgot to use Carp. Yes, this
# actually happened.
sub _carp {
my($file, $line) = (caller(1))[1,2];
warn @_, " at $file line $line\n";
}
require Exporter;
use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO);
$VERSION = '0.45';
@ISA = qw(Exporter);
@EXPORT = qw(ok use_ok require_ok
inc/Test/More.pm view on Meta::CPAN
my $Test = Test::Builder->new;
# 5.004's Exporter doesn't have export_to_level.
sub _export_to_level
{
my $pkg = shift;
my $level = shift;
(undef) = shift; # redundant arg
my $callpkg = caller($level);
$pkg->export($callpkg, @_);
}
#line 172
sub plan {
my(@plan) = @_;
my $caller = caller;
lib/CGI/Kwiki/I18N.pm view on Meta::CPAN
$args{Class} ||= caller;
$args{Style} ||= 'maketext';
$args{Export} ||= 'loc';
$args{Subclass} ||= 'I18N';
my ($loc, $loc_lang) = $class->load_loc(%args);
$loc ||= $class->default_loc(%args);
no strict 'refs';
*{caller(0) . "::$args{Export}"} = $loc if $args{Export};
*{caller(0) . "::$args{Export}_lang"} = $loc_lang || sub { 1 };
}
my %Loc;
sub load_loc {
my ($class, %args) = @_;
return if $args{Fail};
my $pkg = join('::', $args{Class}, $args{Subclass});
return $Loc{$pkg} if exists $Loc{$pkg};
( run in 0.283 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )