Class: OmniAI::Tools::Disk::FileMoveTool

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

Overview

Examples:

tool = OmniAI::Tools::Disk::FileMoveTool.new(root: "./project")
tool.execute(
  path: "./README.txt",
  destination: "./README.md",
)

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:, destination:) ⇒ String

Parameters:

  • path (String)
  • destination (String)

Returns:

  • (String)


24
25
26
27
28
29
30
# File 'lib/omniai/tools/disk/file_move_tool.rb', line 24

def execute(path:, destination:)
  @logger.info("#{self.class.name}#execute path=#{path.inspect} destination=#{destination.inspect}")
  @driver.file_move(path:, destination:)
rescue SecurityError => e
  @logger.info("ERROR: #{e.message}")
  raise e
end