Selaa lähdekoodia

Added method to construct full path from source path

Alois Mahdal 11 vuotta sitten
vanhempi
commit
f71397bceb
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7
    1
      lib/SugarTrail/Repo/Filesystem.pm

+ 7
- 1
lib/SugarTrail/Repo/Filesystem.pm Näytä tiedosto

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