class Finder
- Finder
- Reference
- Object
Overview
Inspired by the find command, this helps you find files and folders recursively in Crystal
Defined in:
finder.crConstructors
Instance Method Summary
-
#dirs : Array(String)
gives you all the directories that exist recursively as Array(String)
- #dirs(&block : String -> )
-
#each(&block : String -> )
Iterates over each directory and file underneath the root
-
#files : Array(String)
gives you all the files that exist recursively as Array(String)
-
#files(&block : String -> )
allows you to iterate over the files with a block
-
#find(fragment : String) : Array(String)
Returns an array of paths recursively under root that include fragment in the path
-
#find(fragment : Regex) : Array(String)
Returns an array of paths recursively under root that match your regex fragment
- #root : String
-
#select(&block : String -> Bool)
Returns an array of paths recursively under root that are truthy for the block
-
#walk(d = @root, &block : String, Array(String), Array(String) -> )
Port of Python's os.walk.
Constructor Detail
Instance Method Detail
Returns an array of paths recursively under root that include fragment in the path
Returns an array of paths recursively under root that match your regex fragment
Returns an array of paths recursively under root that are truthy for the block
Port of Python's os.walk. It recursively iterates through the root directory and at each level will give yield you the current directory, array of directories in the current directory, and the same thing for files.