App-Fetchware
view release on metacpan or search on metacpan
bin/fetchware view on Meta::CPAN
our @EXPORT_OK = @{$EXPORT_TAGS{TESTING}};
our $verbose = 0;
our $quiet = 0;
our $dry_run = 0;
# Be a modulino, so I can "use fetchware" in my test suite, so I can test
# bin/fetchware normally like any other perl module.
###BUGALERT## Add a test suite for run(), and also one that directly calls
#bin/fetchware to test its command line options.
run() unless caller();
sub run {
# Set up a %SIG handler for CTRL-C or CTRL-Z on Windows.
# And a %SIG handler for QUIT, which is CTRL-\
#
# Define a $parent_pid, so I can compare it to $$ (the current pid) to
# see if I'm the child or the parent inside the sig handler to act
# accordingly.
my $parent_pid = $$;
#
lib/App/Fetchware.pm view on Meta::CPAN
the current package.
EOD
override $sub_to_hook => $callback;
# Overriding the subroutine is not enough, because it is overriding it
# inside App::Fetchware, so I need to also override the subroutine inside
# hook()'s caller as done below.
{
no warnings 'redefine';
clone($sub_to_hook => (from => 'App::Fetchware', to => caller()));
}
}
###BUGALERT### Add an section of use cases. You know explaing why you'd use
#no_install, or why'd you'd use look, or why And so on.....
lib/App/Fetchware/ExportAPI.pm view on Meta::CPAN
BEGIN {
require App::Fetchware::ExportAPI;
App::Fetchware::ExportAPI->import(KEEP => [qw(start end)],
OVERRIDE =>
[qw(lookup download verify unarchive build install uninstall)]
);
}
Adds fetchware's API subroutines (new(), new_install(), check_syntax(), start(),
lookup(), download(), verify(), unarchive(), build(), install(), end(),
uninstall(), and upgrade()) to the caller()'s @EXPORT. It also imports
L<Exporter>'s import() subroutine to the caller's package, so that the caller
as a proper import() subroutine that Perl will use when someone uses your
fetchware extension in their fetchware extension. Used by fetchware extensions
to easily add fetchware's API subroutines to your extension's package exports.
The C<KEEP> type is how fetchware extensions I<inherit> whatever API subroutines that they
want to reuse from App::Fetchware, while C<OVERRIDE> specifies which API
subroutines this Fetchware extension will implement itself or "override".
Normally, you don't actually call import(); instead, you call it implicity by
( run in 1.471 second using v1.01-cache-2.11-cpan-cc502c75498 )