module Zap::Utils::Glob

Overview

Cloned from the crystal standard library.

Enhanced with the ability to exclude files and directories.

Defined in:

utils/glob.cr

Class Method Summary

Class Method Detail

def self.[](patterns : Enumerable, match_hidden = false, follow_symlinks = false, exclude : Array(String) | Nil = nil) : Array(String) #

Returns an array of all files that match against any of patterns.

The pattern syntax is similar to shell filename globbing, see File.match? for details.

NOTE Path separator in patterns needs to be always /. The returned file names use system-specific path separators.


[View source]
def self.[](*patterns : Path | String, match_hidden = false, follow_symlinks = false, exclude : Array(String) | Nil = nil) : Array(String) #

Returns an array of all files that match against any of patterns.

The pattern syntax is similar to shell filename globbing, see File.match? for details.

NOTE Path separator in patterns needs to be always /. The returned file names use system-specific path separators.


[View source]
def self.glob(patterns : Enumerable, match_hidden = false, follow_symlinks = false, exclude : Array(String) | Nil = nil) : Array(String) #

Returns an array of all files that match against any of patterns.

The pattern syntax is similar to shell filename globbing, see File.match? for details.

If match_hidden is true the pattern will match hidden files and folders.

NOTE Path separator in patterns needs to be always /. The returned file names use system-specific path separators.


[View source]
def self.glob(*patterns : Path | String, match_hidden = false, follow_symlinks = false, exclude : Array(String) | Nil = nil) : Array(String) #

Returns an array of all files that match against any of patterns.

The pattern syntax is similar to shell filename globbing, see File.match? for details.

If match_hidden is true the pattern will match hidden files and folders.

NOTE Path separator in patterns needs to be always /. The returned file names use system-specific path separators.


[View source]
def self.glob(patterns : Enumerable, match_hidden = false, follow_symlinks = false, exclude : Array(String) | Nil = nil, &block : String -> _) #

Yields all files that match against any of patterns.

The pattern syntax is similar to shell filename globbing, see File.match? for details.

If match_hidden is true the pattern will match hidden files and folders.

NOTE Path separator in patterns needs to be always /. The returned file names use system-specific path separators.


[View source]
def self.glob(*patterns : Path | String, match_hidden = false, follow_symlinks = false, exclude : Array(String) | Nil = nil, &block : String -> _) #

Yields all files that match against any of patterns.

The pattern syntax is similar to shell filename globbing, see File.match? for details.

If match_hidden is true the pattern will match hidden files and folders.

NOTE Path separator in patterns needs to be always /. The returned file names use system-specific path separators.


[View source]