Sha256: c1d0754d317f40863ceec269e6118d11f1d1e22bbedc73c8faa3c1e3777fb4b4
Contents?: true
Size: 1023 Bytes
Versions: 1
Compression:
Stored size: 1023 Bytes
Contents
module PredragsDummyPipelines class Exec attr_reader :name attr_reader :cmd attr_reader :test def initialize(actions, name) @name = name @cmd = actions["cmd"] || [] @test = actions["test"] || [] @cmd_results = [] @test_results = [] end def run run_cmd(@cmd, @cmd_results, true) return if @cmd_results.last[:estatus] != 0 run_cmd(@test, @test_results, false) end def run_cmd(commands, results, should_break) commands.each {|c| begin results << {:input => c, :output => %x[#{c}] || "", :estatus => $?.exitstatus} break if should_break and $?.exitstatus != 0 rescue => e results << {:input => c, :output => e.inspect, :estatus => $?.exitstatus} break if should_break end } @results end def show [{exec_name: @name}, @cmd_results, @test_results] end def results {:cmd => @cmd_results, :test => @test_results} end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
predrags_dummy_pipelines-0.7.2 | lib/predrags_dummy_pipelines/exec.rb |