Class: Varar::Runner::FileBaselineStore
- Inherits:
-
Object
- Object
- Varar::Runner::FileBaselineStore
- Defined in:
- lib/varar/runner/baseline_store.rb
Overview
The filesystem BaselineStore: the committed drift baseline lives at the project root as varar.lock.json. The core owns the format; this adapter only moves raw text. Port of baseline_store.py.
Instance Method Summary collapse
-
#initialize(root) ⇒ FileBaselineStore
constructor
A new instance of FileBaselineStore.
- #read ⇒ Object
- #write(contents) ⇒ Object
Constructor Details
#initialize(root) ⇒ FileBaselineStore
Returns a new instance of FileBaselineStore.
9 10 11 |
# File 'lib/varar/runner/baseline_store.rb', line 9 def initialize(root) @path = File.join(root.to_s, 'varar.lock.json') end |
Instance Method Details
#read ⇒ Object
13 14 15 |
# File 'lib/varar/runner/baseline_store.rb', line 13 def read File.exist?(@path) ? File.read(@path, encoding: 'UTF-8') : nil end |
#write(contents) ⇒ Object
17 18 19 |
# File 'lib/varar/runner/baseline_store.rb', line 17 def write(contents) File.write(@path, contents) end |