Class: Brute::Tools::FSRemove
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- Brute::Tools::FSRemove
- Defined in:
- lib/brute/tools/fs_remove.rb
Instance Method Summary collapse
Instance Method Details
#execute(path:) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/brute/tools/fs_remove.rb', line 17 def execute(path:) target = File.(path) Brute::Queue::FileMutationQueue.serialize(target) do raise "Path not found: #{target}" unless File.exist?(target) Brute::Store::SnapshotStore.save(target) if File.file?(target) if File.directory?(target) Dir.rmdir(target) else File.delete(target) end {success: true, path: target} end end |
#name ⇒ Object
15 |
# File 'lib/brute/tools/fs_remove.rb', line 15 def name; "remove"; end |