Sha256: be803a2d589771058d3ca472dff6f3c663ea80a65a1ccf63d1017676010bc7ad
Contents?: true
Size: 525 Bytes
Versions: 13
Compression:
Stored size: 525 Bytes
Contents
# frozen_string_literal: true require 'yaml' require 'fileutils' # module to read sketch.yml # and or create sketch.yml with default parameters module Parameters PATH = File.join(ENV['HOME'], '.picrate').freeze FILE = File.join(PATH, 'sketch.yml').freeze PARAM = { 'sketch' => { 'width' => 640, 'height' => 480, 'mode' => 'P2D' } }.freeze def self.write FileUtils.mkdir_p PATH File.write(FILE, PARAM.to_yaml) end def self.read write unless File.exist?(FILE) YAML.load_file(FILE) end end
Version data entries
13 entries across 13 versions & 1 rubygems