Class: SkillBench::HistoryRecorder::HistoryPathResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/history_recorder/history_path_resolver.rb

Overview

Resolves the best writable path for storing benchmark history. Checks env var, cwd, local share, and XDG data home in order.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.resolveString?

Finds the best writable path for the history file.

Returns:

  • (String, nil)

    writable path or nil if none found



13
14
15
# File 'lib/skill_bench/history_recorder/history_path_resolver.rb', line 13

def self.resolve
  new.resolve
end

Instance Method Details

#resolveString?

Finds the best writable path for the history file.

Returns:

  • (String, nil)

    writable path or nil if none found



20
21
22
23
24
25
# File 'lib/skill_bench/history_recorder/history_path_resolver.rb', line 20

def resolve
  env_path || cwd_path || local_path || xdg_path || begin
    warn('Warning: Could not find writable location for benchmarks.json')
    nil
  end
end