Sha256: 9d0755cd6f70469a932aa279797c57c7bd0f8e901f18457d091b916d0bbfca6c
Contents?: true
Size: 729 Bytes
Versions: 19
Compression:
Stored size: 729 Bytes
Contents
# frozen_string_literal: true require "open3" require "rfix" require "rfix/log" module Rfix::Cmd include Rfix::Log def cmd(*args, quiet: false) out, err, status = Open3.capture3(*args) box = Rfix::Box.new(out, err, status, args, quiet) return box.stdout if box.success? return yield if block_given? return if quiet box.render(color: :red) exit box.exit_status ensure # box.render(debug: false) end def cmd_succeeded?(*cmd) Open3.capture2e(*cmd).last.success? end def params [ "--word-diff-regex=[^[:space:]]", "--no-renames", "--no-merges", "--first-parent", "--diff-filter=AM", "-U0", "--no-color", "-p" ] end end
Version data entries
19 entries across 19 versions & 1 rubygems