Class: Constant::Controls::Script::Example
- Inherits:
-
Object
- Object
- Constant::Controls::Script::Example
- Includes:
- Initializer
- Defined in:
- lib/constant/controls/script.rb
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/constant/controls/script.rb', line 43 def run = $LOAD_PATH.map do |load_path_entry| "-I#{load_path_entry}" end command = ["ruby", *, "-e", source] output, error_output, status = Open3.capture3(*command) if not status.success? raise "Script failed\n\n#{source}\n#{error_output}" end output.split("\n") end |