{"id":18728782,"url":"https://github.com/rubyonworld/content_spinning","last_synced_at":"2025-11-12T05:30:19.743Z","repository":{"id":174007875,"uuid":"540252256","full_name":"RubyOnWorld/content_spinning","owner":"RubyOnWorld","description":"ContentSpinning is a ruby library made to spin some text. It manages nested spinning.","archived":false,"fork":false,"pushed_at":"2022-09-23T02:41:02.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T14:26:34.534Z","etag":null,"topics":["library","made","ruby","spin"],"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/RubyOnWorld.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":"2022-09-23T02:40:45.000Z","updated_at":"2022-09-27T21:09:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a4f7f1f-c1a7-4b21-ba2b-4c9ad73713a6","html_url":"https://github.com/RubyOnWorld/content_spinning","commit_stats":null,"previous_names":["rubyonworld/content_spinning"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcontent_spinning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcontent_spinning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcontent_spinning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fcontent_spinning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/content_spinning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239599040,"owners_count":19665911,"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":["library","made","ruby","spin"],"created_at":"2024-11-07T14:24:20.109Z","updated_at":"2025-11-12T05:30:19.659Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Content Spinning\n\n[![Gem Version](https://badge.fury.io/rb/content_spinning.svg)](https://badge.fury.io/rb/content_spinning) [![Build Status](https://travis-ci.org/maximeg/content_spinning.svg?branch=master)](https://travis-ci.org/maximeg/content_spinning)\n\n`ContentSpinning` is a ruby library made to spin some text.\nIt manages nested spinning.\n\n## Example\n\n```ruby\n\"Hi {there|you}! I'm {efficient|productive}.\".spin\n# or\nContentSpinning.spin(\"Hi {there|you}! I'm {efficient|productive}.\")\n```\n\nreturns this array :\n\n```ruby\n[\n  \"Hi there! I'm efficient.\",\n  \"Hi there! I'm productive.\",\n  \"Hi you! I'm efficient.\",\n  \"Hi you! I'm productive.\"\n]\n```\n\n## Install\n\n```\ngem install content_spinning\n```\n\n## Usage\n\n### All spins\n\nCalculating the number of possibilities:\n\n```ruby\n\u003e ContentSpinning.new(\"Hi {there|you}! I'm {efficient|productive}.\").count\n\n4\n```\n\nGenerating:\n\n```ruby\n\u003e ContentSpinning.new(\"Hi {there|you}! I'm {efficient|productive}.\").spin\n\n[\n  \"Hi there! I'm efficient.\",\n  \"Hi there! I'm productive.\",\n  \"Hi you! I'm efficient.\",\n  \"Hi you! I'm productive.\"\n]\n```\n\nBeware, spins being combinatory, generating all the spins could be quite long.\n\n### Partial spins\n\nThere is no guaranty of unicity among the results returned (this is random).\nIf you ask for a limit greater than the number of possibilities, this returns all the possibilities.\n\n```ruby\n\u003e ContentSpinning.new(\"Hi {there|you}! I'm {efficient|productive}.\").spin(limit: 2)\n\n[\n  \"Hi there! I'm efficient.\",\n  \"Hi you! I'm productive.\"\n]\n\n\u003e ContentSpinning.new(\"Hi {there|you}! I'm {efficient|productive}.\").spin(limit: 500)\n\n[\n  \"Hi there! I'm efficient.\",\n  \"Hi there! I'm productive.\",\n  \"Hi you! I'm efficient.\",\n  \"Hi you! I'm productive.\"\n]\n```\n\n## Todo\n\nA few things to do :\n\n* Executable\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fcontent_spinning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Fcontent_spinning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fcontent_spinning/lists"}