Sha256: 0d5629950954eb92d539a8ebbb854d95f3776719ee37e4a4aae5f49ec0bbff98
Contents?: true
Size: 543 Bytes
Versions: 11
Compression:
Stored size: 543 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
11 entries across 11 versions & 1 rubygems