File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 22
33# detects processing preferences.txt, extracts sketchbook_path
44class 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
You can’t perform that action at this time.
0 commit comments