{"id":26885269,"url":"https://github.com/snmgian/yew","last_synced_at":"2025-05-08T22:30:34.246Z","repository":{"id":10817687,"uuid":"13093119","full_name":"snmgian/yew","owner":"snmgian","description":"Offers an object access like interface to Hash structures.","archived":false,"fork":false,"pushed_at":"2015-04-01T14:35:03.000Z","size":272,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-02T03:19:21.355Z","etag":null,"topics":["configuration","object","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snmgian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-25T12:32:38.000Z","updated_at":"2019-05-20T14:46:48.000Z","dependencies_parsed_at":"2022-08-29T13:31:31.768Z","dependency_job_id":null,"html_url":"https://github.com/snmgian/yew","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snmgian%2Fyew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snmgian%2Fyew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snmgian%2Fyew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snmgian%2Fyew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snmgian","download_url":"https://codeload.github.com/snmgian/yew/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253157518,"owners_count":21863130,"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":["configuration","object","ruby"],"created_at":"2025-03-31T18:52:27.992Z","updated_at":"2025-05-08T22:30:34.222Z","avatar_url":"https://github.com/snmgian.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yew\n\nYew allows traversing a Hash structure as if it is an object tree.\n\n\n## Usage\n\nGiven the following yml file located at `config/env.yml`:\n\n  ``` yaml\n  orientdb:\n    url: 'remote:localhost/db'\n    user: admin\n    pass: secret\n\n  testing:\n    frameworks:\n      minitest: true\n      rspec: false\n  ```\n\n\n - Load the YAML structure.\n\n    ``` ruby\n    Env = Yew::Tree.new(YAML.load(File.read('config/env.yml')))\n    ```\n\n    If you prefer, there's a shortcut method: `Yew.load`\n\n    ``` ruby\n    Env = Yew.load('config/env.yml')\n    ```\n\n\n - Traverse the structure contents.\n\n    ``` ruby\n    Env.orientdb.user\n    # =\u003e 'admin'\n    ```\n\n - Obtain the underlying Hash.\n\n    ``` ruby\n    Env.testing.frameworks[]\n    # =\u003e {\"rspec\"=\u003efalse, \"minitest\"=\u003etrue}\n    ```\n\n\n - A tree can also be traversed like a normal Hash.\n\n    ``` ruby\n    Env['orientdb']['user']\n    # =\u003e 'admin'\n\n    Env['orientdb'].user\n    # =\u003e 'admin'\n    ```\n\n\n - It raises well formed errors when accessing inexistent paths.\n\n    ``` ruby\n    Env['orientdb'].timeout\n    # =\u003e RuntimeError: Attribute timeout not found at /orientdb\n    ```\n\n\n - Set `$YEW_DEBUG` when need to inspect `Yew::Tree` objects under irb.\n\n\n    ``` ruby\n    irb\u003e $YEW_DEBUG = true\n    irb\u003e require 'yew'\n    ```\n\n## Installation\n\nThere are two options for installation: packaged gem and as source file.\n\n 1. Install Yew as a gem.\n\n    ``` shell\n    gem install yew\n    ```\n\n\n 2. Download raw lib into a project source tree.\n\n    ``` shell\n    curl \"https://raw.github.com/snmgian/yew/master/lib/yew.rb\" 2\u003e/dev/null -o \"yew.rb\"\n    ```\n\n## Running tests\n\nTests are written in MiniTest. To run them all just execute the following from your command line:\n\n  ``` shell\n  ruby -I. test/ts_yew.rb\n  ```\n\n## Badges\n\n[![Build Status](https://travis-ci.org/snmgian/yew.svg?branch=master)](https://travis-ci.org/snmgian/yew) [![Code Climate](https://codeclimate.com/github/snmgian/yew.png)](https://codeclimate.com/github/snmgian/yew)\n\n## License\n\nThis software is licensed under the [LGPL][lgpl] license.\n\n[lgpl]: https://www.gnu.org/licenses/lgpl.html\n\n## Art\n\n``` markdown\n\n                                  .:   ,~ :\n                                  +7Z?~+$Z$.    .\n                                 ~$ZZZZ7$OZ$.,::~:~.\n                             .::IZ$$O8Z$ZZZ$$$7OOO7.\n                            7$$$$Z$$OZZOZZZOOZOOZ$$$:.+,~\n                       .. . $Z$ZZZ$$$OZZOZ$O88$OOO8OO8ZZ~\n                        :,?$ZOOZZ88$OOZ$OOOO8OZOOOOO88OZ~+~,\n                       .=ZZOOOOZOO8OOZOZOO8Z8OZO8OOOOO888ZZ::.\n                       ~7ZOZOOZOO8O8O8O8D8OOZOOZDDD8ZO8O888O?I\n                   . +..$OZOOO8O88D8Z88OOD8ZOOO8OZOO8$O88OOZ$O:~. .\n              .   .?.?+7ZZOOO8888D888DDO88888O8ZO88Z88Z888888OZ~.:.\n              ?~7$ZZZOZOZOOO88D888ZDD888D8888888OOOOODZ8OO8OZ88OZ7$+\n              IZOO$OZO8ZZOOD$ZO8DZ8D88888ZD8D8OD88OO8OZOO$OOOOOO8O+:\n             .,.$OZOZOZZZZ88O88O88OO888ON88DO888ZD8O88~7ZOO$$Z88OOO+\n            ~ZZ?ZZZZOZO8O8ZOZOZO888888888O8O8888D88D8~8888O88O8ZO8$.=\n            ?ZZZ8OZOO8O8OOO8OOO8888888DD8O8O88ODO8D88DD88DZ8888O88$ZI ..\n        .. ?$?O8OOO8OZ8D8OZ8ZOODOOO8888D8ODZDDD8ONDO888OO8O88D8OOZOZZ7.~..\n        ,+.7ZO8O8888O88O888888OO7?DD888888D88O8888OOOD88OZD8Z88888OOOZ+: ,\n      ?.I$ZOO8OO8OZ88D8OO8OOO8DDZ7?88NO88O88DD888DO88888DO8888888888O8ZZO~\n      .I=8OOO$8$7.I$888888888D88DDDO8DO8DD8D8D8DD8DD8D88OODZD8DO88O8888O.\n     .$7O888888888O8888D8DOO878D88$O78888D8888?ZOO87O8888D8DD888$O8OO8OI=.\n    =~O8OO87O88OIDDZ7Z=?D88DZN8D8OO8O88DD88DO88O8D8ODDZDD888DO+OZ8O8O88$=:.\n    .:OZO7OO88$D8Z+8~8ZD$88DDNO8$8ODO,OD8DODNOZO8D8DOOO88D8OO8888888Z8ZZO.\n     :Z7888DD88D8DODD$D~~,Z?OONDNI?ZDDDNDD8D8D+7Z~:DD8I8888888888DO88OOO$.\n     .~8O8D8O88D8ZO8Z$8Z:OZO$=88DDDDDDDDOOD8DDDDDNN~~,~DD88O88DD88OZ$O+,.\n       .=DDNNDD88O+ZDDI88OO,,88DDDDDNDDDNN?7Z:ZDNNDN7+$+Z?8888OZO$$,.~ .\n          .DND+7+,,I~~=7$:Z=IO=?Z$DONDDD88OZ.:?ZNNNNDDDD8888Z7=7+I+ ,\n            .+=,    .:=~:.II....Z8DD88DOOO:.,=+::+~8OD88OZ~=ZZ+.\n                          .I,/ZO?7O8OZD$$Z:$:       +I7+$\\\\7+8ZI.\n                           //~,.==7Z?$Z$=$             ~,$ \\\\~.\n                         /:    ~=.7Z?OO?$$,\n .-+--$-?--?--..++::=~,          +7I7ZO7I7$,\n,,. .,:,,=~+..??.:I?,.?+-,,-.,,../7I7ZO7I7$.,,,,..,,,..=.+~..7:7,.7.,-~.+,\n                              ../7Z+=ZZ077Z$~,,..,.,,.  ,:,???+?+.:+.,.+.=I=.=:.\n                                   ....   .    ..  .\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnmgian%2Fyew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnmgian%2Fyew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnmgian%2Fyew/lists"}