NAME

PackageManager::Virtual - A moose role interface for package managers.

VERSION

version 0.191250

SYNOPSIS

if ( $obj->does('PackageManager::Virtual') ) {

    # Installs a package named 'cool_app'
    $obj->install( name => 'cool_app' );

    # Removes a package named 'app1'. Output is verbose.
    $obj->remove( verbose => 1, name => 'app1' );

    # Prints all installed packages
    print "\'$_->{name}\' has version \'$_->{version}\'\n"
        foreach ( $obj->list() );
}

DESCRIPTION

A moose role that exposes functionalities for software package management.

METHODS

list( [verbose => BOOLEAN] )

Gets all installed packages.

The returned value is an array; every index is a hashref with the following key-value pairs:

  • name => STRING

    The name of the package.

  • version => STRING

    A specific version of the package.

verbose

When this parameters value is "1" this command may output additional information to STDOUT.

install( name => STRING, [version => STRING, verbose => BOOLEAN] )

Installs a specified package.

The returned value is an integer. The value "0" implies a successful installation. Otherwise, it indicates there was an error and the package was not installed.

name

The name of the package to be installed.

version

The version of the package to be installed. If omitted, the package version is automatically selected.

verbose

When this parameters value is "1" this command may output additional information to STDOUT.

remove( name => STRING, [verbose => BOOLEAN] )

Removes a specified package.

The returned value is an integer. The value "0" implies a successful removal. Otherwise, it indicates there was an error in the removal process and the package was not removed.

name

The name of the package to be removed.

verbose

When this parameters value is "1" this command may output additional information to STDOUT.

AUTHOR

Daniel Maurice Davis <Daniel.Maurice.Davis@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2019 by Daniel Maurice Davis.

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