NAME
Pinto::Util - Static utility functions for Pinto
VERSION
version 0.063
DESCRIPTION
This is a private module for internal use only. There is nothing for you to see here (yet). All API documentation is purely for my own reference.
FUNCTIONS
author_dir( @base, $author )
Given the name of an $author
, returns the directory where the distributions for that author belong (as a Path::Class::Dir). The optional @base
can be a series of Path::Class:Dir or path parts (as strings). If @base
is given, it will be prepended to the directory that is returned.
itis( $var, $class )
Asserts whether var is a blessed reference and is an instance of the $class
.
parse_dist_path( $path )
Parses a path like one would see in the URL to a distribution in a CPAN repository and returns the author and file name of the distribution. Other subdirectories in the path are ignored.
isa_perl( $path_or_url )
Return true if $path_or_url
appears to point to a release of perl itself. This is based on some file naming patterns that I've seen in the wild. It may not be completely accurate.
is_vcs_file( $path );
Returns true if $path
appears to point to a file that is an internal part of a VCS system.
mtime( $file )
Returns the last modification time (in epoch seconds) for the file
. The argument is required and the file must exist or an exception will be thrown.
md5( $file )
Returns the MD-5
digest (as a hex string) for the $file
. The argument is required and the file must exist on an exception will be thrown.
sha256( $file )
Returns the SHA-256
digest (as a hex string) for the $file
. The argument is required and the file must exist on an exception will be thrown.
validate_property_name( $prop_name )
Throws an exception if the property name is invalid. Currently, property names must be alphanumeric plus any underscores or hyphens.
validate_stack_name( $stack_name )
Throws an exception if the stack name is invalid. Currently, stack names must be alphanumeric plus underscores or hyphens.
ls_time_format( $seconds_since_epoch )
Formats a time value into a string that is similar to what you see in the output from the ls -l
command. If the given time is less than 1 year ago from now, you'll see the month, day, and time. If the time is more than 1 year ago, you'll see the month, day, and year.
current_time()
Returns the current time (in epoch seconds) unless the current time has been overridden by $Pinto::Globals::current_time
.
current_user()
Returns the id of the current user unless it has been overridden by $Pinto::Globals::current_user
.
is_interactive()
Returns true if the process is connected to an interactive terminal (i.e. a keyboard & screen) unless it has been overridden by $Pinto::Globals::is_interactive
.
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Imaginative Software Systems.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.