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,14 @@ def graph_from_paths(paths)
2626 graph
2727 end
2828
29+ #: (Rubydex::Graph graph) -> Set[String]
30+ def symbols_from_graph ( graph )
31+ namespaces = graph . declarations . grep ( Rubydex ::Namespace ) . map ( &:name )
32+ constants = graph . declarations . grep ( Rubydex ::Constant ) . map ( &:name )
33+ aliases = graph . declarations . grep ( Rubydex ::ConstantAlias ) . map ( &:name )
34+ ( namespaces + constants + aliases ) . to_set
35+ end
36+
2937 #: (Gemfile::GemSpec gem) -> Set[String]
3038 def engine_symbols ( gem )
3139 gem_engine = engines . find do |engine |
@@ -47,7 +55,7 @@ def engine_symbols(gem)
4755 end
4856
4957 engine_graph = graph_from_paths ( paths )
50- engine_graph . declarations . map ( & :name ) . to_set
58+ symbols_from_graph ( engine_graph )
5159 rescue
5260 Set . new
5361 end
You can’t perform that action at this time.
0 commit comments