Pārlūkot izejas kodu

Added method to construct full path from source path

Alois Mahdal 11 gadus atpakaļ
vecāks
revīzija
f71397bceb
1 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 7
    1
      lib/SugarTrail/Repo/Filesystem.pm

+ 7
- 1
lib/SugarTrail/Repo/Filesystem.pm Parādīt failu

@@ -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: $!";