Sha256: 4c468c2f43b352ee70814e50c09b4cedab9315978756e855365d5ea41cd547ef
Contents?: true
Size: 475 Bytes
Versions: 24
Compression:
Stored size: 475 Bytes
Contents
require 'json' require 'cymbal' module PkgForge ## # Add state methods to Forge class Forge Contract nil => Hash def state @state ||= {} end Contract String => nil def load_state!(statefile) @state = Cymbal.symbolize(JSON.parse(File.read(statefile))) nil end Contract String => nil def write_state!(statefile) File.open(statefile, 'w') do |fh| fh << state.to_json end nil end end end
Version data entries
24 entries across 24 versions & 1 rubygems