Skip to content

Commit b868efc

Browse files
committed
Use Rubydex graph for constants_from_requested_paths
1 parent f24d943 commit b868efc

2 files changed

Lines changed: 3 additions & 17 deletions

File tree

lib/tapioca/commands/abstract_dsl.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ def generate_command_for(constant)
359359
#: -> Array[String]
360360
def constants_from_requested_paths
361361
@constants_from_requested_paths ||=
362-
Static::SymbolLoader.symbols_from_paths(@requested_paths).to_a #: Array[String]?
362+
Static::SymbolLoader.symbols_from_graph(
363+
Static::SymbolLoader.graph_from_paths(@requested_paths),
364+
).to_a #: Array[String]?
363365
end
364366
end
365367
end

lib/tapioca/static/symbol_loader.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,6 @@ def engine_symbols(gem)
7474
Set.new
7575
end
7676

77-
#: (Array[Pathname] paths) -> Set[String]
78-
def symbols_from_paths(paths)
79-
return Set.new if paths.empty?
80-
81-
output = Tempfile.create("sorbet") do |file|
82-
file.write(Array(paths).join("\n"))
83-
file.flush
84-
85-
symbol_table_json_from("@#{file.path.shellescape}")
86-
end
87-
88-
return Set.new if output.empty?
89-
90-
SymbolTableParser.parse_json(output)
91-
end
92-
9377
private
9478

9579
# @without_runtime

0 commit comments

Comments
 (0)