File: Html_Common.pm

package info (click to toggle)
libdevel-cover-perl 1.23-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,908 kB
  • ctags: 609
  • sloc: perl: 10,407; sh: 248; makefile: 7
file content (55 lines) | stat: -rw-r--r-- 906 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package Devel::Cover::Html_Common;
BEGIN {require 5.006}
use strict;
use warnings;

our $VERSION = '1.23'; # VERSION

use Exporter;

our @ISA       = 'Exporter';
our @EXPORT_OK = 'launch';

sub launch {
    my ($package, $opt) = @_;

    my $outfile = "$opt->{outputdir}/$opt->{option}{outputfile}";
    if (eval { require Browser::Open }) {
        Browser::Open::open_browser($outfile);
    } else {
        print STDERR "Devel::Cover: -launch requires Browser::Open\n";
    }
}

=pod

=head1 NAME

Devel::Cover::Report::Html_Common - Common code for HTML reporters

=head1 VERSION

version 1.23

=head1 DESCRIPTION

This module provides common functionality for HTML reporters.

=head1 Functions

=over 4

=item launch

Launch a browser to view the report. HTML reporters just need to import this
function to enable the -launch flag for that report type.

=back

=head1 SEE ALSO

Devel::Cover

=cut

1;