lib/tapioca/helpers/sorbet_helper.rb in tapioca-0.7.3 vs lib/tapioca/helpers/sorbet_helper.rb in tapioca-0.8.0

- old
+ new

@@ -20,22 +20,16 @@ SORBET_EXE_PATH_ENV_VAR = "TAPIOCA_SORBET_EXE" FEATURE_REQUIREMENTS = T.let({ to_ary_nil_support: ::Gem::Requirement.new(">= 0.5.9220"), # https://github.com/sorbet/sorbet/pull/4706 + print_payload_sources: ::Gem::Requirement.new(">= 0.5.9818"), # https://github.com/sorbet/sorbet/pull/5504 type_variable_block_syntax: ::Gem::Requirement.new(">= 0.5.9892"), # https://github.com/sorbet/sorbet/pull/5639 }.freeze, T::Hash[Symbol, ::Gem::Requirement]) - class CmdResult < T::Struct - const :out, String - const :err, String - const :status, T::Boolean - end - - sig { params(sorbet_args: String).returns(CmdResult) } + sig { params(sorbet_args: String).returns(Spoom::ExecResult) } def sorbet(*sorbet_args) - out, err, status = Open3.capture3([sorbet_path, *sorbet_args].join(" ")) - CmdResult.new(out: out, err: err, status: status.success? || false) + Spoom::Sorbet.srb(sorbet_args.join(" "), sorbet_bin: sorbet_path, capture_err: true) end sig { returns(String) } def sorbet_path sorbet_path = ENV.fetch(SORBET_EXE_PATH_ENV_VAR, SORBET_BIN)