File Coverage

blib/lib/Dash/Core/ComponentsAssets.pm
Criterion Covered Total %
statement 15 23 65.2
branch 0 4 0.0
condition n/a
subroutine 5 8 62.5
pod n/a
total 20 35 57.1


line stmt bran cond sub pod time code
1             package Dash::Core::ComponentsAssets;
2              
3 3     3   41 use strict;
  3         7  
  3         90  
4 3     3   16 use warnings;
  3         6  
  3         73  
5 3     3   16 use JSON;
  3         7  
  3         66  
6 3     3   389 use File::ShareDir;
  3         16  
  3         131  
7 3     3   31 use Path::Tiny;
  3         8  
  3         613  
8              
9             my $_deps;
10              
11             sub _deps {
12 0     0     my $kind = shift;
13 0 0         if ( !defined $_deps ) {
14 0           $_deps = from_json(
15             Path::Tiny::path(
16             File::ShareDir::dist_file(
17             "Dash", Path::Tiny::path( "assets", "dash_core_components", "js_deps.json" )->canonpath
18             )
19             )->slurp_utf8
20             );
21             }
22 0 0         if ( defined $kind ) {
23 0           return $_deps->{$kind};
24             }
25 0           return $_deps;
26             }
27              
28             sub _js_dist {
29 0     0     return _deps("_js_dist");
30             }
31              
32             sub _css_dist {
33 0     0     return _deps("_css_dist");
34             }
35              
36             1;
37              
38             __END__