File Coverage

blib/lib/Code/TidyAll/CacheModel/Shared.pm
Criterion Covered Total %
statement 12 13 92.3
branch n/a
condition n/a
subroutine 5 6 83.3
pod 1 1 100.0
total 18 20 90.0


line stmt bran cond sub pod time code
1             package Code::TidyAll::CacheModel::Shared;
2              
3 1     1   35696 use strict;
  1         11  
  1         29  
4 1     1   5 use warnings;
  1         2  
  1         37  
5              
6 1     1   592 use Moo;
  1         12991  
  1         4  
7              
8             extends 'Code::TidyAll::CacheModel';
9              
10             our $VERSION = '0.83';
11              
12             sub _build_cache_key {
13 12     12   108 my $self = shift;
14 12         37 return $self->_sig(
15             [
16             $self->SUPER::_build_cache_key,
17             $self->file_contents
18             ]
19             );
20             }
21              
22             sub _build_cache_value {
23 8     8   378 return 1;
24             }
25              
26             sub remove {
27 0     0 1   return;
28             }
29              
30             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