Sha256: 327f2c350ab2c3df37c57e8aa9b9d2544f6b5b359da20ad5469074368a77ee08
Contents?: true
Size: 798 Bytes
Versions: 3
Compression:
Stored size: 798 Bytes
Contents
# typed: true # frozen_string_literal: true require "sorbet-runtime" require "pathname" module Spoom extend T::Sig SPOOM_PATH = (Pathname.new(__FILE__) / ".." / "..").to_s class Error < StandardError; end sig do params( cmd: String, arg: String, path: String, capture_err: T::Boolean ).returns([String, T::Boolean, Integer]) end 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 end require "spoom/colors" require "spoom/sorbet" require "spoom/cli" require "spoom/version"
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
spoom-1.1.8 | lib/spoom.rb |
spoom-1.1.7 | lib/spoom.rb |
spoom-1.1.6 | lib/spoom.rb |