Formula/Config.pm

filter: Statementstmt 92.3% 24 / 26 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 83.3% 5 / 6 totaltotal 84.7% 39 / 46 CC 3 SCAR 5.3
CC
3
Cov
87%
init
3.1
save
2.0
load
2.0
CRAP 1.7
« Formula/Token.pm ↑ Summary
1 # This code is part of Perl distribution Math-Formula version 0.18.
2 # The POD got stripped from this file by OODoc version 3.03.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2023-2025 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11 #oodist: *** DO NOT USE THIS VERSION FOR PRODUCTION ***
12 #oodist: This file contains OODoc-style documentation which will get stripped
13 #oodist: during its release in the distribution. You can use this file for
14 #oodist: testing, however the code of this development version may be broken!
15  
16 package Math::Formula::Config;{
17 2 our $VERSION = '0.18';
18 }
19  
20  
21 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 2 ▶use Log::Report qw/math-formula/;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 2 ▶use File::Spec ();
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 #--------------------
29  
30 1 ▶sub new(%) { my $class = shift; (bless {}, $class)->init({@_}) }
Subroutine new: called CC=1 SCAR=0.0
Pod documented
31  
32 sub init($)
33 1 ▶{ my ($self, $args) = @_;
Subroutine init: called CC=3 SCAR=11.4
Pod undocumented
34 my $dir = $self->{MFC_dir} = $args->{directory}
35 1 ▶ or error __x"Save directory required";
Branch: 1 branch
BranchTrueFalseTotal
my $dir = $self->{"MFC_dir"} = $args->{"directory"} or &error(&__x("Save directory required")) 1 0 1
36  
37 1 ▶ -d $dir
Branch: 1 branch
BranchTrueFalseTotal
-d $dir or &error(&__x("Save directory '{dir}' does not exist", "dir", $dir)) 1 0 1
38 or error __x"Save directory '{dir}' does not exist", dir => $dir;
39  
40 1 $self;
41 }
42  
43 #--------------------
44  
45 3 ▶sub directory { $_[0]->{MFC_dir} }
Subroutine directory: called CC=1 SCAR=0.0
Pod documented
46  
47  
48 sub path_for($$)
49 3 ▶{ my ($self, $file) = @_;
Subroutine path_for: called CC=1 SCAR=0.0
Pod documented
50 3 File::Spec->catfile($self->directory, $file);
51 }
52  
53 #--------------------
54  
55 0 ▶sub save($%) { ... }
Subroutine save: not called CC=1 SCAR=6.9
Pod documented
56  
57  
58 0 ▶sub load($%) { ... }
Subroutine load: not called CC=1 SCAR=6.9
Pod documented
59  
60 2 1;
« Formula/Token.pm ↑ Summary