Class: SharedTools::Tools::Disk::FileMoveTool
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- SharedTools::Tools::Disk::FileMoveTool
- Defined in:
- lib/shared_tools/tools/disk/file_move_tool.rb
Overview
Class Method Summary collapse
Instance Method Summary collapse
- #execute(path:, destination:) ⇒ String
-
#initialize(driver: nil, logger: nil) ⇒ FileMoveTool
constructor
A new instance of FileMoveTool.
Constructor Details
#initialize(driver: nil, logger: nil) ⇒ FileMoveTool
Returns a new instance of FileMoveTool.
24 25 26 27 |
# File 'lib/shared_tools/tools/disk/file_move_tool.rb', line 24 def initialize(driver: nil, logger: nil) @driver = driver || SharedTools::Tools::Disk::LocalDriver.new(root: Dir.pwd) @logger = logger || RubyLLM.logger end |
Class Method Details
.name ⇒ Object
15 |
# File 'lib/shared_tools/tools/disk/file_move_tool.rb', line 15 def self.name = 'disk_file_move' |
Instance Method Details
#execute(path:, destination:) ⇒ String
33 34 35 36 37 38 39 |
# File 'lib/shared_tools/tools/disk/file_move_tool.rb', line 33 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 |