Sha256: af1ff48b2c740861c813e5aaada2cd87b269126b4dcf8d525a0b8840a92ddf4d

Contents?: true

Size: 1.18 KB

Versions: 19

Compression:

Stored size: 1.18 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.log.error "Could not send message to object.  Bad path: #{path_name}"
        end
      end

    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
gloo-3.4.1 lib/gloo/exec/runner.rb
gloo-3.4.0 lib/gloo/exec/runner.rb
gloo-3.3.0 lib/gloo/exec/runner.rb
gloo-3.2.0 lib/gloo/exec/runner.rb
gloo-3.1.1 lib/gloo/exec/runner.rb
gloo-3.1.0 lib/gloo/exec/runner.rb
gloo-3.0.1 lib/gloo/exec/runner.rb
gloo-3.0.0 lib/gloo/exec/runner.rb
gloo-2.5.0 lib/gloo/exec/runner.rb
gloo-2.4.3 lib/gloo/exec/runner.rb
gloo-2.4.2 lib/gloo/exec/runner.rb
gloo-2.4.1 lib/gloo/exec/runner.rb
gloo-2.4.0 lib/gloo/exec/runner.rb
gloo-2.3.1 lib/gloo/exec/runner.rb
gloo-2.2.0 lib/gloo/exec/runner.rb
gloo-2.1.0 lib/gloo/exec/runner.rb
gloo-2.0.2 lib/gloo/exec/runner.rb
gloo-2.0.1 lib/gloo/exec/runner.rb
gloo-2.0.0 lib/gloo/exec/runner.rb