Name
Class::Usul::Build - M::B utility methods
Version
This document describes Class::Usul::Build version 0.1.$Revision: 199 $
Synopsis
use Class::Usul::Build;
use MRO::Compat;
my $builder = q(Class::Usul::Build);
my $class = $builder->subclass( class => 'Bob', code => <<'EOB' );
sub ACTION_instal { # Spelling mistake intentional
my $self = shift;
$self->next::method();
# Your application specific post installation code goes here
return;
}
EOB
Description
Subclasses Module::Build. Ask questions during the install phase. The answers to the questions determine where the application will be installed and which additional actions will take place. Should be generic enough for any web application
ACTIONS
ACTION_change_version
change_version
Changes the $VERSION
strings in all of the projects files
ACTION_distmeta
distmeta
Updates license file and changelog
ACTION_install
install
When called from it's subclass this method performs the sequence of actions required to install the application. Configuration options are written from the file build.json. The "actions" method returns the list of steps required to install the application
ACTION_install_local_cpanm
install_local_cpanm
Install App::Cpanminus to the local lib
ACTION_install_local_deps
install_local_deps
Installs dependencies to the local lib
ACTION_install_local_lib
install_local_lib
Install local::lib locally
ACTION_install_local_perl
install_local_perl
Install a specific Perl version to the local Perlbrew area
ACTION_install_local_perlbrew
install_local_perlbrew
Installs Perlbrew locally
ACTION_installdeps
installdeps
Iterates over the requires attributes calling CPAN each time to install the dependent module
ACTION_local_archive
local_archive
Creates a tarball of the local lib directory
ACTION_prereq_diff
prereq_diff
Creates a report showing the difference between what Build.PL
has in it and what it should have in it
ACTION_release
release
Commits the current working copy as the next release
ACTION_restore_local_archive
restore_local_archive
Unpacks an archive tarball of the local lib directory
ACTION_standalone
standalone
Locally installs local lib and all dependencies
ACTION_uninstall
uninstall
Uninstalls the application
ACTION_upload
upload
Upload distribution to CPAN
Subroutines/Methods
class_path
$path = $builder->class_path( $class_name );
Returns the relative path to the specified class
cli
$cli = $builder->cli;
Returns an instance of Class::Usul::Programs, the command line interface object
cli_info
$builder->cli_info( @list_of_messages );
Calls info on the client object
_commit_release
$builder->_commit_release( $config, 'Release message for VCS log' );
Commits the release to the VCS
_cpan_upload
$builder->_cpan_upload;
Called by "ACTION_upload". Uses CPAN::Uploader (which it loads on demand) to do the lifting. Reads from the users .pause in their $ENV{HOME}
directory
dispatch
Overloads the M::B method. Calls "_setup_plugins" then the parent method
distname
Turns a class name into a distribution name
install_actions_class
Returns the class name of the class which contains the additional actions that are performed when the application is installed
make_tarball
Overloads the M::B method. Changes the directory which will contain the distribution tarball then calls the parent method
patch_file
Runs the patch utility on the specified source file
post_install
$builder->post_install( $config );
Executes the custom post installation commands
process_files
$builder->process_files( $source, $destination );
Handles the processing of files other than library modules and programs. Uses the Bob::skip_pattern defined in the subclass to select only those files that should be processed. Copies files from source to destination, creating the destination directories as required. Source can be a single file or a directory. The destination is optional and defaults to blib
process_local_files
Calls "process_file" setting the source to local
public_repository
Return the URI of the SVN repository for this project. Return undef if we are not using svn or the repository is a local file path
question_class
Returns the class name of the class which contains the questions that are asked when the application is installed
replace
$builder->replace( $this, $that, $path );
Substitutes $this
string for $that
string in the file $path
repository
Returns the URI of the VCS repository for this project
set_base_path
$base = $builder->set_base_path( $config );
Uses the $config->{style}
attribute to set the Module::Build install_base attribute to the base directory for this installation. Returns that path. Also sets; bin, lib, and var directory paths as appropriate. Called from ACTION_install
skip_pattern
$regexp = $builder->skip_pattern( $new_regexp );
Accessor/mutator method. Used by "_copy_file" to skip processing files that match this pattern. Set to false to not have a skip list
update_changelog
Update the version number and date/time stamp in the Changes file
write_license_file
Instantiates an instance of Software::License, fills in the copyright holder information and writes a LICENSE file
Private Methods
_copy_file
$builder->_copy_file( $source, $destination );
Called by "process_files". Copies the $source
file to the $destination
directory
Diagnostics
None
Configuration and Environment
Edits and stores config information in the file build.json
Dependencies
Incompatibilities
There are no known incompatibilities in this module
Bugs and Limitations
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Author
Peter Flanigan, <Support at RoxSoft.co.uk>
License and Copyright
Copyright (c) 2012 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE