Class: ActionView::DependencyTracker::WildcardResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/action_view/dependency_tracker/wildcard_resolver.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(view_paths, dependencies) ⇒ WildcardResolver

Returns a new instance of WildcardResolver.



6
7
8
9
10
11
# File 'lib/action_view/dependency_tracker/wildcard_resolver.rb', line 6

def initialize(view_paths, dependencies)
  @view_paths = view_paths

  @wildcard_dependencies, @explicit_dependencies =
    dependencies.partition { |dependency| dependency.end_with?("/*") }
end

Instance Method Details

#resolveObject



13
14
15
16
17
# File 'lib/action_view/dependency_tracker/wildcard_resolver.rb', line 13

def resolve
  return explicit_dependencies.uniq if !view_paths || wildcard_dependencies.empty?

  (explicit_dependencies + resolved_wildcard_dependencies).uniq
end