Class: ClaudeMemory::Infrastructure::FileSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/claude_memory/infrastructure/file_system.rb

Overview

Real filesystem implementation Wraps File and FileUtils for dependency injection

Instance Method Summary collapse

Instance Method Details

#exist?(path) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/claude_memory/infrastructure/file_system.rb', line 11

def exist?(path)
  File.exist?(path)
end

#file_hash(path) ⇒ Object



24
25
26
# File 'lib/claude_memory/infrastructure/file_system.rb', line 24

def file_hash(path)
  Digest::SHA256.file(path).hexdigest
end

#read(path) ⇒ Object



15
16
17
# File 'lib/claude_memory/infrastructure/file_system.rb', line 15

def read(path)
  File.read(path)
end

#write(path, content) ⇒ Object



19
20
21
22
# File 'lib/claude_memory/infrastructure/file_system.rb', line 19

def write(path, content)
  FileUtils.mkdir_p(File.dirname(path))
  File.write(path, content)
end