Sha256: 6f1cae33426890d041cf06779bea8b097fd3d71dbdc2b4176d36449adb483709
Contents?: true
Size: 848 Bytes
Versions: 16
Compression:
Stored size: 848 Bytes
Contents
# frozen_string_literal: true module Jive class Runner attr_reader :results def initialize @results = [] end def run(commands, &block) commands.each do |command| block.call(command) do cmd_result = Popen.popen_with_detail(command) results << cmd_result cmd_result end end end def all_success_and_clean? all_success? && all_stderr_empty? end def all_success? results.all? { |result| result.status.success? } end def all_stderr_empty? results.all? { |result| result.stderr.empty? } end def failed_results results.reject { |result| result.status.success? } end def warned_results results.select do |result| result.status.success? && !result.stderr.empty? end end end end
Version data entries
16 entries across 16 versions & 1 rubygems