File Coverage

blib/lib/Mojolicious/Plugin/AutoReload.pm
Criterion Covered Total %
statement 26 32 81.2
branch 10 12 83.3
condition 2 3 66.6
subroutine 6 7 85.7
pod 1 1 100.0
total 45 55 81.8


line stmt bran cond sub pod time code
1             package Mojolicious::Plugin::AutoReload;
2             our $VERSION = '0.007';
3             # ABSTRACT: Automatically reload open browser windows when your application changes
4              
5             #pod =head1 SYNOPSIS
6             #pod
7             #pod use Mojolicious::Lite;
8             #pod plugin AutoReload => {};
9             #pod get '/' => 'index';
10             #pod app->start;
11             #pod __DATA__
12             #pod @@ index.html.ep
13             #pod Hello world!
14             #pod
15             #pod =head1 DESCRIPTION
16             #pod
17             #pod This plugin automatically reloades the page when the Mojolicious webapp
18             #pod restarts. This is especially useful when using L
19             #pod server|http://mojolicious.org/perldoc/Mojolicious/Guides/Tutorial#Reloading>,
20             #pod which automatically restarts the webapp when it detects changes.
21             #pod Combined, C and C will
22             #pod automatically display your new content whenever you change your webapp
23             #pod in your editor!
24             #pod
25             #pod This works by opening a WebSocket connection to a specific Mojolicious
26             #pod route. When the server restarts, the WebSocket is disconnected, which
27             #pod triggers a reload of the page.
28             #pod
29             #pod The AutoReload plugin will automatically add a C<<
128             ENDHTML
129             }
130 1         11 return '';
131 2         25 } );
132             }
133              
134             1;
135              
136             __END__