Releases: haltcase/glob
v0.6.0
This release has the potential to greatly improve performance. glob
will no longer traverse into directories or over files that have no hope of matching the given pattern. A simple example is that a shallow pattern like *.nim
can only match files with a .nim
extension in the current directory — so glob
should never enter a subdirectory or consider files with any other extension. This is now the case!
TL;DR when using shallow patterns in roots of huge directory structures, users should see huge performance gains.
PERFORMANCE
- optimize walk iterator (
1a57121
)
v0.5.0
This release brings a number of API improvements, the most significant of which is that procs/iterators like listGlob
that previously only accepted string patterns now also accept pre-constructed Glob
objects:
import glob
const matcher = glob("src/**/*.nim")
# the following are now equivalent:
listGlob(matcher)
listGlob("src/**/*.nim")
This makes globs more reusable and can reduce the number of created objects.
An internal proc named splitPattern
is now exposed publicly:
import glob
echo splitPattern("src/dir/**/*.{png,svg}")
# -> (base: "src/dir", magic: "**/*.{png.svg}")
The full feature update list is below, and all of these have been documented on the full docs site.
FEATURES
walkGlobKinds
,walkGlob
, &listGlob
now also accept
a preconstructedGlob
object instead of a string- the internal
splitPattern
proc is now publicly exported,
which allows users to split string glob patterns into their
"magic" & "non-magic" (base) parts Glob
objects now contain theirbase
&magic
path segmentshasMagic
now checks for extended glob features like pattern
matches
v0.4.0
While it's a fairly small release, almost the entire glob parser was actually rewritten for this release to make supporting extended pattern matches easier and to generally make it simpler. 🎉
FEATURES
- add extended pattern matching (
a7cf070
)