Skip to content

Commit 139bbfc

Browse files
committed
Allow for processing four installed
1 parent 3025ecf commit 139bbfc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/jruby_art/processing_ide.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# detects processing preferences.txt, extracts sketchbook_path
44
class ProcessingIde
5+
THREE='sketchbook.path.three='.freeze
6+
FOUR='sketchbook.path.four='.freeze
57
attr_reader :preferences
68
def initialize
79
@preferences = File.join(ENV['HOME'], '.processing', 'preferences.txt')
@@ -14,9 +16,9 @@ def installed?
1416
def sketchbook_path
1517
File.open(preferences, 'r') do |file|
1618
file.each_line do |line|
17-
if /sketchbook/.match?(line)
18-
return line.tap { |sli| sli.slice!('sketchbook.path.three=') }.chomp
19-
end
19+
return line.tap { |sli| sli.slice!(FOUR) }.chomp if /sketchbook.path.four/.match?(line)
20+
21+
return line.tap { |sli| sli.slice!(THREE) }.chomp if /sketchbook.path.three/.match?(line)
2022
end
2123
end
2224
end

0 commit comments

Comments
 (0)