class LittleGhost::Workspace
A Workspace gives an agent a concrete home for files. Pair it with a Sandbox to decide how those files may be read, changed, or used by commands.
workspace = LittleGhost::Workspace.new(root: "./tmp/support-run") workspace.root # => an absolute path ending in "/tmp/support-run"
Workspaces participate in the run resource lifecycle. A custom workspace can provision storage in open and release it in close.
Attributes
Absolute filesystem root assigned to this workspace.
Public Class Methods
Source
# File lib/little_ghost/workspace.rb, line 14 def initialize(root:) @root = File.expand_path(root) end
Expands root to an absolute path.
Public Instance Methods
Source
# File lib/little_ghost/workspace.rb, line 27 def close nil end
Releases workspace resources. The default workspace has nothing to close.
Source
# File lib/little_ghost/workspace.rb, line 22 def open(run: nil) self end
Opens any run-scoped resources and yields this workspace to the run.