NAME

App::SmokeBrew::Tools - Various utility functions for smokebrew

VERSION

version 1.06

SYNOPSIS

use strict;
use warnings;
use App::SmokeBrew::Tools;

# Fetch a perl source tarball
my $filename = App::SmokeBrew::Tools->fetch( $path_to_fetch, $where_to_fetch_to );

# Extract a tarball
my $extracted_loc = App::SmokeBrew::Tools->extract( $tarball, $where_to_extract_to );

# Find the smokebrew directory
my $dir = App::SmokeBrew::Tools->smokebrew_dir();

# Obtain a list of perl versions
my @perls = App::SmokeBrew::Tools->perls(); # All perls >= 5.006

my @stables = App::SmokeBrew::Tools->perls( 'rel' );

my @devs = App::SmokeBrew::Tools->perls( 'dev' );

my @recents = App::SmokeBrew::Tools->perls( 'recent' );

my $perl = '5.13.0';

if ( App::SmokeBrew::Tools->devel_perl( $perl ) ) {
   print "perl ($perl) is a development perl\n";
}

DESCRIPTION

App::SmokeBrew::Tools provides a number of utility functions for smokebrew.

FUNCTIONS

fetch

Requires two mandatory parameters and one optional. The first two parameters are the path to fetch from a CPAN mirror and the file system path where you want the file fetched to. The third, optional parameter, is an arrayref of CPAN mirrors that you wish the file to fetched from.

Returns the path to the fetched file on success, false otherwise.

This function is a wrapper around File::Fetch.

extract

Requires two mandatory parameters, the path to a file that you wish to be extracted and the file system path of where you wish the file to be extracted to. Returns the path to the extracted file on success, false otherwise.

This function is a wrapper around Archive::Extract.

smokebrew_dir

Returns the path to where the .smokebrew directory may be found.

perls

Returns a list of perl versions. Without a parameter returns all perl releases >= 5.006

Specifying rel as the parameter will return all stable perl releases >= 5.006

Specifying dev as the parameter will return only the development perl releases >= 5.006

Specifying recent as the parameter will return only the stable perl releases >= 5.008009

devel_perl

Takes one parameter a perl version to check.

Returns true if given perl is a development perl.

can_quadmath

Takes one parameter a perl version to check.

Returns true if given perl is able to be built with quadmath.

perl_version

Takes one parameter a perl version.

Returns the version with the perl- prefix.

SEE ALSO

smokebrew

Perl::Version

File::Fetch

Archive::Extract

AUTHOR

Chris Williams <chris@bingosnet.co.uk>

COPYRIGHT AND LICENSE

This software is copyright (c) 2023 by Chris Williams.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.