view release on metacpan or search on metacpan
bin/selenium_install
Build.PL
Changes
inc/File/Fetch.pm
inc/File/Fetch/Item.pm
inc/File/Spec/Unix.pm
inc/IPC/Cmd.pm
inc/Locale/Maketext/Simple.pm
inc/Module/Load.pm
inc/Module/Load/Conditional.pm
inc/My/Module/Build.pm
inc/My/Tests/Below.pm
inc/Params/Check.pm
inc/Pod/Snippets.pm
inc/Text/Patch.pm
lib/Alien/Selenium.pm
inc/File/Fetch.pm view on Meta::CPAN
#line 1 "inc/File/Fetch.pm - /Users/kane/sources/p4/other/file-fetch/lib/File/Fetch.pm"
package File::Fetch;
use strict;
use FileHandle;
use File::Copy;
use File::Spec 0.82;
use File::Spec::Unix;
use File::Fetch::Item;
use File::Basename qw[dirname];
use Cwd qw[cwd];
use IPC::Cmd qw[can_run run];
use File::Path qw[mkpath];
use Params::Check qw[check];
use Module::Load::Conditional qw[can_load];
use vars qw[ $VERBOSE $PREFER_BIN $FROM_EMAIL $USER_AGENT
inc/File/Fetch.pm view on Meta::CPAN
### file:// paths have no host ###
if( $href->{scheme} eq 'file' ) {
$href->{path} = $uri;
$href->{host} = '';
} else {
@{$href}{qw|host path|} = $uri =~ m|([^/]*)(/.*)$|s;
}
### split the path into file + dir ###
{ my @parts = File::Spec::Unix->splitpath( delete $href->{path} );
$href->{path} = $parts[1];
$href->{file} = $parts[2];
}
return $href;
}
#line 162
inc/File/Fetch.pm view on Meta::CPAN
'LWP::UserAgent' => '0.0',
'HTTP::Request' => '0.0',
'HTTP::Status' => '0.0',
URI => '0.0',
};
if( can_load(modules => $use_list) ) {
### setup the uri object
my $uri = URI->new( File::Spec::Unix->catfile(
$self->path, $self->file
) );
### special rules apply for file:// uris ###
$uri->scheme( $self->scheme );
$uri->host( $self->scheme eq 'file' ? '' : $self->host );
$uri->userinfo("anonymous:$FROM_EMAIL") if $self->scheme ne 'file';
### set up the useragent object
my $ua = LWP::UserAgent->new();
inc/File/Fetch.pm view on Meta::CPAN
### see if we have a wget binary ###
if( my $ncftp = can_run('ncftp') ) {
my $cmd = [
$ncftp,
'-V', # do not be verbose
'-p', $FROM_EMAIL, # email as password
$self->host, # hostname
dirname($to), # local dir for the file
# remote path to the file
File::Spec::Unix->catdir( $self->path, $self->file ),
];
### shell out ###
my $captured;
unless(run( command => $cmd,
buffer => \$captured,
verbose => $DEBUG )
) {
warn "Command failed: $captured";
return;
inc/File/Spec/Unix.pm view on Meta::CPAN
package File::Spec::Unix;
use strict;
use vars qw($VERSION);
$VERSION = '1.5';
=head1 NAME
File::Spec::Unix - File::Spec for Unix, base for other File::Spec modules
=head1 SYNOPSIS
require File::Spec::Unix; # Done automatically by File::Spec
=head1 DESCRIPTION
Methods for manipulating file specifications. Other File::Spec
modules, such as File::Spec::Mac, inherit from File::Spec::Unix and
override specific methods.
=head1 METHODS
=over 2
=item canonpath()
No physical check on the filesystem, but a logical cleanup of a
path. On UNIX eliminates successive slashes and successive "/.".
inc/File/Spec/Unix.pm view on Meta::CPAN
is not or is significant when comparing file specifications.
=cut
sub case_tolerant () { 0 }
=item file_name_is_absolute
Takes as argument a path and returns true if it is an absolute path.
This does not consult the local filesystem on Unix, Win32, OS/2 or Mac
OS (Classic). It does consult the working environment for VMS (see
L<File::Spec::VMS/file_name_is_absolute>).
=cut
sub file_name_is_absolute {
my ($self,$file) = @_;
return scalar($file =~ m:^/:s);
}
inc/File/Spec/Unix.pm view on Meta::CPAN
=item splitpath
($volume,$directories,$file) = File::Spec->splitpath( $path );
($volume,$directories,$file) = File::Spec->splitpath( $path, $no_file );
Splits a path into volume, directory, and filename portions. On systems
with no concept of volume, returns '' for volume.
For systems with no syntax differentiating filenames from directories,
assumes that the last file is a path unless $no_file is true or a
trailing separator or /. or /.. is present. On Unix this means that $no_file
true makes this return ( '', $path, '' ).
The directory portion may or may not be returned with a trailing '/'.
The results can be passed to L</catpath()> to get back a path equivalent to
(usually identical to) the original path.
=cut
sub splitpath {
inc/File/Spec/Unix.pm view on Meta::CPAN
@dirs = File::Spec->splitdir( $directories );
$directories must be only the directory portion of the path on systems
that have the concept of a volume or that have path syntax that differentiates
files from directories.
Unlike just splitting the directories on the separator, empty
directory names (C<''>) can be returned, because these are significant
on some OSs.
On Unix,
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.
=cut
sub catpath {
my ($self,$volume,$directory,$file) = @_;
if ( $directory ne '' &&
$file ne '' &&
inc/IPC/Cmd.pm view on Meta::CPAN
The C<can_run> function can tell you if a certain binary is installed
and if so where, whereas the C<run> function can actually execute any
of the commands you give it and give you a clear return value, as well
as adhere to your verbosity settings.
=head1 FUNCTIONS
=head2 can_run
C<can_run> takes but a single argument: the name of a binary you wish
to locate. C<can_run> works much like the unix binary C<which>, which
scans through your path, looking for the binary you asked for.
Unlike C<which> however, this function is platform independant and
will also work on, for example, Win32.
It will return the full path to the binary you asked for if it was
found, or C<undef> if it was not.
=head2 run
inc/My/Module/Build.pm view on Meta::CPAN
package My::Module::Build;
use strict;
use warnings;
use base "Module::Build";
use IO::File;
use File::Path qw(mkpath);
use File::Spec::Functions qw(catfile catdir splitpath splitdir);
use File::Basename qw(dirname);
use File::Spec::Unix ();
use File::Find;
=begin internals
=head2 Global variables
=head3 $running_under_emacs_debugger
Set by L</_massage_ARGV> if (you guessed it) we are currently running
under the Emacs debugger.
inc/My/Module/Build.pm view on Meta::CPAN
itself, and should therefore be appended to the C<build_requires> hash
as shown in L</SYNOPSIS>.
=cut
sub requires_for_build {
('IO::File' => 0,
'File::Path' => 0,
'File::Spec' => 0,
'File::Spec::Functions' => 0,
'File::Spec::Unix' => 0,
'File::Find' => 0,
'Module::Build' => 0,
'Module::Build::Compat' => 0,
'FindBin' => 0, # As per L</SYNOPSIS>
# The following are actually requirements for tests:
'File::Temp' => 0, # for tempdir() in My::Tests::Below
'Fatal' => 0, # Used to cause tests to die early if fixturing
# fails, see sample in this module's test suite
# (at the bottom of this file)
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} || []});
}
t/maintainer/kwalitee.t view on Meta::CPAN
Copied and modified from the original code so as not to frob in
version-control directories, build directories and so on.
=cut
BEGIN { undef &get_files }
sub get_files {
return if /^\.+$/;
my $unixy=join('/',splitdir($File::Find::name));
return if $unixy =~
m{(^|/)(RCS|CVS|SCCS|\.git|\.svn|\.hg|_build|_Inline|blib)};
if (-d $_) {
push (@dirs,$unixy);
} elsif (-f $_) {
push (@files,$unixy);
$size+=-s _ || 0;
}
}