Class: SkillBench::Services::ManifestFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/services/manifest_finder.rb

Overview

Finds the registry manifest file path.

Constant Summary collapse

DEFAULT_PATH =

Default path relative to current working directory.

'../agent-mcp-runtime/registry.json'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path: nil) ⇒ ManifestFinder

Returns a new instance of ManifestFinder.

Parameters:

  • path (String, nil) (defaults to: nil)

    Optional custom path to the manifest



20
21
22
# File 'lib/skill_bench/services/manifest_finder.rb', line 20

def initialize(path: nil)
  @path = path
end

Class Method Details

.call(path: nil) ⇒ String

Finds the registry manifest file.

Parameters:

  • path (String, nil) (defaults to: nil)

    Optional custom path to the manifest

Returns:

  • (String)

    Absolute path to the registry manifest

Raises:

  • (ArgumentError)

    when the manifest file is not found



15
16
17
# File 'lib/skill_bench/services/manifest_finder.rb', line 15

def self.call(path: nil)
  new(path: path).call
end

Instance Method Details

#callString

Finds the registry manifest file.

Returns:

  • (String)

    Absolute path to the registry manifest

Raises:

  • (ArgumentError)

    when the manifest file is not found



28
29
30
31
32
33
# File 'lib/skill_bench/services/manifest_finder.rb', line 28

def call
  manifest_path = @path || File.expand_path(DEFAULT_PATH, Dir.pwd)
  raise ArgumentError, "Registry manifest not found: #{manifest_path}" unless File.exist?(manifest_path)

  manifest_path
end