File Coverage

blib/lib/Lingua/YaTeA/File.pm
Criterion Covered Total %
statement 24 24 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod 5 5 100.0
total 38 38 100.0


line stmt bran cond sub pod time code
1             package Lingua::YaTeA::File;
2 5     5   28 use strict;
  5         7  
  5         116  
3 5     5   20 use warnings;
  5         8  
  5         1160  
4              
5             our $VERSION=$Lingua::YaTeA::VERSION;
6              
7              
8             sub new
9             {
10 70     70 1 109 my ($class,$repository,$name) = @_;
11 70         91 my $this = {};
12 70         98 bless ($this,$class);
13 70         118 $this->{INTERNAL_NAME} = ();
14 70         94 $this->{FULL_NAME} = $name;
15 70         145 $this->{PATH} = $repository . "/" . $this->{FULL_NAME};
16 70         141 $this->setInternalName;
17 70         125 return $this;
18             }
19              
20              
21              
22             sub getPath
23             {
24 52     52 1 83 my ($this) = @_;
25 52         623 return $this->{PATH};
26             }
27              
28             sub getFullName
29             {
30 119     119 1 139 my ($this) = @_;
31 119         293 return $this->{FULL_NAME};
32             }
33              
34             sub getInternalName
35             {
36 70     70 1 95 my ($this) = @_;
37 70         208 return $this->{INTERNAL_NAME};
38             }
39              
40             sub setInternalName
41             {
42 70     70 1 90 my ($this) = @_;
43            
44 70 100       96 if($this->getFullName =~ /^(.+)\.[^\.]+$/)
45             {
46 21         54 $this->{INTERNAL_NAME} = $1;
47             }
48             else
49             {
50 49         78 $this->{INTERNAL_NAME} = $this->getFullName;
51             }
52            
53             }
54              
55             1;
56              
57              
58             __END__