Class: Depdump::Parser
- Inherits:
-
Object
- Object
- Depdump::Parser
- Defined in:
- lib/depdump/parser.rb
Instance Attribute Summary collapse
-
#tracer ⇒ Object
readonly
Returns the value of attribute tracer.
Instance Method Summary collapse
- #dependency_graph ⇒ Object
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #parse(files) ⇒ Object
Constructor Details
Instance Attribute Details
#tracer ⇒ Object (readonly)
Returns the value of attribute tracer.
3 4 5 |
# File 'lib/depdump/parser.rb', line 3 def tracer @tracer end |
Instance Method Details
#dependency_graph ⇒ Object
17 18 19 |
# File 'lib/depdump/parser.rb', line 17 def dependency_graph DependencyGraph.new(tracer.registry_tree) end |
#parse(files) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/depdump/parser.rb', line 9 def parse(files) (files).each do |file| source = File.read(file) ast = ::Parser::CurrentRuby.parse(source) tracer.trace_node(ast) end end |