Sha256: 626723630312acffd8a62fe77bf1ffce16e979020f54641e1943971f6fabfbaa
Contents?: true
Size: 498 Bytes
Versions: 10
Compression:
Stored size: 498 Bytes
Contents
module Cp8Cli class ConfigStore def initialize(path) @path = path end def [](key) data[key] end def save(key, value) data[key] = value File.new(path, "w") unless File.exists?(path) File.open(path, "w") { |f| f.write(data.to_yaml) } value end private attr_reader :path def data @_data ||= load_data end def load_data YAML.load File.read(path) rescue {} end end end
Version data entries
10 entries across 10 versions & 1 rubygems