FindApp/Git.pm

filter: Statementstmt 87.0% 47 / 54 Branchbran 62.5% 5 / 8 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 92.8% 13 / 14 Podpod 100% 5 / 5 totaltotal 82.5% 71 / 86 CC 7 SCAR 8.4
CC
7
Cov
82%
shell_settings
6.0
export_root_to_env
3.8
copy
3.0
CRAP 2.3
« FindApp/Object/State.pm ↑ Summary FindApp/Object/State/Group/Class.pm »
1 package FindApp::Git;
2  
3 3 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use mro "c3";
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 ▶use parent qw(FindApp);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use FindApp::Vars qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use FindApp::Utils qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 8 ▶sub init { &ENTER_TRACE;
Subroutine init: called CC=1 SCAR=0.0
Pod documented
14 8 my($self) = @_;
15 8 $self->next::method;
16 8 debug "adding .git/ dir";
17 8 $self->add_rootdir_wanted(".git/");
18 8 $self->export_git_dir(0);
19 }
20  
21 6 ▶sub copy { &ENTER_TRACE;
Subroutine copy: called CC=3 SCAR=11.0
Pod documented
22 6 my($to, $from) = @_;
23 6 $to->next::method($from);
24 6 ▶ $from->can($_) && $to->$_($from->$_) for "export_git_dir";
Branch: 1 branch
BranchTrueFalseTotal
$from->can($_) and $to->$_($from->$_) 5 1 6
25 6 return $to;
26 }
27  
28 # This overrides the FindApp::Object::Behavior method,
29 # *not* the FindApp::Object::State::Group method.
30 # We're a FindApp object, not a group object.
31 2 ▶sub export_root_to_env { &ENTER_TRACE;
Subroutine export_root_to_env: called CC=3 SCAR=13.5
Pod documented
32 2 my $self = &myself;
33 2 $self->next::method(@_);
34 2 ▶ if ($Root && $self->export_git_dir) {
Branch: 1 branch
BranchTrueFalseTotal
if ($FindApp::Git::Root and $self->export_git_dir) 0 2 2
Condition33%1/3
$FindApp::Git::Root and $self->export_git_dir
!ll&&!rl&&r
020
MC/DC0%0/2
$FindApp::Git::Root and $self->export_git_dir
$FindApp::Git::Root $self->export_git_dir
Truth table33%1/3
A and B
A= $FindApp::Git::RootB= $self->export_git_dir
ABresult
0X0
100
111
35 0 $GIT_DIR = $Root;
36 0 $self->rootdir->bump_exports;
37 }
38 }
39  
40 0 ▶sub shell_settings { &ENTER_TRACE;
Subroutine shell_settings: not called CC=2 SCAR=17.9
Pod documented
41 0 my $self = &myself;
42 0 my $settings = $self->SUPER::shell_settings(@_);
43 0 ▶ $settings .= $self->show_shell_var(GIT_DIR => $Root) if $self->export_git_dir;
Branch: 1 branch
BranchTrueFalseTotal
if $self->export_git_dir 0 0 0
44 0 return $settings;
45 }
46  
47 ####################################
48 # Now our own methods.
49 ####################################
50  
51 3 ▶use pluskeys qw{
Subroutine BEGIN: called CC=1 SCAR=0.0
52 UNSAFE_EXPORT
53 3 };
54  
55 20 ▶sub export_git_dir { &ENTER_TRACE;
Subroutine export_git_dir: called CC=2 SCAR=6.9
Pod documented
56 20 my $self = &myself;
57 20 ▶ $self->{+UNSAFE_EXPORT} = !!shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 13 7 20
58 20 return $self->{+UNSAFE_EXPORT};
59 }
60  
61 3 __PACKAGE__->renew;
62  
63 3 1;
64  
65 =encoding utf8
66  
67 =head1 NAME
68  
69 FindApp::Git - FIXME
70  
71 =head1 SYNOPSIS
72  
73 use FindApp::Git;
74  
75 =head1 DESCRIPTION
76  
77 =head2 Pluskey Attributes
78  
79 These are always private; use the methods insteads.
80  
81 =over
82  
83 =item UNSAFE_EXPORT
84  
85 =back
86  
87 =head2 Public Methods
88  
89 =over
90  
91 =item copy
92  
93 =item export_git_dir
94  
95 =item export_root_to_env
96  
97 =item init
98  
99 =item shell_settings
100  
101 =back
102  
103 =head2 Exports
104  
105 =over
106  
107 =item FIXME
108  
109 =back
110  
111 =head1 EXAMPLES
112  
113 =head1 ENVIRONMENT
114  
115 =head1 SEE ALSO
116  
117 =over
118  
119 =item L<FindApp>
120  
121 =back
122  
123 =head1 CAVEATS AND PROVISOS
124  
125 =head1 BUGS AND LIMITATIONS
126  
127 =head1 HISTORY
128  
129 =head1 AUTHOR
130  
131 Tom Christiansen << <tchrist@perl.com> >>
132  
133 =head1 LICENCE AND COPYRIGHT
134  
135 Copyright (c) 2016, Tom Christiansen C<< <tchrist@perl.com> >>.
136 All Rights Reserved.
137  
138 This module is free software; you can redistribute it and/or
139 modify it under the same terms as Perl itself. See L<perlartistic>.
140  
141 =cut
142  
« FindApp/Object/State.pm ↑ Summary FindApp/Object/State/Group/Class.pm »