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