File Coverage

blib/lib/Data/Context/Loader/File/JS.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             package Data::Context::Loader::File::JS;
2              
3             # Created on: 2013-10-29 17:34:33
4             # Create by: Ivan Wills
5             # $Id$
6             # $Revision$, $HeadURL$, $Date$
7             # $Revision$, $Source$, $Date$
8              
9 2     2   14887 use Moose;
  2         4  
  2         19  
10 2     2   10927 use version;
  2         4  
  2         17  
11 2     2   123 use Carp;
  2         3  
  2         157  
12 2     2   9 use Data::Dumper qw/Dumper/;
  2         3  
  2         89  
13 2     2   9 use English qw/ -no_match_vars /;
  2         3  
  2         21  
14              
15             our $VERSION = version->new('0.1.10');
16              
17             extends 'Data::Context::Loader::File';
18              
19             has '+module' => (
20             default => 'JSON',
21             );
22              
23             sub loader {
24 2     2 1 443 my ($self, $file) = @_;
25 2         91 return JSON->new->utf8->relaxed->shrink->decode($file);
26             }
27              
28             1;
29              
30             __END__
31              
32             =head1 NAME
33              
34             Data::Context::Loader::File::JS - <One-line description of module's purpose>
35              
36             =head1 VERSION
37              
38             This documentation refers to Data::Context::Loader::File::JS version 0.1.10
39              
40             =head1 SYNOPSIS
41              
42             use Data::Context::Loader::File::JS;
43              
44             # Brief but working code example(s) here showing the most common usage(s)
45             # This section will be as far as many users bother reading, so make it as
46             # educational and exemplary as possible.
47              
48             =head1 DESCRIPTION
49              
50             =head1 SUBROUTINES/METHODS
51              
52             =head2 C<loader ($file)>
53              
54             Loads the file as loose JSON
55              
56             =head1 DIAGNOSTICS
57              
58             =head1 CONFIGURATION AND ENVIRONMENT
59              
60             =head1 DEPENDENCIES
61              
62             =head1 INCOMPATIBILITIES
63              
64             =head1 BUGS AND LIMITATIONS
65              
66             There are no known bugs in this module.
67              
68             Please report problems to Ivan Wills (ivan.wills@gmail.com).
69              
70             Patches are welcome.
71              
72             =head1 AUTHOR
73              
74             Ivan Wills - (ivan.wills@gmail.com)
75              
76             =head1 LICENSE AND COPYRIGHT
77              
78             Copyright (c) 2013 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
79             All rights reserved.
80              
81             This module is free software; you can redistribute it and/or modify it under
82             the same terms as Perl itself. See L<perlartistic>. This program is
83             distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
84             without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
85             PARTICULAR PURPOSE.
86              
87             =cut