Class: I18n::Tasks::Scanners::Files::CachingFileFinder
- Inherits:
-
FileFinder
- Object
- FileFinder
- I18n::Tasks::Scanners::Files::CachingFileFinder
- Defined in:
- lib/i18n/tasks/scanners/files/caching_file_finder.rb
Overview
Note:
This class is thread-safe. All methods are cached.
Finds the files in the specified search paths with support for exclusion / inclusion patterns. Wraps a FileFinder and caches the results.
Constant Summary
Constants included from Logging
Logging::MUTEX, Logging::PROGRAM_NAME
Instance Method Summary collapse
-
#find_files ⇒ Array<String>
Found files.
-
#initialize(**args) ⇒ CachingFileFinder
constructor
A new instance of CachingFileFinder.
Methods inherited from FileFinder
Methods included from Logging
log_error, log_stderr, log_verbose, log_warn, program_name, warn_deprecated
Constructor Details
#initialize(**args) ⇒ CachingFileFinder
Returns a new instance of CachingFileFinder.
14 15 16 17 |
# File 'lib/i18n/tasks/scanners/files/caching_file_finder.rb', line 14 def initialize(**args) super @cached_value = ::I18n::Tasks::Concurrent::CachedValue.new { uncached_find_files } end |
Instance Method Details
#find_files ⇒ Array<String>
Note:
This method is cached, it will only access the filesystem on the first invocation.
Returns found files.
31 32 33 |
# File 'lib/i18n/tasks/scanners/files/caching_file_finder.rb', line 31 def find_files @cached_value.get end |