line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Critique::Session::File; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
49
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
82
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:STEVAN'; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
10
|
use Scalar::Util (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
27
|
|
10
|
2
|
|
|
2
|
|
8
|
use Carp (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
26
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
9
|
use Path::Tiny (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
561
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
0
|
|
|
0
|
0
|
|
my ($class, %args) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $path = $args{path}; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
Carp::confess('You must supply a `path` argument') |
20
|
|
|
|
|
|
|
unless defined $path; |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
0
|
|
|
|
$path = Path::Tiny::path( $path ) |
23
|
|
|
|
|
|
|
unless Scalar::Util::blessed( $path ) |
24
|
|
|
|
|
|
|
&& $path->isa('Path::Tiny'); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
return bless { |
27
|
|
|
|
|
|
|
path => $path, |
28
|
|
|
|
|
|
|
meta => $args{meta} || {}, |
29
|
0
|
|
0
|
|
|
|
} => $class; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# accessors |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
0
|
0
|
|
sub path { $_[0]->{path} } |
35
|
0
|
|
|
0
|
0
|
|
sub meta { $_[0]->{meta} } |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub remember { |
38
|
0
|
|
|
0
|
0
|
|
my ($self, $key, $value) = @_; |
39
|
0
|
|
|
|
|
|
$self->{meta}->{ $key } = $value; |
40
|
0
|
|
|
|
|
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub recall { |
44
|
0
|
|
|
0
|
0
|
|
my ($self, $key) = @_; |
45
|
0
|
|
|
|
|
|
return $self->{meta}->{ $key }; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub forget { |
49
|
0
|
|
|
0
|
0
|
|
my ($self, $key) = @_; |
50
|
0
|
|
|
|
|
|
return delete $self->{meta}->{ $key }; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub forget_all { |
54
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
55
|
|
|
|
|
|
|
$self->{meta} = {} |
56
|
0
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# ... |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub relative_path { |
61
|
0
|
|
|
0
|
0
|
|
my ($self, $path) = @_; |
62
|
0
|
|
|
|
|
|
return $self->{path}->relative( $path ); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# ... |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub pack { |
68
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
69
|
|
|
|
|
|
|
return { |
70
|
|
|
|
|
|
|
path => $self->{path}->stringify, |
71
|
|
|
|
|
|
|
meta => $self->{meta}, |
72
|
0
|
|
|
|
|
|
}; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub unpack { |
76
|
0
|
|
|
0
|
0
|
|
my ($class, $data) = @_; |
77
|
0
|
|
|
|
|
|
return $class->new( %$data ); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=pod |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 NAME |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
App::Critique::Session::File - Information about file processed by App::Critique |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 VERSION |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
version 0.05 |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 DESCRIPTION |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This class holds information about files that have been processed |
96
|
|
|
|
|
|
|
by L<App::Critique> and contains no real user serviceable parts. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 AUTHOR |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Stevan Little <stevan@cpan.org> |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Stevan Little. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
107
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=cut |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
__END__ |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
# ABSTRACT: Information about file processed by App::Critique |
114
|
|
|
|
|
|
|
|