Sha256: db4cfce61e3523d1ab897752e4f564a26b680c87cb8a3be0f8f92371bd894cd9
Contents?: true
Size: 744 Bytes
Versions: 12
Compression:
Stored size: 744 Bytes
Contents
# typed: strong # frozen_string_literal: true module Tapioca module Compilers # Taken from https://github.com/sorbet/sorbet/blob/master/gems/sorbet/lib/todo-rbi.rb class TodosCompiler extend(T::Sig) sig do returns(String) end def compile list_todos.each_line.map do |line| next if line.include?("<") || line.include?("class_of") "module #{line.strip.gsub("T.untyped::", "")}; end" end.compact.join("\n") end private sig { returns(String) } def list_todos Tapioca::Compilers::Sorbet.run( "--print=missing-constants", "--stdout-hup-hack", "--no-error-count" ).strip end end end end
Version data entries
12 entries across 12 versions & 1 rubygems