Sha256: 79de711c4eeb9e461d898705dd35df14e3f9b9f9c03178b52227d28226a3202b
Contents?: true
Size: 1.1 KB
Versions: 14
Compression:
Stored size: 1.1 KB
Contents
# Author:: Eric Crane (mailto:eric.crane@mac.com) # Copyright:: Copyright (c) 2019 Eric Crane. All rights reserved. # # A script to be run. # module Gloo module Exec class Script attr_accessor :obj # # Set up the script. # def initialize( engine, obj ) @engine = engine @obj = obj @break_out = false end # # Run the script. # The script might be a single string or an array # of lines. # def run @engine.exec_env.push_script self if @obj.value.is_a? String @engine.parser.run @obj.value elsif @obj.value.is_a? Array @obj.value.each do |line| break if @break_out @engine.parser.run line end end @engine.exec_env.pop_script end # # Generic function to get display value. # Can be used for debugging, etc. # def display_value return @obj.pn end # # Stop running this script. # def break_out @break_out = true end end end end
Version data entries
14 entries across 14 versions & 1 rubygems