delimiter_tree
Version, currently 0.1.35 versions
- 0.1.4latestDec 12, 2016
- 0.1.3not indexedFeb 22, 2017
- 0.1.2not indexedFeb 22, 2017
- 0.1.1not indexedFeb 22, 2017
- 0.1.0not indexedFeb 22, 2017
github.com/drujensen/delimiter_tree
A crystal-lang tree structure that is built using a delimiter.
12 stars
0 dependents
License: MIT
Nothing has been indexed for 0.1.3 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
delimiter_tree:
github: drujensen/delimiter_tree
version: ~> 0.1.3Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.3. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# Delimiter Tree
A delimiter tree is a tree that is built from a string based on the delimiter.
For example, if you have a string "foo;bar" then you will have a parent node
"foo" and a child node "bar". Each node will hold a payload.
The delimiter tree also supports two special characters.
- : is used for a parameter
- * is used to include a payload for all children nodes
The tree will return an array of payloads for all matching * as well
as the specific payload for the final matching string.
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
delimiter_tree:
github: drujensen/delimiter_tree
```
## Usage
The delimiter tree is used to return a payload or an array of payloads for a
particular delimited string. This can be used for url paths or any situation
where you need to specifically hold data per each segment of a delimited
string.
```crystal
require "delimiter_tree"
tree = Delimiter::Tree.new("/")
tree.add "/*", :all_children
tree.add "/products", :products
tree.add "/products/:id", :specific_product
result = tree.find "/products/2"
puts result.payload
# [:all_children, :products]
puts result.params
# :id => 2
```
## Contributing
1. Fork it ( https://github.com/drujensen/delimiter_tree/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [drujensen](https://github.com/drujensen) Dru Jensen - creator, maintainer
- [TechMagister](https://github.com/TechMagister) Arnaud Fernandés
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.3- Tagged
- Feb 22, 2017
- Commit
e5e1d8d1d693- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/drujensen/delimiter_tree
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 5