| Class | Buff::Ignore::IgnoreFile |
| In: |
lib/buff/ignore/ignore_file.rb
|
| Parent: | Object |
| COMMENT_OR_WHITESPACE | = | /^\s*(?:#.*)?$/.freeze |
Regular expression to match comments or plain whitespace
@return [Regexp] |
| filepath | [R] |
The path to the ignore file
@return [String] |
| options | [R] |
The list of options
@return [Hash] |
Create a new ignore file from the given filepath
@raise [IgnoreFileNotFound]
if the given filepath does not exist
@param [String, Pathname] filepath
the path to the ignore file
@param [Hash] options
a list of options to pass to the ignore file
@option [to_s] options :base
the base directory to apply ignores from
Apply the ignore to the list, returning a new list of filtered files
@example
files = ['Gemfile', 'Gemfile.lock', 'bacon', 'eggs'] ignore.apply(files) #=> ['bacon', 'eggs']
@see IgnoreFile#apply!
@param [Array] list
the list of files to apply the ignore to
@return [Array]
the sanitized file list
Destructively remove all files from the given list
@param [Array] list
the list of files to apply the ignore to
@return [Array, nil]
the elements removed, or nil if none were removed