class
Ignore::Dir
- Ignore::Dir
- Reference
- Object
Overview
A directory wrapper that filters results using gitignore patterns
Included Modules
- Enumerable(String)
Defined in:
ignore/dir.crConstructors
-
.new(path : String, patterns : Enumerable(String))
Initialize with path and enumerable of patterns
-
.new(path : String, matcher : Matcher)
Initialize with path and existing matcher
-
.new(path : String, *patterns : String)
Initialize with path and pattern strings
-
.new(path : String, *, root : String)
Initialize with path, loading patterns from ignore files in tree
-
.new(path : String, *, file : String, base : String = "")
Initialize with path, loading patterns from a single file
Instance Method Summary
-
#add(pattern : String) : self
Add additional patterns
-
#children : Array(String)
Returns children of base directory, filtered
-
#each(& : String -> ) : Nil
Iterate over children, filtered (Enumerable support)
-
#each_child(& : String -> ) : Nil
Iterate over children, filtered
-
#each_ignored_child(& : String -> ) : Nil
Iterate over only ignored children
-
#entries : Array(String)
Returns entries of base directory (includes .
-
#glob(pattern : String, *, match : ::File::MatchOptions = ::File::MatchOptions::None) : Array(String)
Glob with filtering, returns array
-
#glob(pattern : String, *, match : ::File::MatchOptions = ::File::MatchOptions::None, &block : String -> ) : Nil
Glob with filtering, yields each match
-
#ignored_children : Array(String)
Returns only ignored children of base directory
-
#ignored_entries : Array(String)
Returns only ignored entries of base directory (excludes .
-
#ignored_glob(pattern : String, *, match : ::File::MatchOptions = ::File::MatchOptions::None) : Array(String)
Glob returning only ignored paths
-
#ignored_glob(pattern : String, *, match : ::File::MatchOptions = ::File::MatchOptions::None, &block : String -> ) : Nil
Glob returning only ignored paths, yields each match
-
#ignores?(path : String) : Bool
Check if a path should be ignored
-
#path : String
The base path
Constructor Detail
Initialize with path and enumerable of patterns
Initialize with path, loading patterns from ignore files in tree
Initialize with path, loading patterns from a single file
Instance Method Detail
Glob with filtering, returns array
Glob with filtering, yields each match
Returns only ignored entries of base directory (excludes . and ..)
Glob returning only ignored paths
Glob returning only ignored paths, yields each match