Sha256: 100dfc11cec307f5f9096a97c4e1bd48f4462834389d2f1d0faf59063f2f8fb1
Contents?: true
Size: 749 Bytes
Versions: 15
Compression:
Stored size: 749 Bytes
Contents
require 'singleton' require 'singleton' require 'json' class SolaraVersionManager include Singleton def sversion json['solaraVersion'] end def version=(value) new_json = json new_json['solaraVersion'] = value save(new_json) end def value(key) json[key] end def add(key, value) new_json = json new_json[key] = value save(new_json) end private def json path = FilePath.solara_version FileManager.create_file_if_not_exist(path) JSON.parse(File.read(path)) rescue JSON::ParserError => e {} end def save(json) File.write(FilePath.solara_version, JSON.pretty_generate(json)) end end
Version data entries
15 entries across 15 versions & 1 rubygems