File Coverage

blib/lib/Rails/Assets/Output.pm
Criterion Covered Total %
statement 38 38 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 44 44 100.0


line stmt bran cond sub pod time code
1             package Rails::Assets::Output {
2              
3 1     1   426   use 5.006;
  1         3  
4 1     1   4   use strict;
  1         2  
  1         16  
5 1     1   4   use warnings;
  1         1  
  1         38  
6              
7               our $VERSION = '0.01';
8 1     1   5   use Exporter qw(import);
  1         9  
  1         360  
9               our @EXPORT = qw(
10             tell_output
11             );
12              
13               sub tell_output {
14 1     1 1 1443     my $assets = shift;
15 1         2     foreach my $key (sort keys %{$assets->assets_hash()}) {
  1         4  
16 4         20       print "My $key files are:" . scalar @{$assets->assets_hash()->{$key}} . "\n";
  4         7  
17 4         63       foreach (sort { "\L$a->{name}" cmp "\L$b->{name}" } @{$assets->assets_hash()->{$key}}){
  1         6  
  4         8  
18 4         27         print "- $_->{name} ($_->{full_path})" . "\n";
19                   };
20 4         13       print "My $key references are:" . scalar @{$assets->template_hash()->{$key}} . "\n";
  4         7  
21 4         27       foreach (sort { "\L$a->{name}" cmp "\L$b->{name}" } @{$assets->template_hash()->{$key}}){
  1         6  
  4         8  
22 3         18         print "- $_->{name} ($_->{full_path})" . "\n";
23                   };
24 4         13       print "My $key .scss references are:" . scalar @{$assets->scss_hash()->{$key}} . "\n";
  4         8  
25 4         25       foreach (sort { "\L$a->{name}" cmp "\L$b->{name}" } @{$assets->scss_hash()->{$key}}){
  1         8  
  4         8  
26 2         15         print "- $_->{name} ($_->{referral})" . "\n";
27                   };
28 4         15       print "My $key .js references are:" . scalar @{$assets->map_hash()->{$key}} . "\n";
  4         8  
29 4         25       foreach (sort { "\L$a->{name}" cmp "\L$b->{name}" } @{$assets->map_hash()->{$key}}){
  1         5  
  4         7  
30 2         11         print "- $_->{name} ($_->{referral})" . "\n";
31                   };
32                 }
33               }
34              
35             }
36              
37             =head1 NAME
38            
39             Rails::Assets::Output - Output functions for verbose and output mode
40            
41             =head1 VERSION
42            
43             Version 0.02
44            
45             =head1 SYNOPSIS
46            
47             use Rails::Assets;
48             use Rails::Assets::Output;
49            
50             my $assets = Rails::Assets->new();
51             $assets->analyse();
52             tell_output($assets);
53             ...
54            
55             =head1 EXPORT
56            
57             =head2 tell_output
58            
59             =head1 SUBROUTINES/METHODS
60            
61             =head1 AUTHOR
62            
63             Mauro Berlanda, C<< <kupta at cpan.org> >>
64            
65             =head1 BUGS
66            
67             Please report any bugs or feature requests to C<bug-. at rt.cpan.org>, or through
68             the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=.>. I will be notified, and then you'll
69             automatically be notified of progress on your bug as I make changes.
70            
71             =head1 SUPPORT
72            
73             You can find documentation for this module with the perldoc command.
74            
75             perldoc Rails::Assets::Output
76            
77             You can also look for information at:
78            
79             =over 4
80            
81             =item * RT: CPAN's request tracker (report bugs here)
82            
83             L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=.>
84            
85             =item * AnnoCPAN: Annotated CPAN documentation
86            
87             L<http://annocpan.org/dist/.>
88            
89             =item * CPAN Ratings
90            
91             L<http://cpanratings.perl.org/d/.>
92            
93             =item * Search CPAN
94            
95             L<http://search.cpan.org/dist/./>
96            
97             =back
98            
99             =head1 ACKNOWLEDGEMENTS
100            
101             =head1 LICENSE AND COPYRIGHT
102            
103             Copyright 2017 Mauro Berlanda.
104            
105             This program is free software; you can redistribute it and/or modify it
106             under the terms of the the Artistic License (2.0). You may obtain a
107             copy of the full license at:
108            
109             L<http://www.perlfoundation.org/artistic_license_2_0>
110            
111             Any use, modification, and distribution of the Standard or Modified
112             Versions is governed by this Artistic License. By using, modifying or
113             distributing the Package, you accept this license. Do not use, modify,
114             or distribute the Package, if you do not accept this license.
115            
116             If your Modified Version has been derived from a Modified Version made
117             by someone other than you, you are nevertheless required to ensure that
118             your Modified Version complies with the requirements of this license.
119            
120             This license does not grant you the right to use any trademark, service
121             mark, tradename, or logo of the Copyright Holder.
122            
123             This license includes the non-exclusive, worldwide, free-of-charge
124             patent license to make, have made, use, offer to sell, sell, import and
125             otherwise transfer the Package with respect to any patent claims
126             licensable by the Copyright Holder that are necessarily infringed by the
127             Package. If you institute patent litigation (including a cross-claim or
128             counterclaim) against any party alleging that the Package constitutes
129             direct or contributory patent infringement, then this Artistic License
130             to you shall terminate on the date that such litigation is filed.
131            
132             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
133             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
134             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
135             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
136             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
137             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
138             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
139             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
140            
141             =cut
142              
143             1; # End of Rails::Assets::Output
144