Method: Chef::ChefFS::FileSystem::Memory::MemoryDir#add_file
- Defined in:
- lib/chef/chef_fs/file_system/memory/memory_dir.rb
#add_file(path, value) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/chef/chef_fs/file_system/memory/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 |