File Coverage

lib/Draft.pm
Criterion Covered Total %
statement 9 12 75.0
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 19 63.1


line stmt bran cond sub pod time code
1             package Draft;
2              
3             =head1 NAME
4              
5             Draft - CAD directory-based file format demo
6              
7             =head1 SYNOPSIS
8              
9             This is just a demonstration, nobody in their right-mind would go
10             and create GUI CAD applications in perl.
11              
12             =head1 DESCRIPTION
13              
14             An implementation of "An open file format for Computer Aided Design (CAD)"
15              
16             L
17              
18             =head1 USAGE
19              
20             $Draft::PATH = '/path/to.drawing/';
21             Draft->Read;
22              
23             The 'Draft' module itself is mainly used to bootstrap the
24             world-space that drawings are loaded into - This is accessible via
25             the package variable $Draft::WORLD.
26              
27             =cut
28              
29 1     1   17346 use strict;
  1         2  
  1         34  
30 1     1   5 use warnings;
  1         2  
  1         29  
31 1     1   501 use Draft::Drawing;
  1         4  
  1         214  
32              
33             our $VERSION = '0.06';
34             our $WORLD = undef;
35             our $PATH = undef;
36              
37             sub Read
38             {
39 0     0 0   $PATH =~ s/\/*$/\//;
40 0 0         $WORLD->{$PATH} = Draft::Drawing->new ($PATH)
41             unless exists $WORLD->{$PATH};
42              
43 0           $WORLD->{$PATH}->Read;
44             }
45              
46             1;