{"id":20057602,"url":"https://github.com/todesking/ruby-count_by","last_synced_at":"2025-05-05T14:31:14.807Z","repository":{"id":7896516,"uuid":"9275848","full_name":"todesking/ruby-count_by","owner":"todesking","description":"Enumerable#count_by gem","archived":false,"fork":false,"pushed_at":"2013-09-01T08:04:38.000Z","size":176,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T04:43:00.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/todesking.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}},"created_at":"2013-04-07T11:51:46.000Z","updated_at":"2020-05-07T17:47:46.000Z","dependencies_parsed_at":"2022-08-20T15:10:40.655Z","dependency_job_id":null,"html_url":"https://github.com/todesking/ruby-count_by","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todesking%2Fruby-count_by","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todesking%2Fruby-count_by/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todesking%2Fruby-count_by/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todesking%2Fruby-count_by/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/todesking","download_url":"https://codeload.github.com/todesking/ruby-count_by/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252514910,"owners_count":21760463,"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":[],"created_at":"2024-11-13T12:59:36.783Z","updated_at":"2025-05-05T14:31:14.569Z","avatar_url":"https://github.com/todesking.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# count_by\n\n[![Build Status](https://travis-ci.org/todesking/ruby-count_by.png?branch=master)](https://travis-ci.org/todesking/ruby-count_by)\n\nThis gem provides `Enumerable#count_by(\u0026block)`, take a block for compute key value and returns `{ key =\u003e count_of_key_in_the_collection }`.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'count_by'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install count_by\n\n## Usage\n\n```ruby\n[1, 1, 2, 3, 4, 5].count_by{|x| x % 3}\n#=\u003e {1=\u003e3, 2=\u003e2, 0=\u003e1}\n\nenum = [1, 1, 2, 3, 4, 5].count_by\n#=\u003e #\u003cEnumerator: ...\u003e\nenum.each{|x| x % 3}\n#=\u003e {1=\u003e3, 2=\u003e2, 0=\u003e1}\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Changes\n\n### 1.1.0(Unreleased)\n\n* Call `count_by` without a block returns Enumerator\n\n### 1.0.0\n\n* Initial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodesking%2Fruby-count_by","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftodesking%2Fruby-count_by","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodesking%2Fruby-count_by/lists"}