lib/build/files/path.rb in build-files-1.7.0 vs lib/build/files/path.rb in build-files-1.7.1

- old
+ new

@@ -108,10 +108,12 @@ def length @full_path.length end + alias size length + def components @components ||= @full_path.split(File::SEPARATOR).freeze end def basename @@ -121,9 +123,13 @@ def parent root = @root full_path = File.dirname(@full_path) while root.size > full_path.size + root = Path.root(root) + end + + if root.size == full_path.size root = Path.root(root) end self.class.new(full_path, root) end