Sha256: 51af1c98c0078a05e339fc91c791fa591457f9bc703cc96657a434b6fd1de59b
Contents?: true
Size: 566 Bytes
Versions: 1
Compression:
Stored size: 566 Bytes
Contents
require 'open3' require 'hash' class Command < Hash def initialize(cmd) self[:command]=cmd self[:output] = '' self[:error] = '' self[:exit_code] = '' self[:ignore_exit_code] = false end def execute begin self[:output],self[:error], self[:exit_code] = Open3.capture3(self[:command]) self[:exit_code]=self[:exit_code].to_i rescue Exception => e self[:error] = "Exception: " + e.to_s self[:exit_code]=1 end raise self[:error] unless((self[:exit_code] == 0) || self[:ignore_exit_code]) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
wixgem-0.33.0 | lib/command.rb |