module Formatron::Util::Shell

wrapper for shelling out calls so that we can still test

Public Class Methods

exec(command) click to toggle source
# File lib/formatron/util/shell.rb, line 8
def self.exec(command)
  Open3.popen2e command do |_stdin, stdout_err, wait_thr|
    # rubocop:disable Lint/AssignmentInCondition
    while line = stdout_err.gets
      # rubocop:enable Lint/AssignmentInCondition
      Formatron::LOG.info line.chomp
    end
    return wait_thr.value.success?
  end
end