Class: Rematch
- Inherits:
-
Object
- Object
- Rematch
- Defined in:
- lib/rematch.rb
Overview
Implement the key/value store
Constant Summary collapse
- VERSION =
'1.3.0'
- EXT =
'.rematch'
Class Attribute Summary collapse
-
.rebuild ⇒ Object
Returns the value of attribute rebuild.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path:, id:) ⇒ Rematch
constructor
path and unique id of the test being run.
-
#rematch(value) ⇒ Object
store if unknown; retrieve otherwise.
Constructor Details
Class Attribute Details
.rebuild ⇒ Object
Returns the value of attribute rebuild.
13 14 15 |
# File 'lib/rematch.rb', line 13 def rebuild @rebuild end |
Class Method Details
.check_rebuild(path) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/rematch.rb', line 15 def check_rebuild(path) return unless @rebuild && !@rebuilt.include?(path) FileUtils.rm_f(path) @rebuilt << path puts "Rebuilt #{path}" end |
Instance Method Details
#rematch(value) ⇒ Object
store if unknown; retrieve otherwise
34 35 36 37 |
# File 'lib/rematch.rb', line 34 def rematch(value) key = "[#{@count += 1}] #{@id}" @store.transaction { |s| s.root?(key) ? s[key] : s[key] = value } end |