Class: Prremote::Commands::Run
- Inherits:
-
Object
- Object
- Prremote::Commands::Run
- Defined in:
- lib/prremote/commands/run.rb
Instance Method Summary collapse
- #call(rb_path) ⇒ Object
-
#initialize(port:, baud:) ⇒ Run
constructor
A new instance of Run.
Constructor Details
#initialize(port:, baud:) ⇒ Run
Returns a new instance of Run.
8 9 10 11 |
# File 'lib/prremote/commands/run.rb', line 8 def initialize(port:, baud:) @port = port @baud = baud end |
Instance Method Details
#call(rb_path) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/prremote/commands/run.rb', line 13 def call(rb_path) raise "File not found: #{rb_path}" unless File.exist?(rb_path) warn "Compiling #{rb_path}..." mrb_data = compile(rb_path) warn 'Running...' run_on_device(mrb_data) end |