| 1 | package File::Find::Rule::DWG; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use base qw(File::Find::Rule); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use CAD::AutoCAD::Detect qw(detect_dwg_file); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 4 | our $VERSION = 0.02; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | # Detect DWG. | ||||||||||||||||||||||||||||
| 12 | sub File::Find::Rule::dwg { | ||||||||||||||||||||||||||||
| 13 | 1 | ▶ | my $file_find_rule = shift; | ||||||||||||||||||||||||||
|
Subroutine
dwg: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | 1 | my $self = $file_find_rule->_force_object; | |||||||||||||||||||||||||||
| 15 | return $self->file->exec(sub{ | ||||||||||||||||||||||||||||
| 16 | 4 | ▶ | my $file = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | 4 | return detect_dwg_file($file); | |||||||||||||||||||||||||||
| 18 | 1 | }); | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # Detect DWG magic. | ||||||||||||||||||||||||||||
| 22 | sub File::Find::Rule::dwg_magic { | ||||||||||||||||||||||||||||
| 23 | 1 | ▶ | my ($file_find_rule, $acad_magic) = @_; | ||||||||||||||||||||||||||
|
Subroutine
dwg_magic: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 24 | 1 | my $self = $file_find_rule->_force_object; | |||||||||||||||||||||||||||
| 25 | return $self->file->exec(sub{ | ||||||||||||||||||||||||||||
| 26 | 4 | ▶ | my $file = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 27 | 4 | my $detected_acad_magic = detect_dwg_file($file); | |||||||||||||||||||||||||||
| 28 | 4 | ▶ | if ($detected_acad_magic && $detected_acad_magic eq $acad_magic) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$detected_acad_magic and $detected_acad_magic eq $acad_magic
MC/DC100%2/2
$detected_acad_magic and $detected_acad_magic eq $acad_magic
$detected_acad_magic
$detected_acad_magic eq $acad_magic
Truth table100%3/3
A and B
A= $detected_acad_magicB= $detected_acad_magic eq $acad_magic
| |||||||||||||||||||||||||||||
| 29 | 1 | return 1; | |||||||||||||||||||||||||||
| 30 | } else { | ||||||||||||||||||||||||||||
| 31 | 3 | return 0; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | 1 | }); | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 4 | 1; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||||||||||