fffs 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -82,6 +82,12 @@ class Directory < Hash
82
82
  }
83
83
  end
84
84
 
85
+ alias __path path
86
+
87
+ def path
88
+ "#{__path}/".sub(%r{/*/}, '/')
89
+ end
90
+
85
91
  def inspect
86
92
  output = "#{self.path}\n"
87
93
 
@@ -59,10 +59,10 @@ class FileSystem < Directory
59
59
  self << File.new(name, content)
60
60
  end
61
61
  else
62
- into = nil
62
+ into = self
63
63
 
64
64
  path.split('/').each {|dir|
65
- into = self[dir] || (self << Directory.new(dir))
65
+ into = into[dir] || (into << Directory.new(dir))
66
66
  }
67
67
 
68
68
  if link
@@ -29,7 +29,7 @@ module Node
29
29
  current = current.parent
30
30
  end while current != current.parent
31
31
 
32
- "/#{path.reverse.join('/')}/".sub(%r{/*/}, '/')
32
+ "/#{path.reverse.join('/')}".sub(%r{/*/}, '/')
33
33
  end
34
34
  end
35
35
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - meh.