{"id":13690906,"url":"https://github.com/drujensen/delimiter_tree","last_synced_at":"2025-05-12T23:12:20.201Z","repository":{"id":146154704,"uuid":"53975219","full_name":"drujensen/delimiter_tree","owner":"drujensen","description":"A crystal-lang tree structure that is built using a delimiter.","archived":false,"fork":false,"pushed_at":"2017-02-22T02:29:25.000Z","size":172,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T04:32:43.357Z","etag":null,"topics":["crystal"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drujensen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-15T20:12:31.000Z","updated_at":"2020-10-29T22:12:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"861413e4-b8b1-4b06-8b69-289e63510481","html_url":"https://github.com/drujensen/delimiter_tree","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drujensen%2Fdelimiter_tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drujensen%2Fdelimiter_tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drujensen%2Fdelimiter_tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drujensen%2Fdelimiter_tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drujensen","download_url":"https://codeload.github.com/drujensen/delimiter_tree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253837459,"owners_count":21971984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crystal"],"created_at":"2024-08-02T17:00:36.079Z","updated_at":"2025-05-12T23:12:20.145Z","avatar_url":"https://github.com/drujensen.png","language":"Crystal","funding_links":[],"categories":["Algorithms and Data structures"],"sub_categories":[],"readme":"# Delimiter Tree\n\nA delimiter tree is a tree that is built from a string based on the delimiter.\nFor example, if you have a string \"foo;bar\" then you will have a parent node\n\"foo\" and a child node \"bar\".  Each node will hold a payload. \n\nThe delimiter tree also supports two special characters.\n- : is used for a parameter\n- * is used to include a payload for all children nodes\n\nThe tree will return an array of payloads for all matching * as well\nas the specific payload for the final matching string.\n\n\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  delimiter_tree:\n    github: drujensen/delimiter_tree\n```\n\n## Usage\n\nThe delimiter tree is used to return a payload or an array of payloads for a\nparticular delimited string.  This can be used for url paths or any situation\nwhere you need to specifically hold data per each segment of a delimited\nstring.\n\n```crystal\nrequire \"delimiter_tree\"\n\ntree = Delimiter::Tree(Symbol).new(\"/\")\ntree.add \"/*\", :all_children\ntree.add \"/products\", :products\ntree.add \"/products/:id\", :specific_product\n\nresult = tree.find \"/products/2\"\n\nputs result.payload\n# [:all_children, :products]\n\nputs result.params\n# :id =\u003e 2\n\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/drujensen/delimiter_tree/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [drujensen](https://github.com/drujensen) Dru Jensen - creator, maintainer\n- [TechMagister](https://github.com/TechMagister) Arnaud Fernandés\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrujensen%2Fdelimiter_tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrujensen%2Fdelimiter_tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrujensen%2Fdelimiter_tree/lists"}