Class: ClaudeMemory::Infrastructure::FileSystem
- Inherits:
-
Object
- Object
- ClaudeMemory::Infrastructure::FileSystem
- Defined in:
- lib/claude_memory/infrastructure/file_system.rb
Overview
Real filesystem implementation Wraps File and FileUtils for dependency injection
Instance Method Summary collapse
- #exist?(path) ⇒ Boolean
- #file_hash(path) ⇒ Object
- #read(path) ⇒ Object
- #write(path, content) ⇒ Object
Instance Method Details
#exist?(path) ⇒ 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 |