Class: TheLocal::Installer
- Inherits:
-
Object
- Object
- TheLocal::Installer
- Defined in:
- lib/the_local/installer.rb
Overview
Copies each allowed provider’s committed agent file into a destination’s .claude/agents/ directory, verbatim. Plain Ruby so the Rails generator is a thin wrapper over it.
Constant Summary collapse
- AGENTS_DIR =
".claude/agents"
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(registry:, destination:, allowed_gems:) ⇒ Installer
constructor
A new instance of Installer.
Constructor Details
#initialize(registry:, destination:, allowed_gems:) ⇒ Installer
Returns a new instance of Installer.
12 13 14 15 16 |
# File 'lib/the_local/installer.rb', line 12 def initialize(registry:, destination:, allowed_gems:) @registry = registry @destination = destination @allowed_gems = allowed_gems end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/the_local/installer.rb', line 18 def call agents_dir = File.join(@destination, AGENTS_DIR) FileUtils.mkdir_p(agents_dir) installed_agents.each do |agent| ensure_committed!(agent) FileUtils.cp(agent.source_path, File.join(agents_dir, agent.filename)) end end |