Module: Sourcerer::Util::Pathifier
- Defined in:
- lib/sourcerer/util/pathifier.rb
Overview
Classify an input string as file/dir/glob/missing and yield matching paths lazily.
Not required internally; callers must require this file explicitly.
Defined Under Namespace
Classes: Result
Constant Summary collapse
- GLOB_METACHARACTERS =
/[*?\[\]{}]/
Class Method Summary collapse
-
.match(input, recursive: true, include_dirs: false, follow_symlinks: false) ⇒ Result
Classify
inputand return aResultwith a lazy path enumerator.
Class Method Details
.match(input, recursive: true, include_dirs: false, follow_symlinks: false) ⇒ Result
Classify input and return a Result with a lazy path enumerator.
23 24 25 26 27 28 29 30 31 |
# File 'lib/sourcerer/util/pathifier.rb', line 23 def self.match input, recursive: true, include_dirs: false, follow_symlinks: false type = classify(input) Result.new( type: type, input: input, enum: build_enum( type, input, recursive: recursive, include_dirs: include_dirs, follow_symlinks: follow_symlinks)) end |