Sha256: 7108c5ae8a9b026789d4392d04fc258a06b47169c3f41ae7bab68c198c10a45b

Contents?: true

Size: 1.17 KB

Versions: 10

Compression:

Stored size: 1.17 KB

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2020 Eric Crane.  All rights reserved.
#
# The Runner is a static helper function.
# It is used to send the run command to verbs.
#

module Gloo
  module Exec
    class Runner

      #
      # 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.
      #
      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

      #
      # Send 'run' message to the object.
      # Resolve the path_name and then send the run message.
      #
      def self.run( engine, path_name )
        engine.log.debug "running script at #{path_name}"
        pn = Gloo::Core::Pn.new( engine, path_name )
        o = pn.resolve

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

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gloo-3.10.1 lib/gloo/exec/runner.rb
gloo-3.10.0 lib/gloo/exec/runner.rb
gloo-3.9.1 lib/gloo/exec/runner.rb
gloo-3.9.0 lib/gloo/exec/runner.rb
gloo-3.8.0 lib/gloo/exec/runner.rb
gloo-3.7.0 lib/gloo/exec/runner.rb
gloo-3.6.2 lib/gloo/exec/runner.rb
gloo-3.6.1 lib/gloo/exec/runner.rb
gloo-3.6.0 lib/gloo/exec/runner.rb
gloo-3.5.0 lib/gloo/exec/runner.rb