File Coverage

blib/lib/Dash/Renderer.pm
Criterion Covered Total %
statement 15 24 62.5
branch 0 4 0.0
condition n/a
subroutine 5 9 55.5
pod n/a
total 20 37 54.0


line stmt bran cond sub pod time code
1             package Dash::Renderer;
2              
3 6     6   42 use strict;
  6         15  
  6         174  
4 6     6   30 use warnings;
  6         11  
  6         142  
5              
6 6     6   41 use JSON;
  6         12  
  6         42  
7 6     6   722 use File::ShareDir;
  6         11  
  6         187  
8 6     6   31 use Path::Tiny;
  6         9  
  6         1372  
9              
10             my $_deps;
11              
12             sub _deps {
13 0     0     my $kind = shift;
14 0 0         if ( !defined $_deps ) {
15              
16             # TODO recover from __PACKAGE__ variable
17 0           $_deps = from_json(
18             Path::Tiny::path(
19             File::ShareDir::dist_file(
20             'Dash', Path::Tiny::path( 'assets', 'dash_renderer', 'js_deps.json' )->canonpath
21             )
22             )->slurp_utf8
23             );
24             }
25 0 0         if ( defined $kind ) {
26 0           return $_deps->{$kind};
27             }
28 0           return $_deps;
29             }
30              
31             sub _js_dist {
32 0     0     return _deps('_js_dist');
33             }
34              
35             sub _css_dist {
36 0     0     return _deps('_css_dist');
37             }
38              
39             sub _js_dist_dependencies {
40 0     0     return _deps('_js_dist_dependencies');
41             }
42              
43             1;
44              
45             __END__