Class: Utils::ConfigFile::FileFinder
- Inherits:
-
BlockConfig
- Object
- BlockConfig
- Utils::ConfigFile::FileFinder
- Defined in:
- lib/utils/config_file.rb
Overview
A configuration class for file system operations.
This class manages the configuration settings for searching and discovering files and directories while filtering out unwanted entries based on configured patterns. It provides functionality to define which directories should be pruned and which files should be skipped during file system operations.
Direct Known Subclasses
Instance Method Summary collapse
-
#prune?(basename) ⇒ TrueClass, FalseClass
The prune? method checks if a basename matches any of the configured prune directories.
-
#skip?(basename) ⇒ TrueClass, FalseClass
The skip? method determines whether a file should be skipped based on configured patterns.
Methods inherited from BlockConfig
config, inherited, #initialize, #to_ruby
Constructor Details
This class inherits a constructor from Utils::ConfigFile::BlockConfig
Instance Method Details
#prune?(basename) ⇒ TrueClass, FalseClass
The prune? method checks if a basename matches any of the configured prune directories.
This method determines whether a given filename or directory name should be excluded based on the prune directories configuration. It iterates through the list of prune patterns and returns true if any pattern matches the provided basename.
268 269 270 |
# File 'lib/utils/config_file.rb', line 268 def prune?(basename) Array(prune_dirs).any? { |pd| pd.match(basename.to_s) } end |
#skip?(basename) ⇒ TrueClass, FalseClass
The skip? method determines whether a file should be skipped based on configured patterns.
This method checks if the provided basename matches any of the configured skip patterns. It converts the basename to a string and tests it against all defined skip files.
pattern, false otherwise
283 284 285 |
# File 'lib/utils/config_file.rb', line 283 def skip?(basename) Array(skip_files).any? { |sf| sf.match(basename.to_s) } end |