Crypt-OpenSSL-CA
view release on metacpan or search on metacpan
inc/My/Module/Build.pm view on Meta::CPAN
=item I<package2filename($packagename)>
Converts $packagename (e.g. C<Foo::Bar>) into its OS-specific notation
(e.g. C<Foo/Bar.pm>).
=cut
sub package2filename {
my ($self, $package) = @_;
my @components = split m/::/, $package;
$components[$#components] .= ".pm";
return catfile(@components);
}
=item I<process_Inline_C_file($filename, @preload_modules)>
Arranges for L<Inline::C> code contained in $filename to be compiled
into .bs's and .so's. @preload_modules is a list of Perl packages (in
Perl C<use> notation, eg C<Foo::Bar> instead of C<Foo/Bar.pm>) that
should be loaded with C<use> before starting the L<Inline> install
inc/My/Module/Build.pm view on Meta::CPAN
MESSAGE
my $retval = $self->SUPER::ACTION_distmeta;
my $metafile = $self->can("metafile") ? # True as of Module::Build 0.2805
$self->metafile() : $self->{metafile};
my $meta_yml = YAML::LoadFile($metafile);
$meta_yml->{no_index} = $self->{properties}->{add_to_no_index} || {};
$meta_yml->{no_index}->{directory} ||= [];
unshift(@{$meta_yml->{no_index}->{directory}}, qw(examples inc t),
(map { File::Spec::Unix->catdir("lib", split m/::/) }
(@{$meta_yml->{no_index}->{namespace} || []})));
foreach my $package (keys %{$meta_yml->{provides}}) {
delete $meta_yml->{provides}->{$package} if
(grep {$package =~ m/^\Q$_\E/}
@{$meta_yml->{no_index}->{namespace} || []});
delete $meta_yml->{provides}->{$package} if
(grep {$package eq $_}
@{$meta_yml->{no_index}->{package} || []});
}
inc/My/Tests/Below.pm view on Meta::CPAN
=cut
## Parse the whole source file again in order to provide said
## features. Yes, seeking to start also works on main::DATA!
## Gotta love Perl :-)
seek($fd, 0, 0) or die $!; $. = 0;
my $insnippet;
SOURCELINE: while(<$fd>) {
if (m/^=for\s+My::Tests::Below\s+"([^"]*)"(.*)$/) {
my $snipkey = $1; my @args = split m/\s+/, $2;
if (grep { lc($_) eq "end" } @args) {
die qq'Not in an "=for My::Tests::Below" directive'.
qq' at line $.\n' unless (defined $insnippet);
die qq'Badly nested "=for My::Tests::Below" directives'.
qq' at line $.\n' unless ($insnippet eq $snipkey);
undef $insnippet;
} else { # Assume "begin" for compatibility with old tests
die qq'Duplicate "=for My::Tests::Below" directive'.
qq' for label $snipkey at line $.\n' if
(exists $self->{podsnippets}{$snipkey});
inc/My/Tests/Below.pm view on Meta::CPAN
=cut
sub pod_data_snippet {
my ($self, $name)=@_; $self = $singleton if ! ref $self;
local $_ = $self->{podsnippets}{$name}->{text};
return unless defined;
my $ragamount;
foreach my $line (split m/\n/s) {
next if $line =~ m/^\t/; # tab width is treated as infinite to
# cut through the whole mess
next if $line eq ""; # Often authors leave empty lines to
# delimit paragraphs in SYNOPSIS, count them as undefined
# length as well
$line =~ m/^( *)/; my $spaceamount = length($1);
$ragamount = $spaceamount if ((!defined $ragamount) ||
($ragamount > $spaceamount));
}
lib/Crypt/OpenSSL/CA.pm view on Meta::CPAN
run_thru_openssl($crlpem, qw(crl -noout -text));
is($?, 0, "``openssl crl'' ran successfully")
or die $err;
like($crldump, qr/last update:.*2007/i);
like($crldump, qr/next update:.*2057/i);
like($crldump, qr/keyid.*DE:AD:BE:EF/);
like($crldump, qr/CRL Number.*critical/i);
# Right now OpenSSL cannot parse freshest CRL indicator:
like($crldump, qr/deltacrl\.crl/);
my @crlentries = split m/Serial Number: /, $crldump;
shift(@crlentries); # Leading garbage
my %crlentries;
for(@crlentries) {
if (! m/^([0-9A-F]+)(.*)$/si) {
fail("Incorrect CRL entry\n$_\n");
next;
}
$crlentries{uc($1)} = $2;
}
like($crlentries{"10"}, qr/Feb 12/, "revocation dates");
t/example-make-crls.t view on Meta::CPAN
}
done_testing;
=head1 HELPER FUNCTIONS
=cut
sub parse_crl_entries {
my ($crldump) = @_;
my @crlentries = split m/Serial Number: /, $crldump;
shift(@crlentries); # Leading garbage
my %crlentries;
for(@crlentries) {
if (! m/^([0-9A-F]+)(.*)$/si) {
fail("Incorrect CRL entry\n$_\n");
next;
}
$crlentries{uc($1)} = $2;
}
return %crlentries;
t/lib/Crypt/OpenSSL/CA/Test.pm view on Meta::CPAN
# @INC set...
my ($indent, $orig_inc);
{
local $ENV{PERL5LIB};
( ($indent, $orig_inc) = `$perl -V` =~ m/^( *)\@INC:\n(.*)\Z/sm )
or die <<"FAIL";
Couldn't find original \@INC in the output of $perl -V.
FAIL
}
my %orig_inc_set;
foreach (split m{$/}, $orig_inc) {
last unless m/^$indent +(.*?)$/;
$orig_inc_set{$1}++;
}
@perlcmdline = ($perl, (map { -I => $_ } (grep {! $orig_inc_set{$_} } @INC)));
diag(join(" ", @perlcmdline)) if $ENV{DEBUG};
return @perlcmdline;
}
}
( run in 0.780 second using v1.01-cache-2.11-cpan-71847e10f99 )