BaseFSDir
# File lib/chef/chef_fs/file_system/file_system_entry.rb, line 40 def children begin @children ||= Dir.entries(file_path).select { |entry| entry != '.' && entry != '..' }.map { |entry| FileSystemEntry.new(entry, self) } rescue Errno::ENOENT raise Chef::ChefFS::FileSystem::NotFoundError.new($!), "#{file_path} not found" end end
# File lib/chef/chef_fs/file_system/file_system_entry.rb, line 48 def create_child(child_name, file_contents=nil) result = FileSystemEntry.new(child_name, self) if file_contents result.write(file_contents) else Dir.mkdir(result.file_path) end result end
# File lib/chef/chef_fs/file_system/file_system_entry.rb, line 62 def delete(recurse) if dir? if recurse FileUtils.rm_rf(file_path) else File.rmdir(file_path) end else File.delete(file_path) end end
# File lib/chef/chef_fs/file_system/file_system_entry.rb, line 58 def dir? File.directory?(file_path) end
# File lib/chef/chef_fs/file_system/file_system_entry.rb, line 36 def path_for_printing Chef::ChefFS::PathUtils::relative_to(file_path, File.expand_path(Dir.pwd)) end
Generated with the Darkfish Rdoc Generator 2.