Class: Prremote::Commands::Run

Inherits:
Object
  • Object
show all
Defined in:
lib/prremote/commands/run.rb

Instance Method Summary collapse

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