Module: Spoom

Extended by:
T::Sig
Defined in:
lib/spoom/colors.rb,
lib/spoom.rb,
lib/spoom/cli.rb,
lib/spoom/git.rb,
lib/spoom/sorbet.rb,
lib/spoom/cli/lsp.rb,
lib/spoom/cli/run.rb,
lib/spoom/printer.rb,
lib/spoom/version.rb,
lib/spoom/cli/bump.rb,
lib/spoom/coverage.rb,
lib/spoom/timeline.rb,
lib/spoom/file_tree.rb,
lib/spoom/cli/config.rb,
lib/spoom/cli/helper.rb,
lib/spoom/sorbet/lsp.rb,
lib/spoom/coverage/d3.rb,
lib/spoom/cli/coverage.rb,
lib/spoom/sorbet/config.rb,
lib/spoom/sorbet/errors.rb,
lib/spoom/sorbet/sigils.rb,
lib/spoom/sorbet/metrics.rb,
lib/spoom/coverage/d3/pie.rb,
lib/spoom/coverage/report.rb,
lib/spoom/sorbet/lsp/base.rb,
lib/spoom/coverage/d3/base.rb,
lib/spoom/coverage/snapshot.rb,
lib/spoom/sorbet/lsp/errors.rb,
lib/spoom/coverage/d3/timeline.rb,
lib/spoom/test_helpers/project.rb,
lib/spoom/sorbet/lsp/structures.rb,
lib/spoom/coverage/d3/circle_map.rb

Overview

typed: true frozen_string_literal: true

Defined Under Namespace

Modules: Cli, Colorize, Coverage, Git, LSP, Sorbet, TestHelpers Classes: Color, Error, FileTree, Printer, Timeline

Constant Summary collapse

SPOOM_PATH =
(Pathname.new(__FILE__) / ".." / "..").to_s
VERSION =
"1.1.8"

Class Method Summary collapse

Class Method Details

.exec(cmd, *arg, path: '.', capture_err: false) ⇒ Object


22
23
24
25
26
27
28
29
# File 'lib/spoom.rb', line 22

def self.exec(cmd, *arg, path: '.', capture_err: false)
  method = capture_err ? "popen2e" : "popen2"
  Open3.send(method, [cmd, *arg].join(" "), chdir: path) do |_, stdout, thread|
    out = stdout.read
    status = T.cast(thread.value, Process::Status)
    [out, status.success?, status.exitstatus]
  end
end