class Ignore::Matcher

Overview

A collection of gitignore patterns that can match paths

Included Modules

Defined in:

ignore.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

Instance Method Detail

def add(pattern : String, base : String = "") : self #

Add a single pattern string


def add_file(path : String, base : String = "") : self #

Load patterns from a .gitignore file


def clear : self #

Remove all patterns


def each(& : String -> ) : Nil #

Iterate over pattern strings


def empty? : Bool #

Check if matcher has any patterns


def ignores?(path : String) : Bool #

Check if a path should be ignored Use trailing / for directories: ignores?("build/")


def parse(content : String, base : String = "") : self #

Parse gitignore content (multiple lines)


def patterns : Array(String) #

Returns the pattern strings


def size : Int32 #

Returns the number of patterns