Sha256: c640a9913bae68a5961baf9351f218f2fa60994c5ba8313280092e68951003e1

Contents?: true

Size: 1.19 KB

Versions: 23

Compression:

Stored size: 1.19 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 GlooLang
  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 = 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

    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
gloo-lang-1.4.3 lib/gloo_lang/exec/runner.rb
gloo-lang-1.4.2 lib/gloo_lang/exec/runner.rb
gloo-lang-1.4.1 lib/gloo_lang/exec/runner.rb
gloo-lang-1.4.0 lib/gloo_lang/exec/runner.rb
gloo-lang-1.3.2 lib/gloo_lang/exec/runner.rb
gloo-lang-1.3.1 lib/gloo_lang/exec/runner.rb
gloo-lang-1.3.0 lib/gloo_lang/exec/runner.rb
gloo-lang-1.2.8 lib/gloo_lang/exec/runner.rb
gloo-lang-1.2.7 lib/gloo_lang/exec/runner.rb
gloo-lang-1.2.6 lib/gloo_lang/exec/runner.rb
gloo-lang-1.2.5 lib/gloo_lang/exec/runner.rb
gloo-lang-1.2.4 lib/gloo_lang/exec/runner.rb
gloo-lang-1.2.3 lib/gloo_lang/exec/runner.rb
gloo-lang-1.2.2 lib/gloo_lang/exec/runner.rb
gloo-lang-1.2.1 lib/gloo_lang/exec/runner.rb
gloo-lang-1.2.0 lib/gloo_lang/exec/runner.rb
gloo-lang-1.1.0 lib/gloo_lang/exec/runner.rb
gloo-lang-1.0.2 lib/gloo_lang/exec/runner.rb
gloo-lang-1.0.1 lib/gloo_lang/exec/runner.rb
gloo-lang-1.0.0 lib/gloo_lang/exec/runner.rb