| 1 | ##---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 2 | ## Changes file management - ~/lib/Changes/NewLine.pm | ||||||||||||||||||||||||||||
| 3 | ## Version v0.1.0 | ||||||||||||||||||||||||||||
| 4 | ## Copyright(c) 2022 DEGUEST Pte. Ltd. | ||||||||||||||||||||||||||||
| 5 | ## Author: Jacques Deguest <jack@deguest.jp> | ||||||||||||||||||||||||||||
| 6 | ## Created 2022/12/08 | ||||||||||||||||||||||||||||
| 7 | ## Modified 2022/12/08 | ||||||||||||||||||||||||||||
| 8 | ## All rights reserved | ||||||||||||||||||||||||||||
| 9 | ## | ||||||||||||||||||||||||||||
| 10 | ## | ||||||||||||||||||||||||||||
| 11 | ## This program is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||
| 12 | ## under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 13 | ##---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 14 | package Changes::NewLine; | ||||||||||||||||||||||||||||
| 15 | BEGIN | ||||||||||||||||||||||||||||
| 16 | 11 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | 11 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 11 | ▶ | use parent qw( Module::Generic ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 11 | ▶ | use vars qw( $VERSION ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | 11 | our $VERSION = 'v0.1.0'; | |||||||||||||||||||||||||||
| 22 | }; | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 25 | 11 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | sub init | ||||||||||||||||||||||||||||
| 28 | 26 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||
| 29 | 26 | my $self = shift( @_ ); | |||||||||||||||||||||||||||
| 30 | 26 | $self->{nl} = "\n"; | |||||||||||||||||||||||||||
| 31 | 26 | $self->{raw} = undef; | |||||||||||||||||||||||||||
| 32 | 26 | $self->{_init_strict_use_sub} = 1; | |||||||||||||||||||||||||||
| 33 | 26 | ▶ | $self->SUPER::init( @_ ) || return( $self->pass_error ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 26 | return( $self ); | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | sub as_string | ||||||||||||||||||||||||||||
| 38 | 27 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||||||||||||||||||||
| 39 | 27 | my $self = shift( @_ ); | |||||||||||||||||||||||||||
| 40 | 27 | my $raw = $self->raw; | |||||||||||||||||||||||||||
| 41 | 27 | ▶ | if( defined( $raw ) && $raw->defined ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $raw and $raw->defined
MC/DC50%1/2
defined $raw and $raw->defined
defined $raw
$raw->defined
Truth table66%2/3
A and B
A= defined $rawB= $raw->defined
| |||||||||||||||||||||||||||||
| 42 | { | ||||||||||||||||||||||||||||
| 43 | 21 | return( $raw ); | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | else | ||||||||||||||||||||||||||||
| 46 | { | ||||||||||||||||||||||||||||
| 47 | 6 | ▶ | my $nl = $self->nl // "\n"; | ||||||||||||||||||||||||||
|
Condition50%1/2
$self->nl // "\n"
MC/DC0%0/1
$self->nl // "\n"
$self->nl
Truth table50%1/2
A
A= $self->nl
| |||||||||||||||||||||||||||||
| 48 | 6 | return( $self->new_scalar( "$nl" ) ); | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 23 | ▶ | sub line { return( shift->_set_get_number( 'line', @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
line: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 30 | ▶ | sub nl { return( shift->_set_get_scalar_as_object( 'nl', @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
nl: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 50 | ▶ | sub raw { return( shift->_set_get_scalar_as_object( 'raw', @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
raw: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 11 | 1; | |||||||||||||||||||||||||||
| 59 | # NOTE: POD | ||||||||||||||||||||||||||||
| 60 | __END__ | ||||||||||||||||||||||||||||