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

Version Path
picrate-2.5.2-java lib/picrate/creators/parameters.rb
picrate-2.5.1-java lib/picrate/creators/parameters.rb
picrate-2.5.0-java lib/picrate/creators/parameters.rb
picrate-2.4.2-java lib/picrate/creators/parameters.rb
picrate-2.4.1-java lib/picrate/creators/parameters.rb
picrate-2.4.0-java lib/picrate/creators/parameters.rb
picrate-2.3.0-java lib/picrate/creators/parameters.rb
picrate-2.2.0-java lib/picrate/creators/parameters.rb
picrate-2.1.2-java lib/picrate/creators/parameters.rb
picrate-2.1.1-java lib/picrate/creators/parameters.rb
picrate-2.1.0-java lib/picrate/creators/parameters.rb
picrate-2.0.1-java lib/picrate/creators/parameters.rb
picrate-2.0.0.pre-java lib/picrate/creators/parameters.rb