Class: Utils::ConfigFile::FileFinder

Inherits:
BlockConfig show all
Defined in:
lib/utils/config_file.rb

Direct Known Subclasses

Discover, Scope, Search, StripSpaces

Instance Method Summary collapse

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.

Parameters:

  • basename (String, Object)

    the basename to check against prune patterns

Returns:

  • (TrueClass, FalseClass)

    true if the basename matches any prune pattern, false otherwise



237
238
239
# File 'lib/utils/config_file.rb', line 237

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

Parameters:

  • basename (Object)

    the file or directory name to check

Returns:

  • (TrueClass, FalseClass)

    true if the basename matches any skip



252
253
254
# File 'lib/utils/config_file.rb', line 252

def skip?(basename)
  Array(skip_files).any? { |sf| sf.match(basename.to_s) }
end