| 1 | package App::Critique::Session::File; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 3 | our $VERSION = '0.03'; | |||||||||||||||||||||||||||
| 7 | 3 | our $AUTHORITY = 'cpan:STEVAN'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 3 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use Carp (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 3 | ▶ | use Path::Tiny (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | sub new { | ||||||||||||||||||||||||||||
| 15 | 2 | ▶ | my ($class, %args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=5 SCAR=17.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 2 | my $path = $args{path}; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 2 | ▶ | Carp::confess('You must supply a `path` argument') | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | unless defined $path; | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 2 | ▶ | $path = Path::Tiny::path( $path ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($path) and $path->isa("Path::Tiny")
MC/DC0%0/2
builtin::blessed($path) and $path->isa("Path::Tiny")
builtin::blessed($path)
$path->isa("Path::Tiny")
Truth table33%1/3
A and B
A= builtin::blessed($path)B= $path->isa("Path::Tiny")
| |||||||||||||||||||||||||||||
| 23 | unless Scalar::Util::blessed( $path ) | ||||||||||||||||||||||||||||
| 24 | && $path->isa('Path::Tiny'); | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | return bless { | ||||||||||||||||||||||||||||
| 27 | path => $path, | ||||||||||||||||||||||||||||
| 28 | meta => $args{meta} || {}, | ||||||||||||||||||||||||||||
| 29 | 2 | ▶ | } => $class; | ||||||||||||||||||||||||||
|
Condition100%2/2
$args{'meta'} || {}
MC/DC100%1/1
$args{'meta'} || {}
$args{'meta'}
Truth table100%2/2
A
A= $args{'meta'}
| |||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | # accessors | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 2 | ▶ | sub path { $_[0]->{path} } | ||||||||||||||||||||||||||
|
Subroutine
path: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub meta { $_[0]->{meta} } | ||||||||||||||||||||||||||
|
Subroutine
meta: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | sub remember { | ||||||||||||||||||||||||||||
| 38 | 2 | ▶ | my ($self, $key, $value) = @_; | ||||||||||||||||||||||||||
|
Subroutine
remember: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 39 | 2 | $self->{meta}->{ $key } = $value; | |||||||||||||||||||||||||||
| 40 | 2 | return; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | sub recall { | ||||||||||||||||||||||||||||
| 44 | 3 | ▶ | my ($self, $key) = @_; | ||||||||||||||||||||||||||
|
Subroutine
recall: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 45 | 3 | return $self->{meta}->{ $key }; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | sub forget { | ||||||||||||||||||||||||||||
| 49 | 1 | ▶ | my ($self, $key) = @_; | ||||||||||||||||||||||||||
|
Subroutine
forget: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 50 | 1 | return delete $self->{meta}->{ $key }; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | sub forget_all { | ||||||||||||||||||||||||||||
| 54 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||
|
Subroutine
forget_all: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 55 | $self->{meta} = {} | ||||||||||||||||||||||||||||
| 56 | 0 | } | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | # ... | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | sub relative_path { | ||||||||||||||||||||||||||||
| 61 | 0 | ▶ | my ($self, $path) = @_; | ||||||||||||||||||||||||||
|
Subroutine
relative_path: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 62 | 0 | return $self->{path}->relative( $path ); | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | # ... | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | sub pack { | ||||||||||||||||||||||||||||
| 68 | 4 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||
|
Subroutine
pack: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 69 | return { | ||||||||||||||||||||||||||||
| 70 | path => $self->{path}->stringify, | ||||||||||||||||||||||||||||
| 71 | meta => $self->{meta}, | ||||||||||||||||||||||||||||
| 72 | 4 | }; | |||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | sub unpack { | ||||||||||||||||||||||||||||
| 76 | 1 | ▶ | my ($class, $data) = @_; | ||||||||||||||||||||||||||
|
Subroutine
unpack: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 77 | 1 | return $class->new( %$data ); | |||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | 3 | 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.03 | ||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||