<<

NAME

Lintian::Reporting::ResourceManager -- A simple resource manager for html_reports

SYNOPSIS

 use Lintian::Reporting::ResourceManager;
 
 my $resMan = Lintian::Reporting::ResourceManager->new(
    'html_dir' => 'path/to/HTML-root',
 );
 $resMan->install_resource('path/to/my-image.png');
 $resMan->install_resource('path/to/my-styles.css');
 print 'Image: ' . $resMan->resource_URL('my-image.png'), "\n";
 print 'CSS: ' . $resMan->resource_URL('my-styles.css'), "\n";

DESCRIPTION

A simple resource manager for Lintian's reporting tool, html_reports.

CLASS METHODS

new(TYPE, OPTS)

Instantiates a new resource manager.

OPTS is a key-value list, which must contain the key "html_dir" set to the root of the HTML path. It is beneath this path that all resources will be installed

INSTANCE METHODS

install_resource(RESOURCE)

Installs RESOURCE into the html root. The resource may be renamed (based on content etc.).

Note that the basename of RESOURCE must be unique between all resources installed. See "resource_URL(RESOURCE_NAME)".

resource_URL(RESOURCE_NAME)

Returns the path (relative to the HTML root) to a resource installed via "install_resource(RESOURCE)", where RESOURCE_NAME is the basename of the path given to install_resource.

AUTHOR

Originally written by Niels Thykier <niels@thykier.net> for Lintian.

<<