Lintian::Reporting::ResourceManager (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
Lintian::Reporting::ResourceManager -- A simple resource manager for html_reportsSYNOPSIS
use Lintian::Reporting::ResourceManager; my $resMan = Lintian::Reporting::ResourceManager->new( 'html_dir' => 'path/to/HTML-root', ); # Copy the resource $resMan->install_resource('path/to/my-image.png', { install_method => 'copy'} ); # Move the resource $resMan->install_resource('path/to/generated-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.
OPTSis a key-value list, which must contain the key ``html_dir'' set to the root of theHTMLpath. It is beneath this path that all resources will be installed
INSTANCE METHODS
- install_resource(RESOURCE[, OPT])
-
Installs RESOURCEinto the html root. The resource may be renamed (based on content etc.).
Note that the basename of
RESOURCEmust be unique between all resources installed. See ``resource_URL(RESOURCE_NAME)''.If
OPTis given, it must be a hashref with 0 or more of the following keys (and values).-
- install_method
- Can be ``copy'' or ``move'' (default). If set to ``move'', the original file will be renamed into its new location. Otherwise, a copy is done and the original file is left in place.
- source_file
-
By default, the path denoted by RESOURCEis both the resource name and the source file. This option can be used to install a given file asRESOURCEregardless of the basename of the source file.
If this is passed,
RESOURCEmust be a basename (i.e. without any slashes).
-
- resource_URL(RESOURCE_NAME)
-
Returns the path (relative to the HTMLroot) to a resource installed via ``install_resource(RESOURCE)'', whereRESOURCE_NAMEis the basename of the path given to install_resource.
- resource_integrity_value(RESOURCE_NAME)
-
Return a string that is valid in the ``integrity'' field of a "<link>" HTMLtag. (See www.w3.org/TR/SRI