Sha256: 317d784b4dc92bfa3c6b188163dde43f95cb8bb47c6aa6fbc6ea6420874737fd

Contents?: true

Size: 695 Bytes

Versions: 7

Compression:

Stored size: 695 Bytes

Contents

# frozen_string_literal: true
# typed: true

require 'pathname'
require 'shellwords'

module Tapioca
  module Compilers
    module Sorbet
      SORBET = Pathname.new(Gem::Specification.find_by_name("sorbet-static").full_gem_path) / "libexec" / "sorbet"

      class << self
        extend(T::Sig)

        sig { params(args: String).returns(String) }
        def run(*args)
          IO.popen(
            [
              sorbet_path,
              "--quiet",
              *args,
            ].join(' '),
            err: "/dev/null"
          ).read
        end

        sig { returns(String) }
        def sorbet_path
          SORBET.to_s.shellescape
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tapioca-0.4.6 lib/tapioca/compilers/sorbet.rb
tapioca-0.4.5 lib/tapioca/compilers/sorbet.rb
tapioca-0.4.4 lib/tapioca/compilers/sorbet.rb
tapioca-0.4.3 lib/tapioca/compilers/sorbet.rb
tapioca-0.4.2 lib/tapioca/compilers/sorbet.rb
tapioca-0.4.1 lib/tapioca/compilers/sorbet.rb
tapioca-0.4.0 lib/tapioca/compilers/sorbet.rb