Class: ActionView::DependencyTracker::RubyTracker
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actionview/lib/action_view/dependency_tracker/ruby_tracker.rb |
Constant Summary
-
EXPLICIT_DEPENDENCY =
# File 'actionview/lib/action_view/dependency_tracker/ruby_tracker.rb', line 6/# Template Dependency: (\S+)/
Class Attribute Summary
- .supports_view_paths? ⇒ Boolean readonly
Class Method Summary
Instance Attribute Summary
- #name readonly private
- #template readonly private
- #view_paths readonly private
Instance Method Summary
- #dependencies
- #explicit_dependencies private
- #render_dependencies private
Constructor Details
.new(name, template, view_paths = nil, parser_class: RenderParser::Default) ⇒ RubyTracker
# File 'actionview/lib/action_view/dependency_tracker/ruby_tracker.rb', line 20
def initialize(name, template, view_paths = nil, parser_class: RenderParser::Default) @name, @template, @view_paths = name, template, view_paths @parser_class = parser_class end
Class Attribute Details
.supports_view_paths? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'actionview/lib/action_view/dependency_tracker/ruby_tracker.rb', line 16
def self.supports_view_paths? # :nodoc: true end
Class Method Details
.call(name, template, view_paths = nil)
[ GitHub ]# File 'actionview/lib/action_view/dependency_tracker/ruby_tracker.rb', line 8
def self.call(name, template, view_paths = nil) new(name, template, view_paths).dependencies end
Instance Attribute Details
#name (readonly, private)
[ GitHub ]# File 'actionview/lib/action_view/dependency_tracker/ruby_tracker.rb', line 26
attr_reader :template, :name, :view_paths
#template (readonly, private)
[ GitHub ]# File 'actionview/lib/action_view/dependency_tracker/ruby_tracker.rb', line 26
attr_reader :template, :name, :view_paths
#view_paths (readonly, private)
[ GitHub ]Instance Method Details
#dependencies
[ GitHub ]# File 'actionview/lib/action_view/dependency_tracker/ruby_tracker.rb', line 12
def dependencies WildcardResolver.new(view_paths, render_dependencies + explicit_dependencies).resolve end
#explicit_dependencies (private)
[ GitHub ]# File 'actionview/lib/action_view/dependency_tracker/ruby_tracker.rb', line 38
def explicit_dependencies template.source.scan(EXPLICIT_DEPENDENCY).flatten.uniq end
#render_dependencies (private)
[ GitHub ]# File 'actionview/lib/action_view/dependency_tracker/ruby_tracker.rb', line 28
def render_dependencies return [] unless template.source.include?("render") compiled_source = template.handler.call(template, template.source) @parser_class.new(@name, compiled_source).render_calls.filter_map do |render_call| render_call.gsub(%r|/_|, "/") end end