{"id":25487833,"url":"https://github.com/justindoody/angostura","last_synced_at":"2025-04-09T22:20:38.730Z","repository":{"id":59150581,"uuid":"82730253","full_name":"justindoody/angostura","owner":"justindoody","description":"Easily add component dependencies","archived":false,"fork":false,"pushed_at":"2017-06-02T20:10:18.000Z","size":1314,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-31T14:13:04.429Z","etag":null,"topics":["components","dependencies","engines","rails","rails-engine","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justindoody.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-21T21:44:21.000Z","updated_at":"2021-09-15T02:20:00.000Z","dependencies_parsed_at":"2022-09-14T04:01:23.911Z","dependency_job_id":null,"html_url":"https://github.com/justindoody/angostura","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/justindoody%2Fangostura","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justindoody%2Fangostura/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justindoody%2Fangostura/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justindoody%2Fangostura/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justindoody","download_url":"https://codeload.github.com/justindoody/angostura/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248120016,"owners_count":21050876,"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":["components","dependencies","engines","rails","rails-engine","ruby"],"created_at":"2025-02-18T20:28:12.407Z","updated_at":"2025-04-09T22:20:38.711Z","avatar_url":"https://github.com/justindoody.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angostura Dependency Gem\n\n![Angostura Leaf](http://i.imgur.com/gHIhrzU.png)\n\nAngostura adds an easy way to setup component dependencies inspired by [rails engine setup guides](http://guides.rubyonrails.org/engines.html#configuring-an-engine).\n\nAngostura expands upon the basic idea of using a `mattr_accessor` adding validation to ensure using stringified class names during setup, ensure that dependencies were set, and provide default values.\n\n## Great, how do I use it?\n\nThe simplest usage just sets a few dependencies by including angostura and using the `dependendency` hook with an arg or two.\n\n```ruby\nmodule GreatComponent\n  include Angostura::Dependencies\n\n  dependency :user, :authorizer\nend\n```\n\nWith this `GreatComponent` now responds to `GreatComponent.user` returning the setup string and `GreatComponent.user_class` returning the class object.\n\n`GreatComponent` also now has an available setup method to be used in an initializer.\n\n```ruby\nGreatComponent.setup do |config|\n  config.user = 'PoorChoices'\nend\n```\n\nConfig expects stringified class names, angostura will dynamically define a dependency_class method for you which returns the constantized class.\n\nThe `dependency` hook also allows you to set defaults for the dependency by passing keyword arguments. For example `dependency :house, car: 'Mazerati'`, a dependency with a default can still of course be overriden in the setup block.\n\n### That's it, that's all. It's a simple small gem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustindoody%2Fangostura","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustindoody%2Fangostura","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustindoody%2Fangostura/lists"}