class

Ignore::Dir

Inherits Enumerable < Reference < Object

A directory wrapper that filters results using gitignore patterns

Constructors

new(path : String, patterns : Enumerable(String))

Initialize with path and enumerable of patterns

Source
new(path : String, matcher : Matcher)

Initialize with path and existing matcher

Source
new(path : String, *patterns : String)

Initialize with path and pattern strings

Source
new(path : String, *, root : String)

Initialize with path, loading patterns from ignore files in tree

Source
new(path : String, *, file : String, base : String = "")

Initialize with path, loading patterns from a single file

Source

Instance methods

add(pattern : String) : self

Add additional patterns

Source
children

Returns children of base directory, filtered

Source
each

Iterate over children, filtered (Enumerable support)

Source
each_child

Iterate over children, filtered

Source
each_ignored_child

Iterate over only ignored children

Source
entries

Returns entries of base directory (includes . and ..), filtered

Source
glob(pattern : String, *, match : ::File::MatchOptions = ::File::MatchOptions::None) : Array(String)

Glob with filtering, returns array

Source
glob(pattern : String, *, match : ::File::MatchOptions = ::File::MatchOptions::None, &block : String -> ) : Nil

Glob with filtering, yields each match

Source
ignored_children

Returns only ignored children of base directory

Source
ignored_entries

Returns only ignored entries of base directory (excludes . and ..)

Source
ignored_glob(pattern : String, *, match : ::File::MatchOptions = ::File::MatchOptions::None) : Array(String)

Glob returning only ignored paths

Source
ignored_glob(pattern : String, *, match : ::File::MatchOptions = ::File::MatchOptions::None, &block : String -> ) : Nil

Glob returning only ignored paths, yields each match

Source
ignores?(path : String) : Bool

Check if a path should be ignored

Source
path

The base path

Source