Class: Workshop::Arduino

Inherits:
Object
  • Object
show all
Defined in:
lib/workshop/arduino.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Arduino

Returns a new instance of Arduino.



5
6
7
# File 'lib/workshop/arduino.rb', line 5

def initialize(config)
  self.config = config
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



3
4
5
# File 'lib/workshop/arduino.rb', line 3

def config
  @config
end

Instance Method Details

#core_directoryObject



17
18
19
# File 'lib/workshop/arduino.rb', line 17

def core_directory
  hardware_directory + '/arduino/cores/' + config.build_core
end

#hardware_directoryObject



13
14
15
# File 'lib/workshop/arduino.rb', line 13

def hardware_directory
  config.arduino_app_directory + hardware_path
end

#hardware_pathObject



9
10
11
# File 'lib/workshop/arduino.rb', line 9

def hardware_path
  '/Contents/Resources/Java/hardware'
end

#variant_directoryObject



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/workshop/arduino.rb', line 21

def variant_directory
  # TODO - find proper variant dir (could be in documents)
  if config.build_variant
    dir = hardware_directory + '/arduino/variants/' + config.build_variant
    if File.directory?(dir)
      dir
    else
      nil
    end

  end
end