{"id":14969844,"url":"https://github.com/rewindio/eight_ball","last_synced_at":"2025-10-11T17:09:14.347Z","repository":{"id":35072381,"uuid":"159366131","full_name":"rewindio/eight_ball","owner":"rewindio","description":"Ruby gem for querying feature flags","archived":false,"fork":false,"pushed_at":"2025-04-04T13:28:12.000Z","size":102,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-05-17T18:48:44.532Z","etag":null,"topics":["feature-flags","feature-toggle","feature-toggles","ruby","ruby-gem","ruby-gems","ruby-on-rails"],"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/rewindio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-27T16:30:41.000Z","updated_at":"2025-04-04T13:26:17.000Z","dependencies_parsed_at":"2025-01-16T20:12:24.171Z","dependency_job_id":"0bd98e4f-1396-4a78-988f-2d2baed3cfd0","html_url":"https://github.com/rewindio/eight_ball","commit_stats":{"total_commits":78,"total_committers":8,"mean_commits":9.75,"dds":"0.20512820512820518","last_synced_commit":"683d9d8e1c451adf6b8ea40568bdd950c6b79441"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/rewindio/eight_ball","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rewindio%2Feight_ball","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rewindio%2Feight_ball/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rewindio%2Feight_ball/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rewindio%2Feight_ball/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rewindio","download_url":"https://codeload.github.com/rewindio/eight_ball/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rewindio%2Feight_ball/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260465889,"owners_count":23013448,"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":["feature-flags","feature-toggle","feature-toggles","ruby","ruby-gem","ruby-gems","ruby-on-rails"],"created_at":"2024-09-24T13:42:29.192Z","updated_at":"2025-10-11T17:09:09.310Z","avatar_url":"https://github.com/rewindio.png","language":"Ruby","readme":"# EightBall\n\n[![Gem Version](https://badge.fury.io/rb/eight_ball.png)](https://badge.fury.io/rb/eight_ball) ![Build](https://github.com/rewindio/eight_ball/workflows/tag-and-release/badge.svg)\n\nEightBall is a feature toggle querying gem\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'eight_ball'\n```\n\nAnd then execute:\n\n```ruby\nbundle\n```\n\nOr install it yourself as:\n\n```ruby\ngem install eight_ball\n```\n\n## Example Usage\n\n```ruby\nrequire 'eight_ball'\n\n# This could be read from the filesystem or be the response from an external service, etc.\njson_input = %(\n  [{\n    \"name\": \"Feature1\",\n    \"enabledFor\": [{\n      \"type\": \"range\",\n      \"parameter\": \"accountId\",\n      \"min\": 1,\n      \"max\": 10\n    }],\n    \"disabledFor\": [{\n      \"type\": \"list\",\n      \"parameter\": \"accountId\",\n      \"values\": [2, 3]\n    }]\n  }]\n)\n\n# Transform the JSON into a list of Features\nmarshaller = EightBall::Marshallers::Json.new\nfeatures = marshaller.unmarshall json_input\n\n# Tell EightBall about these Features\nEightBall.provider = EightBall::Providers::Static.new features\n\n# Away you go\nEightBall.enabled? \"Feature1\", { accountId: 4 } # true\nEightBall.enabled? \"Feature1\", { accountId: 2 } # false\n```\n\nMore examples [here](examples)\n\n## Concepts\n\n### Feature\n\nA Feature is a part of your application that can be enabled or disabled based on various conditions. It has the following attributes:\n\n- `name`: The unique name of the Feature.\n- `enabledFor`: An array of Conditions for which the Feature is enabled.\n- `disabledFor`: An array of Conditions for which the Feature is disabled.\n\n### Condition\n\nA Condition must either be `true` or `false`. It describes when a Feature is enabled or disabled.\n\n#### Supported Conditions\n\n- [Always](lib/eight_ball/conditions/always.rb):  This condition is always satisfied.\n- [List](lib/eight_ball/conditions/list.rb): This condition is satisfied if the given value belongs to its list of accepted values.\n- [Never](lib/eight_ball/conditions/never.rb): This condition is never satisfied.\n- [Range](lib/eight_ball/conditions/range.rb): This condition is satisfied if the given value is within the specified range (inclusive).\n\n### Provider\n\nA Provider is able to give EightBall the list of Features it needs to answer queries.\n\n#### Supported Providers\n\n- [HTTP](lib/eight_ball/providers/http.rb): Connect to a URL and use the given Marshaller to convert the response into a list of Features.\n- [Static](lib/eight_ball/providers/static.rb): Once initialized with a list of Features, always provides that same list of Features.\n\n### RefreshPolicies\n\nSome Providers are able to automatically \"refresh\" their list of Features using a RefreshPolicy.\n\n#### Supported RefreshPolicies\n\n- [Interval](lib/eight_ball/providers/refresh_policies/interval.rb): The data is considered fresh for a given number of seconds, after which it is considered stale and should be refreshed.\n\n### Marshallers\n\nA Marshaller converts Features to and from another format.\n\n#### Supported Marshaller\n\n- [JSON](lib/eight_ball/marshallers/json.rb)\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n### Documenting\n\nDocumentation is written using [yard](https://yardoc.org/) syntax. You can view the generated docs by running `yard server` and going to `http://127.0.0.1:8808/docs/EightBall`\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/rewindio/eight_ball.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frewindio%2Feight_ball","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frewindio%2Feight_ball","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frewindio%2Feight_ball/lists"}