Class: RubySkills::Adapters::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_skills/adapters/base.rb

Overview

This class is abstract.

Base implementation for skill adapters.

Subclasses must define an ADAPTER_INFO constant containing:

  • :adapter — tool directory under the project root
  • :directory — directory containing skills

Since:

  • 0.1.0

Direct Known Subclasses

Claude, Codex, Cursor, Vscode

Instance Method Summary collapse

Constructor Details

#initialize(root: Dir.pwd) ⇒ Base

Returns a new instance of Base.

Parameters:

  • root (String, Pathname) (defaults to: Dir.pwd)

    project root

Since:

  • 0.1.0



16
17
18
# File 'lib/ruby_skills/adapters/base.rb', line 16

def initialize(root: Dir.pwd)
  @root = Pathname.new(root)
end

Instance Method Details

#install(name, source) ⇒ void

This method returns an undefined value.

Install a skill into the adapter destination.

Parameters:

  • name (String)

    skill identifier

  • source (String, Pathname)

    source skill path

Since:

  • 0.1.0



25
26
27
# File 'lib/ruby_skills/adapters/base.rb', line 25

def install(name, source)
  link(source, destination_for(name))
end

#remove(name) ⇒ void

This method returns an undefined value.

Remove an installed skill.

Parameters:

  • name (String)

    skill identifier

Since:

  • 0.1.0



33
34
35
# File 'lib/ruby_skills/adapters/base.rb', line 33

def remove(name)
  FileUtils.rm_rf(destination_for(name))
end