Method: TreeNode#dir_old
- Defined in:
- ext/ae-file-history/ae-file-history.rb
#dir_old(_path) ⇒ Object
def path
_path = @label
if @parent != nil
_path = @parent.path+_path
end
return _path
end
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'ext/ae-file-history/ae-file-history.rb', line 41 def dir_old(_path) node = nil parent = self sons.each{|_tree| if _path[0.._tree.label.length-1] == _tree.label res = _path[_tree.label.length.._path.length-1] if ["\\","/"].include?(res[0,1]) parent = _tree node= _tree.dir(res) end end break if node != nil } if node == nil node = TreeNode.new(parent,'KDir') do |_node| _node.label=_path _node.rif= parent.path+_path end end return node end |