class ProcessingIde

detects processing preferences.txt, extracts sketchbook_path

Constants

FOUR
THREE

Attributes

preferences[R]

Public Class Methods

new() click to toggle source
# File lib/jruby_art/processing_ide.rb, line 8
def initialize
  @preferences = File.join(ENV['HOME'], '.processing', 'preferences.txt')
end

Public Instance Methods

installed?() click to toggle source
# File lib/jruby_art/processing_ide.rb, line 12
def installed?
  File.exist?(preferences)
end
sketchbook_path() click to toggle source
# File lib/jruby_art/processing_ide.rb, line 16
def sketchbook_path
  File.open(preferences, 'r') do |file|
    file.each_line do |line|
      return line.tap { |sli| sli.slice!(FOUR) }.chomp if /sketchbook.path.four/.match?(line)

      return line.tap { |sli| sli.slice!(THREE) }.chomp if /sketchbook.path.three/.match?(line)
    end
  end
end