| 1 | package Devel::Cover::Html_Common; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | our $VERSION = '1.52'; # VERSION | ||
| 7 | |||
| 8 | use Exporter; | ||
| 9 | |||
| 10 | our @ISA = "Exporter"; | ||
| 11 | our @EXPORT_OK = "launch"; | ||
| 12 | |||
| 13 | sub launch { | ||
| 14 | my ($package, $opt) = @_; | ||
| 15 | |||
| 16 | my $outfile = "$opt->{outputdir}/$opt->{option}{outputfile}"; | ||
| 17 | if (eval { require Browser::Open }) { | ||
| 18 | Browser::Open::open_browser($outfile); | ||
| 19 | } else { | ||
| 20 | print STDERR "Devel::Cover: -launch requires Browser::Open\n"; | ||
| 21 | } | ||
| 22 | } | ||
| 23 | |||
| 24 | =pod | ||
| 25 | |||
| 26 | =head1 NAME | ||
| 27 | |||
| 28 | Devel::Cover::Report::Html_Common - Common code for HTML reporters | ||
| 29 | |||
| 30 | =head1 VERSION | ||
| 31 | |||
| 32 | version 1.52 | ||
| 33 | |||
| 34 | =head1 DESCRIPTION | ||
| 35 | |||
| 36 | This module provides common functionality for HTML reporters. | ||
| 37 | |||
| 38 | =head1 Functions | ||
| 39 | |||
| 40 | =over 4 | ||
| 41 | |||
| 42 | =item launch | ||
| 43 | |||
| 44 | Launch a browser to view the report. HTML reporters just need to import this | ||
| 45 | function to enable the -launch flag for that report type. | ||
| 46 | |||
| 47 | =back | ||
| 48 | |||
| 49 | =head1 SEE ALSO | ||
| 50 | |||
| 51 | Devel::Cover | ||
| 52 | |||
| 53 | =cut | ||
| 54 | |||
| 55 | 1 |