Sha256: 7a3d57fad6ef84f0f68fe2c8543b0aa5e75dd54b24d6871847908d5e232a237b
Contents?: true
Size: 522 Bytes
Versions: 22
Compression:
Stored size: 522 Bytes
Contents
module Hudson module Config extend self def [](key) config[key] end def config @config ||= if File.exist?(config_file) JSON.parse(File.read(config_file)) else {} end end def store! @config ||= {} FileUtils.mkdir_p(File.dirname(config_file)) File.open(config_file, "w") { |file| file << @config.to_json } end def config_file @config_file ||= "#{ENV['HOME']}/.hudson/hudsonrb-config.json" end end end
Version data entries
22 entries across 22 versions & 1 rubygems