class I18n::Processes::Scanners::Files::CachingFileFinder

Finds the files in the specified search paths with support for exclusion / inclusion patterns. Wraps a {FileFinder} and caches the results.

@note This class is thread-safe. All methods are cached. @since 0.9.0

Public Class Methods

new(**args) click to toggle source

@param (see FileFinder#initialize)

Calls superclass method
# File lib/i18n/processes/scanners/files/caching_file_finder.rb, line 12
def initialize(**args)
  super
  @mutex = Mutex.new
  @cached_paths = nil
end

Public Instance Methods

find_files() click to toggle source

@note This method is cached, it will only access the filesystem on the first invocation. @return (see FileFinder#find_files)

Calls superclass method
# File lib/i18n/processes/scanners/files/caching_file_finder.rb, line 30
def find_files
  @cached_paths || @mutex.synchronize { @cached_paths ||= super }
end
traverse_files() click to toggle source

Traverse the paths and yield the matching ones.

@note This method is cached, it will only access the filesystem on the first invocation. @param (see FileFinder#traverse_files) @yieldparam (see FileFinder#traverse_files) @return (see FileFinder#traverse_files)

Calls superclass method
# File lib/i18n/processes/scanners/files/caching_file_finder.rb, line 24
def traverse_files
  super
end