Class: ProcessingIde
- Inherits:
-
Object
- Object
- ProcessingIde
- Defined in:
- lib/jruby_art/processing_ide.rb
Overview
detects processing preferences.txt, extracts sketchbook_path
Instance Attribute Summary collapse
-
#preferences ⇒ Object
readonly
Returns the value of attribute preferences.
Instance Method Summary collapse
-
#initialize ⇒ ProcessingIde
constructor
A new instance of ProcessingIde.
- #installed? ⇒ Boolean
- #sketchbook_path ⇒ Object
Constructor Details
#initialize ⇒ ProcessingIde
Returns a new instance of ProcessingIde.
4 5 6 |
# File 'lib/jruby_art/processing_ide.rb', line 4 def initialize @preferences = File.join(ENV['HOME'], '.processing', 'preferences.txt') end |
Instance Attribute Details
#preferences ⇒ Object (readonly)
Returns the value of attribute preferences.
3 4 5 |
# File 'lib/jruby_art/processing_ide.rb', line 3 def preferences @preferences end |
Instance Method Details
#installed? ⇒ Boolean
8 9 10 |
# File 'lib/jruby_art/processing_ide.rb', line 8 def installed? File.exist?(preferences) end |
#sketchbook_path ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/jruby_art/processing_ide.rb', line 12 def sketchbook_path File.open(preferences, 'r') do |file| file.each_line do |line| return line.tap { |sli| sli.slice!('sketchbook.path.three=') }.chomp if line =~ /sketchbook/ end end end |