blib/lib/App/Netdisco/Web/Static.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 17 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package App::Netdisco::Web::Static;
2  
3 use Dancer ':syntax';
4 use Path::Class;
5  
6 get '/plugin/*/*.js' => sub {
7 my ($plugin) = splat;
8  
9 my $content = template
10 'plugin.tt', { target => "plugin/$plugin/$plugin.js" },
11 { layout => undef };
12  
13 send_file \$content,
14 content_type => 'application/javascript',
15 filename => "$plugin.js";
16 };
17  
18 get '/plugin/*/*.css' => sub {
19 my ($plugin) = splat;
20  
21 my $content = template
22 'plugin.tt', { target => "plugin/$plugin/$plugin.css" },
23 { layout => undef };
24  
25 send_file \$content,
26 content_type => 'text/css',
27 filename => "$plugin.css";
28 };
29  
30 true;