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,12 +24,18 @@ sub new {
24 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 33
 sub load_text {
28 34
     my $self = shift;
29 35
     my $source = shift;
30 36
 
31 37
     # load
32
-    my $fn = $self->{root} . $source;
38
+    my $fn = $self->_get_filename($source);
33 39
     my $fh;
34 40
     unless (open $fh, "<", $fn) {
35 41
         $self->{last_error} = "cannot open master $fn for reading: $!";