Class: Textus::Ports::Storage::FileStat
- Inherits:
-
Object
- Object
- Textus::Ports::Storage::FileStat
- Defined in:
- lib/textus/ports/storage/file_stat.rb
Overview
Read-only filesystem query port. The narrow interface that pure domain logic (staleness checks, sentinel value) depends on, so the domain never touches File/Dir directly. FileStore owns the write side.
Instance Method Summary collapse
- #directory?(path) ⇒ Boolean
- #exists?(path) ⇒ Boolean
-
#glob(pattern) ⇒ Object
Ruby 3.3+ guarantees Dir.glob returns a sorted Array; no explicit sort needed, but callers can rely on ordered results for stable behaviour.
- #mtime(path) ⇒ Object
- #read(path) ⇒ Object
Instance Method Details
#directory?(path) ⇒ Boolean
9 |
# File 'lib/textus/ports/storage/file_stat.rb', line 9 def directory?(path) = File.directory?(path) |
#exists?(path) ⇒ Boolean
8 |
# File 'lib/textus/ports/storage/file_stat.rb', line 8 def exists?(path) = File.exist?(path) |
#glob(pattern) ⇒ Object
Ruby 3.3+ guarantees Dir.glob returns a sorted Array; no explicit sort needed, but callers can rely on ordered results for stable behaviour.
15 |
# File 'lib/textus/ports/storage/file_stat.rb', line 15 def glob(pattern) = Dir.glob(pattern) |
#mtime(path) ⇒ Object
11 |
# File 'lib/textus/ports/storage/file_stat.rb', line 11 def mtime(path) = File.mtime(path) |
#read(path) ⇒ Object
10 |
# File 'lib/textus/ports/storage/file_stat.rb', line 10 def read(path) = File.binread(path) |