Sha256: 7bdb465ca16d64370c49b62536f70ba0641ab043066b59407b069edfbe24362b
Contents?: true
Size: 591 Bytes
Versions: 14
Compression:
Stored size: 591 Bytes
Contents
require 'English' module Thegarage module Gitx class Runner attr_accessor :shell, :options def initialize(shell, options = {}) @shell = shell @options = options end # execute a shell command and raise an error if non-zero exit code is returned # return the string output from the command def run_cmd(cmd, options = {}) shell.say "$ #{cmd}" output = `#{cmd}` success = $CHILD_STATUS.to_i == 0 fail "#{cmd} failed" unless success || options[:allow_failure] output end end end end
Version data entries
14 entries across 14 versions & 1 rubygems