Sha256: 35bec0db2332987432164431d568176f38c7e0a60115b9028461387e758546ca
Contents?: true
Size: 947 Bytes
Versions: 1
Compression:
Stored size: 947 Bytes
Contents
require 'English' module Psychic module Shell class ExecutionError < StandardError attr_accessor :execution_result end class ExecutionResult attr_reader :exitstatus attr_reader :stdout attr_reader :stderr # coerce_value String, ->(v) { v.force_encoding('utf-8') } def initialize(results) @exitstatus = results.fetch(:exitstatus) # Needs to be UTF-8 to serialize as YAML @stdout = results.fetch(:stdout).force_encoding('utf-8') @stderr = results.fetch(:stderr).force_encoding('utf-8') end def error! if @exitstatus != 0 error = ExecutionError.new error.execution_result = self fail error end end def to_s ''" Execution Result: exitstatus: #{exitstatus} stdout: #{stdout} stderr: #{stderr} "'' end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
psychic-runner-0.0.2 | lib/psychic/shell/execution_result.rb |