# File lib/chef/chef_fs/file_system/memory_dir.rb, line 20 def add_child(child) @children.push(child) end
# File lib/chef/chef_fs/file_system/memory_dir.rb, line 36 def add_dir(path) path_parts = path.split('/') dir = self path_parts.each do |path_part| subdir = dir.child(path_part) if !subdir.exists? subdir = MemoryDir.new(path_part, dir) dir.add_child(subdir) end dir = subdir end dir end
# File lib/chef/chef_fs/file_system/memory_dir.rb, line 28 def add_file(path, value) path_parts = path.split('/') dir = add_dir(path_parts[0..-2].join('/')) file = MemoryFile.new(path_parts[-1], dir, value) dir.add_child(file) file end
Generated with the Darkfish Rdoc Generator 2.