blib/lib/Code/TidyAll/CacheModel/Shared.pm

filter: Statementstmt 93.7% 15 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 91.3% 21 / 23 CC 1 SCAR 1.5
CC
1
Cov
94%
remove
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Code/TidyAll/Role/HasIgnore.pm ↑ Summary blib/lib/Code/TidyAll/Plugin/GenericTransformer.pm »
1 package Code::TidyAll::CacheModel::Shared;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 extends 'Code::TidyAll::CacheModel';
9  
10 1 our $VERSION = '0.83';
11  
12 sub _build_cache_key {
13 24 ▶ my $self = shift;
Subroutine _build_cache_key: called CC=1 SCAR=0.0
14 24 return $self->_sig(
15 [
16 $self->SUPER::_build_cache_key,
17 $self->file_contents
18 ]
19 );
20 }
21  
22 sub _build_cache_value {
23 16 ▶ return 1;
Subroutine _build_cache_value: called CC=1 SCAR=0.0
24 }
25  
26 sub remove {
27 0 ▶ return;
Subroutine remove: not called CC=1 SCAR=6.9
Pod documented
28 }
29  
30 1 1;
31  
32 # ABSTRACT: Shared cache model for Code::TidyAll
33  
34 __END__
35  
36 =pod
37  
38 =encoding UTF-8
39  
40 =head1 NAME
41  
42 Code::TidyAll::CacheModel::Shared - Shared cache model for Code::TidyAll
43  
44 =head1 VERSION
45  
46 version 0.83
47  
48 =head1 SYNOPSIS
49  
50 my $cta = Code::TidyAll->new(
51 cache_model_class => 'Code::TidyAll::CacheModel::Shared',
52 ...
53 );
54  
55 =head1 DESCRIPTION
56  
57 An alternative caching model for Code::TidyAll designed to work in shared build
58 systems / systems with lots of branches.
59  
60 This cache model uses both the file name and file contents to build the cache
61 key and a meaningless cache value. It does not care about the modification time
62 of the file.
63  
64 This allows you to share a cache when you might have several versions of a file
65 that you switch backwards and forwards between (e.g. when you're working on
66 several branches) and keep the cache values
67  
68 =head1 SUPPORT
69  
70 Bugs may be submitted at L<https://github.com/houseabsolute/perl-code-tidyall/issues>.
71  
72 =head1 SOURCE
73  
74 The source code repository for Code-TidyAll can be found at L<https://github.com/houseabsolute/perl-code-tidyall>.
75  
76 =head1 AUTHORS
77  
78 =over 4
79  
80 =item *
81  
82 Jonathan Swartz <swartz@pobox.com>
83  
84 =item *
85  
86 Dave Rolsky <autarch@urth.org>
87  
88 =back
89  
90 =head1 COPYRIGHT AND LICENSE
91  
92 This software is copyright (c) 2011 - 2022 by Jonathan Swartz.
93  
94 This is free software; you can redistribute it and/or modify it under
95 the same terms as the Perl 5 programming language system itself.
96  
97 The full text of the license can be found in the
98 F<LICENSE> file included with this distribution.
99  
100 =cut
« blib/lib/Code/TidyAll/Role/HasIgnore.pm ↑ Summary blib/lib/Code/TidyAll/Plugin/GenericTransformer.pm »