Sha256: e9d95b6db809daebf9e571baab927a64374c62ac6965250e847776013828787e

Contents?: true

Size: 545 Bytes

Versions: 6

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

# detects processing preferences.txt, extracts sketchbook_path
class ProcessingIde
  attr_reader :preferences
  def initialize
    @preferences = File.join(ENV['HOME'], '.processing', 'preferences.txt')
  end

  def installed?
    File.exist?(preferences)
  end

  def sketchbook_path
    File.open(preferences, 'r') do |file|
      file.each_line do |line|
        if /sketchbook/.match?(line)
          return line.tap { |sli| sli.slice!('sketchbook.path.three=') }.chomp
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jruby_art-2.5.0 lib/jruby_art/processing_ide.rb
jruby_art-2.4.3 lib/jruby_art/processing_ide.rb
jruby_art-2.4.2 lib/jruby_art/processing_ide.rb
jruby_art-2.4.1 lib/jruby_art/processing_ide.rb
jruby_art-2.4.0 lib/jruby_art/processing_ide.rb
jruby_art-2.3.0 lib/jruby_art/processing_ide.rb