Browse Source

Added method to construct full path from source path

Alois Mahdal 11 years ago
parent
commit
f71397bceb
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      lib/SugarTrail/Repo/Filesystem.pm

+ 7
- 1
lib/SugarTrail/Repo/Filesystem.pm View File

24
     return bless $self, $class;
24
     return bless $self, $class;
25
 }
25
 }
26
 
26
 
27
+sub _get_filename {
28
+    my $self = shift;
29
+    my $source = shift;
30
+    return $self->{root} . $source;
31
+}
32
+
27
 sub load_text {
33
 sub load_text {
28
     my $self = shift;
34
     my $self = shift;
29
     my $source = shift;
35
     my $source = shift;
30
 
36
 
31
     # load
37
     # load
32
-    my $fn = $self->{root} . $source;
38
+    my $fn = $self->_get_filename($source);
33
     my $fh;
39
     my $fh;
34
     unless (open $fh, "<", $fn) {
40
     unless (open $fh, "<", $fn) {
35
         $self->{last_error} = "cannot open master $fn for reading: $!";
41
         $self->{last_error} = "cannot open master $fn for reading: $!";