Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/technicalpickles/glob-test
Test globs across different languages and libraries
https://github.com/technicalpickles/glob-test
Last synced: about 1 month ago
JSON representation
Test globs across different languages and libraries
- Host: GitHub
- URL: https://github.com/technicalpickles/glob-test
- Owner: technicalpickles
- License: other
- Created: 2023-04-20T12:31:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-20T21:27:33.000Z (over 1 year ago)
- Last Synced: 2024-10-14T21:51:37.563Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# glob test
Check globs against different languages and libraries!
Different projects use different languages and/or glob implementations. I originally wrote this to help me test converting javascript regex to globs for use in [lefthook](https://github.com/evilmartians/lefthook). Maybe you'll find it useful?
## ruby
Using stdlib:
```
❯ ruby ruby/glob.rb "**/*.rb" "glob.rb"
"foo.rb" matches "**/*.rb"❯ ruby ruby/glob.rb "**/*.rb" "foo.py"
"foo.py" does not match "**/*.rb"
```## go
Using [gobwas/glob](https://github.com/gobwas/glob):
```
❯ go run go/glob.go "**/*.rb" "glob.rb"
"glob.rb" does not match "**/*.rb"❯ go run go/glob.go "**/*.rb" "foo.py"
"foo.py" does not match "**/*.rb"
```## node
Using [isaacs/minimatch](https://github.com/isaacs/minimatch)
```
❯ npm install❯ node node/glob.mjs "**/*.rb" "glob.rb"
"glob.rb" does not match "**/*.rb"❯ node node/glob.mjs "**/*.rb" "foo.py"
"foo.py" does not match "**/*.rb"
```## Contributing
I can't guarantee how much I will do on this beyond what there is, but happy to review and/or add other folks. I'd like to keep things pretty simple though (unless I change my mind)
I use [lefthook](https://github.com/evilmartians/lefthook) for a precommit hook. Follow the [installation guide](https://github.com/evilmartians/lefthook/blob/master/docs/install.md), then run `lefthook install` to configure the pre-commit hook.