Assets/Output.pm

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