Class: GlooLang::Exec::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/gloo_lang/exec/runner.rb

Class Method Summary collapse

Class Method Details

.go(engine, verb) ⇒ Object

Dispatch run command to a verb. We abstract this out in case there are things that need to be done before or after a verb is done running.



18
19
20
21
22
23
24
25
# File 'lib/gloo_lang/exec/runner.rb', line 18

def self.go( engine, verb )
  engine.log.debug "running verb #{verb.type_display}"
  engine.heap.error.start_tracking
  engine.exec_env.verbs.push verb
  verb&.run
  engine.exec_env.verbs.pop
  engine.heap.error.clear_if_no_errors
end

.run(engine, path_name) ⇒ Object

Send ‘run’ message to the object. Resolve the path_name and then send the run message.



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/gloo_lang/exec/runner.rb', line 31

def self.run( engine, path_name )
  engine.log.debug "running script at #{path_name}"
  pn = GlooLang::Core::Pn.new( engine, path_name )
  o = pn.resolve

  if o
    o.send_message 'run'
  else
    engine.log.error "Could not send message to object.  Bad path: #{path_name}"
  end
end