{"id":18359462,"url":"https://github.com/shivam091/core_extensions","last_synced_at":"2026-04-22T21:39:35.386Z","repository":{"id":178853283,"uuid":"662459449","full_name":"shivam091/core_extensions","owner":"shivam091","description":"rb_core_extensions is a set of core extensions beyond those provided by Ruby \u0026 ActiveSupport.","archived":false,"fork":false,"pushed_at":"2023-07-07T06:32:32.000Z","size":424,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T06:19:52.486Z","etag":null,"topics":["activesupport","core","core-extension","extensions","rails","ruby"],"latest_commit_sha":null,"homepage":"https://shivam091.github.io/core_extensions/","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/shivam091.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-05T07:25:14.000Z","updated_at":"2023-07-07T05:58:15.000Z","dependencies_parsed_at":"2023-10-01T15:29:08.864Z","dependency_job_id":null,"html_url":"https://github.com/shivam091/core_extensions","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"53dfa9f3e0a56575363a9b5b3401d693e046538c"},"previous_names":["shivam091/core_extensions"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/shivam091/core_extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivam091%2Fcore_extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivam091%2Fcore_extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivam091%2Fcore_extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivam091%2Fcore_extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shivam091","download_url":"https://codeload.github.com/shivam091/core_extensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivam091%2Fcore_extensions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260976921,"owners_count":23091528,"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":["activesupport","core","core-extension","extensions","rails","ruby"],"created_at":"2024-11-05T22:22:55.772Z","updated_at":"2026-04-22T21:39:30.360Z","avatar_url":"https://github.com/shivam091.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rb_core_extensions\n\n`rb_core_extensions` is a set of core extensions beyond those provided by `Ruby` and `ActiveSupport`.\n\n[![Ruby](https://github.com/shivam091/core_extensions/actions/workflows/main.yml/badge.svg)](https://github.com/shivam091/rb_core_extensions/actions/workflows/main.yml)\n[![Gem Version](https://badge.fury.io/rb/rb_core_extensions.svg)](https://badge.fury.io/rb/rb_core_extensions)\n[![Gem Downloads](https://img.shields.io/gem/dt/rb_core_extensions.svg)](http://rubygems.org/gems/rb_core_extensions)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/592b82a5336ee551a8f1/test_coverage)](https://codeclimate.com/github/shivam091/core_extensions/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/592b82a5336ee551a8f1/maintainability)](https://codeclimate.com/github/shivam091/core_extensions/maintainability)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/shivam091/core_extensions/blob/main/LICENSE.txt)\n\n## Minimum Requirements\n\n* Ruby 3.2.2+ (https://www.ruby-lang.org/en/downloads/branches/)\n\n## Installation\n\nIf using bundler, first add this line to your application's Gemfile:\n\n```ruby\ngem 'rb_core_extensions'\n```\n\nAnd then execute:\n\n`$ bundle install`\n\nOr otherwise simply install it yourself as:\n\n`$ gem install rb_core_extensions`\n\n### Usage\n\nLoading all core extensions at once:\n\n```ruby\nrequire \"core_extensions/all\"\n```\n\nCherry-picking only what you want:\n\n```ruby\nrequire \"core_extensions/array\"\nrequire \"core_extensions/array/math\"\nrequire \"core_extensions/date\"\n```\n\n## Extensions Provided\n\nBelow are the extension methods provided by `rb_core_extensions`. Please refer [documentation](https://shivam091.github.io/core_extensions) for examples of how to use these methods.\n\n### [Array](https://shivam091.github.io/core_extensions/Array.html)\n\n#### ***core_extensions/array/delete.rb***\n1. **[`#take!`](https://shivam091.github.io/core_extensions/Array.html#method-i-take-21)** - Alters the array by removing first `n` elements.\n\n#### ***core_extensions/array/math.rb***\n1. **[`round`](https://shivam091.github.io/core_extensions/Array.html#method-i-round)** - Rounds each element of the numeric array up to specified `precision`.\n2. **[`mean`](https://shivam091.github.io/core_extensions/Array.html#method-i-mean)** - Returns the mean of the array of `Numeric`.\n3. **[`variance`](https://shivam091.github.io/core_extensions/Array.html#method-i-variance)** - Returns the variance of the array of `Numeric`.\n4. **[`stddev`](https://shivam091.github.io/core_extensions/Array.html#method-i-stddev)** - Returns the standard deviation of the array of `Numeric`.\n\n#### ***core_extensions/array/duplicates.rb***\n1. **[`duplicates`](https://shivam091.github.io/core_extensions/Array.html#method-i-duplicates)** - Returns an array of the duplicate elements.\n\n#### ***core_extensions/array/inclusion.rb***\n1. **[`include_any?`](https://shivam091.github.io/core_extensions/Array.html#method-i-include_any-3F)** - Returns whether the array contains any of the `elements`.\n2. **[`include_none?`](https://shivam091.github.io/core_extensions/Array.html#method-i-include_none-3F)** - Returns whether the array contains none of the `elements`.\n3. **[`include_all?`](https://shivam091.github.io/core_extensions/Array.html#method-i-include_all-3F)** - Returns whether the array contains all of the `elements`.\n4. **[`includes_index?`](https://shivam091.github.io/core_extensions/Array.html#method-i-includes_index-3F)** - Returns whether the array has a value at the specified `index`.\n\n### [Hash](https://shivam091.github.io/core_extensions/Hash.html)\n\n#### ***core_extensions/hash/inclusion.rb***\n1. **[`#keys?`](https://shivam091.github.io/core_extensions/Hash.html#method-i-keys-3F)** - Returns whether the hash contains all of the specified `keys`.\n#### ***core_extensions/hash/access.rb***\n1. **[`#keys_at`](https://shivam091.github.io/core_extensions/Hash.html#method-i-keys_at)** - Returns the array of keys of an occurrence of given `values`.\n#### ***core_extensions/hash/delete.rb***\n1. **[`#slice!`](https://shivam091.github.io/core_extensions/Hash.html#method-i-slice-21)** - Alters the hash by keeping only specified `keys` and returns it.\n\n### [TrueClass](https://shivam091.github.io/core_extensions/TrueClass.html)\n\n#### ***core_extensions/true_class.rb***\n1. **[`#to_i`](https://shivam091.github.io/core_extensions/TrueClass.html#method-i-to_i)** - Returns `1` if invoked on `TrueClass` instance.\n2. **[`#to_b`](https://shivam091.github.io/core_extensions/TrueClass.html#method-i-to_b)** - Returns `true` if invoked on `TrueClass` instance.\n\n### [FalseClass](https://shivam091.github.io/core_extensions/FalseClass.html)\n\n#### ***core_extensions/false_class.rb***\n1. **[`#to_i`](https://shivam091.github.io/core_extensions/FalseClass.html#method-i-to_i)** - Returns `0` if invoked on `FalseClass` instance.\n2. **[`#to_b`](https://shivam091.github.io/core_extensions/FalseClass.html#method-i-to_b)** - Returns `false` if invoked on `FalseClass` instance.\n\n### [NilClass](https://shivam091.github.io/core_extensions/NilClass.html)\n\n#### ***core_extensions/nil_class.rb***\n1. **[`#blank?`](https://shivam091.github.io/core_extensions/NilClass.html#method-i-blank-3F)** - Returns `true` if invoked on `NilClass` instance.\n2. **[`#to_b`](https://shivam091.github.io/core_extensions/NilClass.html#method-i-to_b)** - Returns `false` if invoked on `NilClass` instance.\n\n### [Object](https://shivam091.github.io/core_extensions/Object.html)\n\n#### ***core_extensions/object.rb***\n1. **[`#is_one_of?`](https://shivam091.github.io/core_extensions/Object.html#method-i-is_one_of-3F)** - Returns `true` if the receiver object is an instance of at least one of the classes specified by `args`.\n2. **[`#deep_send`](https://shivam091.github.io/core_extensions/Object.html#method-i-deep_send)** - Invokes the specified methods continuously, unless encountering a `nil` value.\n3. **[`#in_namespace?`](https://shivam091.github.io/core_extensions/Object.html#method-i-in_namespace-3F)** - Returns whether or not the object is in the given namespace.\n\n### [Module](https://shivam091.github.io/core_extensions/Module.html)\n\n#### ***core_extensions/module.rb***\n1. **[`#namespaces`](https://shivam091.github.io/core_extensions/Module.html#method-i-namespaces)** - Returns an `Array` with the namespaces to the current `Module`.\n\n### [Class](https://shivam091.github.io/core_extensions/Class.html)\n\n#### ***core_extensions/class.rb***\n1. **[`#hierarchy`](https://shivam091.github.io/core_extensions/Class.html#method-i-hierarchy)** - Returns a tree-like `Hash` structure of all descendants.\n2. **[`#lineage`](https://shivam091.github.io/core_extensions/Class.html#method-i-lineage)** - Returns an `Array` of all superclasses.\n3. **[`#leaf_subclasses`](https://shivam091.github.io/core_extensions/Class.html#method-i-leaf_subclasses)** - Returns an `Array` of all descendants which have no subclasses.\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## License\n\nCopyright 2023 [Harshal V. LADHE](https://github.com/shivam091), Released under the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivam091%2Fcore_extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshivam091%2Fcore_extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivam091%2Fcore_extensions/lists"}