Class: OmniAI::Tools::Disk::DirectoryDeleteTool

Inherits:
BaseTool
  • Object
show all
Defined in:
lib/omniai/tools/disk/directory_delete_tool.rb

Overview

Examples:

tool = OmniAI::Tools::Disk::DirectoryDeleteTool.new(root: "./project")
tool.execute(path: "./foo/bar")

Instance Method Summary collapse

Methods inherited from BaseTool

#initialize

Constructor Details

This class inherits a constructor from OmniAI::Tools::Disk::BaseTool

Instance Method Details

#execute(path:) ⇒ String

Parameters:

  • path (String)

Returns:

  • (String)


19
20
21
22
23
24
25
26
# File 'lib/omniai/tools/disk/directory_delete_tool.rb', line 19

def execute(path:)
  @logger.info("#{self.class.name}#execute path=#{path.inspect}")

  FileUtils.rmdir(resolve!(path:))
rescue SecurityError => e
  @logger.error(e.message)
  raise e
end