# File lib/fssm/tree.rb, line 66 def set(path) node = descendant!(path) node.from_path(path).mtime end
# File lib/fssm/tree.rb, line 48 def unset(path) key = key_segments(path) if key.empty? remove_children return nil end segment = key.pop node = descendant(key) return unless node node.remove_child(segment) nil end
# File lib/fssm/tree.rb, line 78 def descendant(path) recurse(path, false) end
# File lib/fssm/tree.rb, line 82 def descendant!(path) recurse(path, true) end
# File lib/fssm/tree.rb, line 73 def key_segments(key) return key if key.is_a?(Array) FSSM::Pathname.for(key).segments end
# File lib/fssm/tree.rb, line 86 def recurse(key, create=false) key = key_segments(key) node = self until key.empty? segment = key.shift node = create ? node.child!(segment) : node.child(segment) return nil unless node end node end