File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,8 +31,10 @@ def initialize(
3131 @events = [ ] #: Array[Gem::Event]
3232
3333 @payload_symbols = Static ::SymbolLoader . payload_symbols #: Set[String]
34- @bootstrap_symbols = load_bootstrap_symbols ( @gem ) #: Set[String]
35- gem_graph = Static ::SymbolLoader . graph_from_paths ( @gem . files ) if include_doc
34+ gem_graph = Static ::SymbolLoader . graph_from_paths ( @gem . files ) #: Rubydex::Graph
35+ gem_symbols = gem_graph . declarations . map ( &:name ) . to_set
36+ engine_symbols = Static ::SymbolLoader . engine_symbols ( @gem )
37+ @bootstrap_symbols = gem_symbols . union ( engine_symbols ) #: Set[String]
3638
3739 @bootstrap_symbols . each { |symbol | push_symbol ( symbol ) }
3840
@@ -191,14 +193,6 @@ def name_of(constant)
191193
192194 private
193195
194- #: (Gemfile::GemSpec gem) -> Set[String]
195- def load_bootstrap_symbols ( gem )
196- engine_symbols = Static ::SymbolLoader . engine_symbols ( gem )
197- gem_symbols = Static ::SymbolLoader . gem_symbols ( gem )
198-
199- gem_symbols . union ( engine_symbols )
200- end
201-
202196 # Events handling
203197
204198 #: -> Gem::Event
Original file line number Diff line number Diff line change @@ -26,11 +26,6 @@ def graph_from_paths(paths)
2626 graph
2727 end
2828
29- #: (Gemfile::GemSpec gem) -> Set[String]
30- def gem_symbols ( gem )
31- symbols_from_paths ( gem . files )
32- end
33-
3429 #: (Gemfile::GemSpec gem) -> Set[String]
3530 def engine_symbols ( gem )
3631 gem_engine = engines . find do |engine |
@@ -51,7 +46,8 @@ def engine_symbols(gem)
5146 Pathname . glob ( "#{ load_path } /**/*.rb" )
5247 end
5348
54- symbols_from_paths ( paths )
49+ engine_graph = graph_from_paths ( paths )
50+ engine_graph . declarations . map ( &:name ) . to_set
5551 rescue
5652 Set . new
5753 end
You can’t perform that action at this time.
0 commit comments