textconv/git.pm

filter: Statementstmt 82.3% 14 / 17 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 60.0% 18 / 30 CC 3 SCAR 17.4
CC
3
Cov
64%
is_git_object
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.7
« textconv.pm ↑ Summary textconv/pdf.pm »
1 package App::optex::textconv::git;
2  
3 1 our $VERSION = '1.08';
4  
5 =encoding utf-8
6  
7 =head1 NAME
8  
9 textconv::git - optex::textconv submodule to handle git arguments
10  
11 =head1 VERSION
12  
13 Version 1.08
14  
15 =head1 SYNOPSIS
16  
17 optex -Mtextconv::load=git command
18  
19 =head1 DESCRIPTION
20  
21 This is a submodule for L<App::optex::textconv> to handle GIT
22 arguments. You don't have to call it explicitly.
23  
24 =head1 OPTIONS
25  
26 =head1 SEE ALSO
27  
28 L<https://github.com/kaz-utashiro/optex>
29  
30 L<https://github.com/kaz-utashiro/optex-textconv>
31  
32 =head1 AUTHOR
33  
34 Kazumasa Utashiro
35  
36 =head1 LICENSE
37  
38 Copyright 2023 Kazumasa Utashiro.
39  
40 This library is free software; you can redistribute it and/or modify
41 it under the same terms as Perl itself.
42  
43 =cut
44  
45 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
46 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
47 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
48  
49 1 ▶use App::optex::textconv::Converter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
50  
51 1 our @CONVERTER = (
52 [ \&is_git_object => 'git show "%s"' ],
53 );
54  
55 1 1;
56  
57 0 ▶sub is_git_object {
Subroutine is_git_object: not called CC=3 SCAR=24.8
Pod undocumented
58 0 ▶ /.+:(?<path>.+)/ and -e $+{path} or return;
Branch: 1 branch
BranchTrueFalseTotal
/.+:(?<path>.+)/u and -e $+{"path"} or return 0 0 0
Condition0%0/3
/.+:(?<path>.+)/u and -e $+{"path"}
!ll&&!rl&&r
000
MC/DC0%0/2
/.+:(?<path>.+)/u and -e $+{"path"}
/.+:(?<path>.+)/u -e $+{"path"}
Truth table0%0/3
A and B
A= /.+:(?<path>.+)/uB= -e $+{"path"}
ABresult
0X0
100
111
59 0 my $ans = `git rev-parse $_ 2>&1`;
60 0 $? == 0;
61 }
62  
63 __DATA__
« textconv.pm ↑ Summary textconv/pdf.pm »