| 1 | package Web::PerlDistSite::Common; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | our $VERSION = '0.001010'; | |||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use v5.26; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Type::Params qw( -sigs ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use YAML::PP; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Types::Common (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Path::Tiny qw( path ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use HTML::HTML5::Entities (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 2 | use Exporter::Almighty -setup => { | |||||||||||||||||||||||||||
| 13 | tag => { | ||||||||||||||||||||||||||||
| 14 | sigs => [ 'signature', 'signature_for' ], | ||||||||||||||||||||||||||||
| 15 | path => [ 'path' ], | ||||||||||||||||||||||||||||
| 16 | html => [ 'esc_html' ], | ||||||||||||||||||||||||||||
| 17 | }, | ||||||||||||||||||||||||||||
| 18 | const => { | ||||||||||||||||||||||||||||
| 19 | booleans => { true => !!1, false => !!0 }, | ||||||||||||||||||||||||||||
| 20 | }, | ||||||||||||||||||||||||||||
| 21 | type => [ | ||||||||||||||||||||||||||||
| 22 | 'Types::Common', | ||||||||||||||||||||||||||||
| 23 | ], | ||||||||||||||||||||||||||||
| 24 | class => [ | ||||||||||||||||||||||||||||
| 25 | 'Path::Tiny', | ||||||||||||||||||||||||||||
| 26 | ], | ||||||||||||||||||||||||||||
| 27 | also => [ | ||||||||||||||||||||||||||||
| 28 | 'strict', | ||||||||||||||||||||||||||||
| 29 | 'warnings', | ||||||||||||||||||||||||||||
| 30 | 'feature' => [ 'state' ], | ||||||||||||||||||||||||||||
| 31 | 'experimental' => [ 'signatures' ], | ||||||||||||||||||||||||||||
| 32 | ], | ||||||||||||||||||||||||||||
| 33 | 2 | ▶ | }; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 2 | PathTiny->coercion->add_type_coercions( | |||||||||||||||||||||||||||
| 36 | Types::Common::Str, q{ Path::Tiny::path( $_ ) }, | ||||||||||||||||||||||||||||
| 37 | ); | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 2 | *esc_html = \&HTML::HTML5::Entities::encode_entities; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | sub Path::Tiny::spew_if_changed { | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | my ( $self, $content ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
spew_if_changed: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | my $orig = $self->exists ? $self->slurp_utf8 : \0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 44 | 0 | ▶ | if ( ref $orig or $orig ne $content ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $orig or $orig ne $content
MC/DC0%0/2
ref $orig or $orig ne $content
ref $orig
$orig ne $content
Truth table0%0/3
A or B
A= ref $origB= $orig ne $content
| |||||||||||||||||||||||||||||
| 45 | 0 | $self->spew_utf8( $content ); | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | 0 | return $self; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 2 | 1; | |||||||||||||||||||||||||||