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   17 use strict;
  3         6  
  3         116  
4 3     3   18 use warnings;
  3         8  
  3         69  
5 3     3   14 use JSON;
  3         5  
  3         21  
6 3     3   348 use File::ShareDir;
  3         6  
  3         98  
7 3     3   14 use Path::Tiny;
  3         25  
  3         562  
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__