File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def initialize(
3232
3333 @payload_symbols = Static ::SymbolLoader . payload_symbols #: Set[String]
3434 gem_graph = Static ::SymbolLoader . graph_from_paths ( @gem . files ) #: Rubydex::Graph
35- gem_symbols = gem_graph . declarations . map ( & :name ) . to_set
35+ gem_symbols = Static :: SymbolLoader . symbols_from_graph ( gem_graph )
3636 engine_symbols = Static ::SymbolLoader . engine_symbols ( @gem )
3737 @bootstrap_symbols = gem_symbols . union ( engine_symbols ) #: Set[String]
3838
Original file line number Diff line number Diff line change @@ -26,6 +26,17 @@ def graph_from_paths(paths)
2626 graph
2727 end
2828
29+ #: (Rubydex::Graph graph) -> Set[String]
30+ def symbols_from_graph ( graph )
31+ graph . declarations . filter_map do |decl |
32+ next unless decl . is_a? ( Rubydex ::Namespace ) ||
33+ decl . is_a? ( Rubydex ::Constant ) ||
34+ decl . is_a? ( Rubydex ::ConstantAlias )
35+
36+ decl . name
37+ end . to_set
38+ end
39+
2940 #: (Gemfile::GemSpec gem) -> Set[String]
3041 def engine_symbols ( gem )
3142 gem_engine = engines . find do |engine |
@@ -47,7 +58,7 @@ def engine_symbols(gem)
4758 end
4859
4960 engine_graph = graph_from_paths ( paths )
50- engine_graph . declarations . map ( & :name ) . to_set
61+ symbols_from_graph ( engine_graph )
5162 rescue
5263 Set . new
5364 end
You can’t perform that action at this time.
0 commit comments