class Riffer::Rig::Tools::Write
Public Instance Methods
(context: Riffer::Agent::Context?, path: String, content: String) → Riffer::Tools::Response
Source
# File lib/riffer/rig/tools/write.rb, line 19 def call(context:, path:, content:) resolved = File.expand_path(path, context&.[](:cwd)) FileUtils.mkdir_p(File.dirname(resolved)) File.write(resolved, content) text("Wrote #{content.bytesize} bytes to #{path}") end
@rbs context: Riffer::Agent::Context? @rbs path: String @rbs content: String @rbs return: Riffer::Tools::Response