Alien-Selenium
view release on metacpan or search on metacpan
inc/File/Spec/Unix.pm view on Meta::CPAN
File::Spec->splitdir( "/a/b//c/" );
Yields:
( '', 'a', 'b', '', 'c', '' )
=cut
sub splitdir {
return split m|/|, $_[1], -1; # Preserve trailing fields
}
=item catpath()
Takes volume, directory and file portions and returns an entire path. Under
Unix, $volume is ignored, and directory and file are concatenated. A '/' is
inserted if needed (though if the directory portion doesn't start with
'/' it is not added). On other OSs, $volume is significant.
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
local *YAML::Node::new = sub {
$node = $orig_yaml_node_new->(@_);
};
my $retval = $self->SUPER::ACTION_distmeta;
die "Failed to steal the YAML node" unless defined $node;
$node->{no_index} = $self->{properties}->{add_to_no_index} || {};
$node->{no_index}->{directory} ||= [];
unshift(@{$node->{no_index}->{directory}}, qw(examples inc t),
(map { File::Spec::Unix->catdir("lib", split m/::/) }
(@{$node->{no_index}->{namespace} || []})));
foreach my $package (keys %{$node->{provides}}) {
delete $node->{provides}->{$package} if
(grep {$package =~ m/^\Q$_\E/}
@{$node->{no_index}->{namespace} || []});
delete $node->{provides}->{$package} if
(grep {$package eq $_}
@{$node->{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));
}
( run in 1.641 second using v1.01-cache-2.11-cpan-9bca49b1385 )