Class: ArduinoSketchBuilder::Base
- Inherits:
-
Object
- Object
- ArduinoSketchBuilder::Base
- Defined in:
- lib/arduino_sketch_builder/base.rb
Instance Method Summary collapse
- #build_and_upload ⇒ Object
-
#initialize(root_directory, sketch_file_path, board_type: "uno", board_port: "/dev/tty.usbmodem411") ⇒ Base
constructor
A new instance of Base.
- #message ⇒ Object
- #reset ⇒ Object
- #setup_sketch ⇒ Object
- #state ⇒ Object
Constructor Details
#initialize(root_directory, sketch_file_path, board_type: "uno", board_port: "/dev/tty.usbmodem411") ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/arduino_sketch_builder/base.rb', line 5 def initialize(root_directory, sketch_file_path, board_type: "uno", board_port: "/dev/tty.usbmodem411") @root_directory = File.(root_directory) @sketch_file_path = File.(sketch_file_path) @board_type = board_type @board_port = board_port main_directory_name = File.basename(@sketch_file_path).split('.').first.underscore main_directory = File.join(@root_directory, main_directory_name) build_directory = File.join(main_directory, "build") @arduino_cmake_build = ArduinoSketchBuilder::ArduinoCmakeBuild.new(main_directory, build_directory) end |
Instance Method Details
#build_and_upload ⇒ Object
29 30 31 |
# File 'lib/arduino_sketch_builder/base.rb', line 29 def build_and_upload @arduino_cmake_build.build_and_upload end |
#message ⇒ Object
21 22 23 |
# File 'lib/arduino_sketch_builder/base.rb', line 21 def @arduino_cmake_build. end |
#reset ⇒ Object
33 34 35 |
# File 'lib/arduino_sketch_builder/base.rb', line 33 def reset @arduino_cmake_build.reset end |
#setup_sketch ⇒ Object
25 26 27 |
# File 'lib/arduino_sketch_builder/base.rb', line 25 def setup_sketch ArduinoSketchBuilder::Setup.new.setup(@root_directory, @sketch_file_path, board_type: @board_type, board_port: @board_port) end |
#state ⇒ Object
17 18 19 |
# File 'lib/arduino_sketch_builder/base.rb', line 17 def state @arduino_cmake_build.state end |