{"id":15240468,"url":"https://github.com/nisevi/thanoscase","last_synced_at":"2025-04-10T13:43:06.611Z","repository":{"id":50781268,"uuid":"183826215","full_name":"nisevi/thanoscase","owner":"nisevi","description":"Randomly removes half the characters of a given string","archived":false,"fork":false,"pushed_at":"2024-08-01T23:47:46.000Z","size":30,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T12:21:47.663Z","etag":null,"topics":["circleci","continuous-integration","gem","monkey-patching","rspec","rspec-testing","ruby","ruby-gem","ruby-library","rubygem","rubygems","string"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/thanoscase","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/nisevi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-04-27T22:11:44.000Z","updated_at":"2021-05-29T22:19:06.000Z","dependencies_parsed_at":"2025-02-17T10:41:38.913Z","dependency_job_id":null,"html_url":"https://github.com/nisevi/thanoscase","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nisevi%2Fthanoscase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nisevi%2Fthanoscase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nisevi%2Fthanoscase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nisevi%2Fthanoscase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nisevi","download_url":"https://codeload.github.com/nisevi/thanoscase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248226297,"owners_count":21068179,"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":["circleci","continuous-integration","gem","monkey-patching","rspec","rspec-testing","ruby","ruby-gem","ruby-library","rubygem","rubygems","string"],"created_at":"2024-09-29T11:05:08.445Z","updated_at":"2025-04-10T13:43:06.586Z","avatar_url":"https://github.com/nisevi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maintainability](https://api.codeclimate.com/v1/badges/e44605df0cb27199d63f/maintainability)](https://codeclimate.com/github/nisevi/thanoscase/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/e44605df0cb27199d63f/test_coverage)](https://codeclimate.com/github/nisevi/thanoscase/test_coverage) [![Build Status](https://semaphoreci.com/api/v1/nisevi/thanoscase/branches/master/shields_badge.svg)](https://semaphoreci.com/nisevi/thanoscase) [![Gem Version](https://badge.fury.io/rb/thanoscase.svg)](https://badge.fury.io/rb/thanoscase) \n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fnisevi%2Fthanoscase.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fnisevi%2Fthanoscase?ref=badge_shield) \n\n# Thanoscase\n\nWipes out your strings from the universe\n\n# Installation\n\nIn your gemfile:\n\n```ruby\ngem 'thanoscase'\n``` \n\nor in the console:\n\n```ruby\ngem install thanoscase\n```\n\n# Usage\n\nThis gem MonkeyPatches the String class for adding two new methods:\n\n```ruby\nclass String\n  def thanoscase!\n    return self if empty?\n    half_universe = length/2\n    half_universe.times { slice!(rand(length)) }\n    self\n  end\n\n  def thanoscase\n    dup.thanoscase!\n  end\nend\n```\n\nIt will randomly eliminate half the characters you have in the string:\n\n```ruby\n\"Marvel Universe\".thanoscase # \"arel Uve\"\n\"Marvel Universe\".thanoscase # \"rvlUners\"\n\"Marvel Universe\".thanoscase # \"Marel ie\"\n```\n\n- If the amount of characters is even you will get half of them as return.\n  ```ruby\n    \"1234\".thanoscase # \"14\"\n    \"1234\".thanoscase # \"12\"\n    \"1234\".thanoscase # \"34\"\n  ```\n- If the amount of characters is odd you will get half of them plus one.\n  ```ruby\n    \"123\".thanoscase # \"23\"\n    \"123\".thanoscase # \"12\"\n    \"123\".thanoscase # \"13\"\n  ```\n- If you try to apply this method to an empty string, it will return the same empty string.\n  ```ruby\n    \"\".thanoscase # \"\"\n  ```\n\nYou can also modify the object it`self` like so:\n\n```ruby\nstr = \"Avengers\"\n# \"Avengers\"\nstr.thanoscase\n# \"Aves\"\nstr\n# \"Avengers\"\nstr.thanoscase!\n# \"vegr\"\nstr\n# \"vegr\"\n```\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fnisevi%2Fthanoscase.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fnisevi%2Fthanoscase?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnisevi%2Fthanoscase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnisevi%2Fthanoscase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnisevi%2Fthanoscase/lists"}