File Coverage

blib/lib/CAD/AutoCAD/Version.pm
Criterion Covered Total %
statement 27 27 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 3 3 100.0
total 37 37 100.0


line stmt bran cond sub pod time code
1             package CAD::AutoCAD::Version;
2              
3 5     5   182183 use strict;
  5         11  
  5         204  
4 5     5   25 use warnings;
  5         9  
  5         356  
5              
6 5     5   3845 use Class::Utils qw(set_params);
  5         84498  
  5         120  
7 5     5   423 use Readonly;
  5         20  
  5         2896  
8              
9             # Constants.
10             # Based on https://autodesk.blogs.com/between_the_lines/autocad-release-history.html
11             Readonly::Hash my %ACADVER => (
12             # ACADVER => Version of AutoCAD
13             'MC0.0' => 'Version 1.1',
14             'AC1.2' => 'Version 1.2',
15             'AC1.3' => 'Version 1.3',
16             'AC1.40' => 'Version 1.4',
17             'AC1.50' => 'Version 2.05',
18             'AC2.10' => 'Version 2.10',
19             'AC2.21' => 'Version 2.21',
20             'AC2.22' => 'Version 2.22',
21             'AC1001' => 'Version 2.40',
22             'AC1002' => 'Version 2.50',
23             'AC1003' => 'Version 2.60',
24             'AC1004' => 'Release 9',
25             'AC1006' => 'Release 10',
26             'AC1009' => 'Release 11/12',
27             'AC1012' => 'Release 13',
28             'AC1013' => 'Release 13c3',
29             'AC1014' => 'Release 14',
30             'AC1500' => 'AutoCAD 2000 beta',
31             'AC1015' => 'AutoCAD 2000',
32             'AC1018' => 'AutoCAD 2004',
33             'AC1021' => 'AutoCAD 2007',
34             'AC1024' => 'AutoCAD 2010',
35             'AC1027' => 'AutoCAD 2013',
36             'AC1032' => 'AutoCAD 2018',
37             );
38              
39             our $VERSION = 0.06;
40              
41             # Constructor.
42             sub new {
43 5     5 1 1080599 my ($class, @params) = @_;
44              
45             # Create object.
46 5         14 my $self = bless {}, $class;
47              
48             # Process params.
49 5         70 set_params($self, @params);
50              
51             # Object.
52 3         29 return $self;
53             }
54              
55             sub list_of_acad_identifiers {
56 1     1 1 6 my $self = shift;
57              
58 1         10 return keys %ACADVER;
59             }
60              
61             sub list_of_acad_identifiers_real {
62 1     1 1 8 my $self = shift;
63              
64 1         13 my @mcs = sort grep { $_ =~ m/^MC/ms } keys %ACADVER;
  24         156  
65 1         10 my @ac_dot = sort grep { $_ =~ m/^AC\d+\.\d+$/ms } keys %ACADVER;
  24         149  
66 1         10 my @ac = sort grep { $_ =~ m/^AC\d+$/ms } keys %ACADVER;
  24         157  
67              
68 1         13 my @ids = (@mcs, @ac_dot, @ac);
69              
70 1         10 return @ids;
71             }
72              
73             1;
74              
75             __END__