class Sorbet::Private::RequireEverything

def self.rb_file_paths

def self.rb_file_paths
  srb = File.realpath("#{__dir__}/../bin/srb")
  output = IO.popen([
    srb,
    "tc",
    "-p",
    "file-table-json",
    "--stop-after=parser",
    "--silence-dev-message",
    "--no-error-count",
    "-e",
    "''",
  ]) {|io| io.read}
  # This returns a hash with structure:
  # { files:
  #   [
  #     {
  #       "strict": ["Ignore"|"False"|"True"|"Strict"|"Strong"|"Stdlib"],
  #       "path": "./path/to/file",
  #       ...
  #     }
  #     ...
  #   ]
  # }
  parsed = JSON.parse(output)
  parsed
    .fetch('files', [])
    .reject{|file| ["Ignore", "Stdlib"].include?(file["strict"])}
    .map{|file| file["path"]}
    .select{|path| File.file?(path)} # Some files have https:// paths. We ignore those here.
    .select{|path| /.rb$/.match(path)}
    .map{|path| File.expand_path(path)} # Requires absolute path
end