{"id":15475914,"url":"https://github.com/mooreniemi/figtree","last_synced_at":"2025-04-22T14:10:53.608Z","repository":{"id":56846341,"uuid":"43851554","full_name":"mooreniemi/figtree","owner":"mooreniemi","description":":deciduous_tree: INI files into Ruby objects","archived":false,"fork":false,"pushed_at":"2016-06-15T17:36:17.000Z","size":62,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T02:29:18.043Z","etag":null,"topics":["gem","ini","ini-parser","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/mooreniemi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-07T23:54:23.000Z","updated_at":"2020-05-07T15:48:33.000Z","dependencies_parsed_at":"2022-09-09T01:00:24.564Z","dependency_job_id":null,"html_url":"https://github.com/mooreniemi/figtree","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/mooreniemi%2Ffigtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooreniemi%2Ffigtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooreniemi%2Ffigtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooreniemi%2Ffigtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mooreniemi","download_url":"https://codeload.github.com/mooreniemi/figtree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250255700,"owners_count":21400410,"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":["gem","ini","ini-parser","ruby"],"created_at":"2024-10-02T03:21:13.611Z","updated_at":"2025-04-22T14:10:53.588Z","avatar_url":"https://github.com/mooreniemi.png","language":"Ruby","readme":"                  %%%,%%%%%%%\n                   ,'%% \\\\-*%%%%%%%\n             ;%%%%%*%   _%%%%\"\n              ,%%%       \\(_.*%%%%.\n              % *%%, ,%%%%*(    '\n            %^     ,*%%% )\\|,%%*%,_\n                 *%    \\/ #).-\"*%%*\n                     _.) ,/ *%,\n             _________/)#(_____________\n#### art by [b'ger](http://ascii.co.uk/art/tree)\n\n# Figtree\n## about\nA parser and transformer for loading `.ini` files into Ruby dot notation accessible objects. `.ini` is not a standardized format. But the parser and transformer are easy to extend.\n\nThe goal of figtree is not to accept all `.ini` files generously, but more strictly define `.ini` files so we can make smarter guesses about how to convert your settings into objects.\n\nWhat kinds of objects are supported? Currently we can recognize [unix style filepaths into Pathname](http://ruby-doc.org/stdlib-2.0.0/libdoc/pathname/rdoc/Pathname.html), [ip4 and ip6 addresses into IPAddr](http://ruby-doc.org/stdlib-2.0.0/libdoc/ipaddr/rdoc/IPAddr.html), and most common Ruby types (String, Array, Boolean, Integer). If there's other types you'd like to see supported, please [file an issue](https://github.com/mooreniemi/figtree/issues/new).\n\nIf the `.ini` file is invalid, an error will be raised, with the line and char position of the error. If you extend this gem to have more rules, and one of those rules fails to transform, you will have an error raised.\n\n## alternatives\nIf you want an industrial strength, pure Ruby solution, check out [inifile gem](https://github.com/TwP/inifile). It is much looser about what it accepts as valid `.ini` files, and with no pesky dependencies! If you want to see exactly which cases `figtree` supports vs `inifile`, compare our spec files. Many of the cases in our `invalid/` folder `inifile` will parse for you.\n\n## installation\n`gem install figtree`\n\n## usage\n    require 'figtree'\n    config = Figtree::IniConfig.new('spec/support/settings.conf')\n    config.common.basic_size_limit\n    =\u003e 26214400\n    # also good\n    config[:common][\"paid_users_size_limit\"]\n    =\u003e 2147483648\n    # also also good :)\n    config.common[:paid_users_size_limit]\n    =\u003e 2147483648\n    # and overrides? we got overrides\n    overridden_config = Figtree::IniConfig.new('spec/support/settings.conf', :production)\n    config.ftp.path\n    =\u003e \"/tmp/\"\n    overridden_config.ftp.path\n    =\u003e \"/srv/var/tmp/\"\n\n## disambiguation\nLooking for the graphical viewer of phyllogenic trees? You want this other [Figtree](http://tree.bio.ed.ac.uk/software/figtree/).\n\n## performance\nA typical `.ini` file takes slightly less than 0.02s to be parsed, transformed, and loaded. Currently, the whole `.ini` file is read into memory at once. The assumption being these files should not typically be too big. But future minor versions might move to line by line ingestion.\n\n## development\n### helpers\n`bin/setup`\n`bin/console`\n\nWhile in console, you can use `parse_ini_named name` and as long as it's in `spec/support/name.ini` it'll parse it for you with helpful error output. Sometimes this is a faster feedback mechanism than going through the tests.\n\n### tests\n`rspec spec/`\n\n#### TODO\n- more cleanup\n- give char/line position of transformer failures\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooreniemi%2Ffigtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmooreniemi%2Ffigtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooreniemi%2Ffigtree/lists"}