Sha256: f7f633a660c912d3f928d1661a61d211fefbffe2b4f2c3956a285c2d318b4d36
Contents?: true
Size: 540 Bytes
Versions: 8
Compression:
Stored size: 540 Bytes
Contents
require 'yaml' module Choria class Colt class Cache def initialize(path:, force_refresh: false) @path = path @data = YAML.safe_load File.read(@path) @clean = true unless force_refresh rescue Errno::ENOENT @clean = false end def dirty? !clean? end def clean? @clean end def load @data end def save(data) @data = data File.write @path, data.to_yaml @clean = true end end end end
Version data entries
8 entries across 8 versions & 1 rubygems