more_core_extensions 4.4.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.codeclimate.yml +1 -1
- data/.github/workflows/ci.yaml +35 -10
- data/CHANGELOG.md +13 -1
- data/Gemfile +17 -8
- data/README.md +1 -1
- data/lib/more_core_extensions/core_ext/array/deletes.rb +1 -0
- data/lib/more_core_extensions/core_ext/array/math.rb +1 -0
- data/lib/more_core_extensions/core_ext/class/hierarchy.rb +15 -2
- data/lib/more_core_extensions/core_ext/digest/uuid.rb +1 -0
- data/lib/more_core_extensions/core_ext/hash/deletes.rb +1 -0
- data/lib/more_core_extensions/core_ext/object.rb +1 -0
- data/lib/more_core_extensions/version.rb +1 -1
- data/renovate.json +5 -0
- metadata +4 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ced7c939c05faca2a89523a16b2cb99ef5ef74306cd895f9fa9fb0d0dbbb977
|
|
4
|
+
data.tar.gz: 2e4e62baa0f4c8a3c6f127c1174ffa5d9eb9da3e19e19e78e625edd4722a7616
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a2948631d076fe1053ca6d4a4eaa4cf57d3a5ae57fce2b44d095bbf890e5e7ea1c876f28109620609d5abc04494e4315036a3292521623c25428ee6897c350ea
|
|
7
|
+
data.tar.gz: dd55f503cdb34cdc642df2689bb7b60054356f4dd20c521212bc9e0b4d648a81949827fbe696f86bc2a0fdd947e615de64fe8414942ce2b43ae8cce999aeba8a
|
data/.codeclimate.yml
CHANGED
data/.github/workflows/ci.yaml
CHANGED
|
@@ -1,33 +1,58 @@
|
|
|
1
|
+
---
|
|
1
2
|
name: CI
|
|
2
|
-
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
pull_request:
|
|
6
6
|
schedule:
|
|
7
|
-
- cron:
|
|
8
|
-
|
|
7
|
+
- cron: 0 0 * * 0
|
|
9
8
|
jobs:
|
|
10
9
|
ci:
|
|
11
10
|
runs-on: ubuntu-latest
|
|
12
11
|
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
13
|
matrix:
|
|
14
14
|
ruby-version:
|
|
15
|
-
- '2.5'
|
|
16
|
-
- '2.6'
|
|
17
15
|
- '2.7'
|
|
18
16
|
- '3.0'
|
|
17
|
+
- '3.1'
|
|
18
|
+
- '3.2'
|
|
19
|
+
- '3.3'
|
|
20
|
+
rails-version:
|
|
21
|
+
- '6.0'
|
|
22
|
+
- '6.1'
|
|
23
|
+
- '7.0'
|
|
24
|
+
- '7.1'
|
|
25
|
+
include:
|
|
26
|
+
# Rails 7.0 and 7.1 support Ruby >= 2.7.0
|
|
27
|
+
- ruby-version: '2.5'
|
|
28
|
+
rails-version: '6.0'
|
|
29
|
+
- ruby-version: '2.5'
|
|
30
|
+
rails-version: '6.1'
|
|
31
|
+
- ruby-version: '2.6'
|
|
32
|
+
rails-version: '6.0'
|
|
33
|
+
- ruby-version: '2.6'
|
|
34
|
+
rails-version: '6.1'
|
|
35
|
+
# Rails 7.2 supports Ruby >= 3.1.0
|
|
36
|
+
- ruby-version: '3.1'
|
|
37
|
+
rails-version: '7.2'
|
|
38
|
+
- ruby-version: '3.2'
|
|
39
|
+
rails-version: '7.2'
|
|
40
|
+
- ruby-version: '3.3'
|
|
41
|
+
rails-version: '7.2'
|
|
19
42
|
env:
|
|
20
|
-
|
|
43
|
+
TEST_RAILS_VERSION: "${{ matrix.rails-version }}"
|
|
44
|
+
CC_TEST_REPORTER_ID: "${{ secrets.CC_TEST_REPORTER_ID }}"
|
|
21
45
|
steps:
|
|
22
|
-
- uses: actions/checkout@
|
|
46
|
+
- uses: actions/checkout@v4
|
|
23
47
|
- name: Set up Ruby
|
|
24
48
|
uses: ruby/setup-ruby@v1
|
|
25
49
|
with:
|
|
26
|
-
ruby-version: ${{ matrix.ruby-version }}
|
|
50
|
+
ruby-version: "${{ matrix.ruby-version }}"
|
|
27
51
|
bundler-cache: true
|
|
52
|
+
timeout-minutes: 30
|
|
28
53
|
- name: Run tests
|
|
29
54
|
run: bundle exec rake
|
|
30
55
|
- name: Report code coverage
|
|
31
|
-
if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.
|
|
56
|
+
if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.1' }}
|
|
32
57
|
continue-on-error: true
|
|
33
|
-
uses: paambaati/codeclimate-action@
|
|
58
|
+
uses: paambaati/codeclimate-action@v9
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [4.5.1] - 2025-01-31
|
|
8
|
+
### Fixed
|
|
9
|
+
- Fix issues where active_support does not require logger properly [[#127](https://github.com/ManageIQ/more_core_extensions/pull/127)]
|
|
10
|
+
|
|
11
|
+
## [4.5.0] - 2024-09-03
|
|
12
|
+
### Added
|
|
13
|
+
- Added Ruby 3.0 and 3.1 support [[#114](https://github.com/ManageIQ/more_core_extensions/pull/114)]
|
|
14
|
+
- Added Ruby 3.2 and 3.3 support [[#123](https://github.com/ManageIQ/more_core_extensions/pull/123)]
|
|
15
|
+
- Add Class#hierarchy block support to allow formatting of classes [[#113](https://github.com/ManageIQ/more_core_extensions/pull/113)]
|
|
16
|
+
|
|
7
17
|
## [4.4.0] - 2022-03-01
|
|
8
18
|
### Added
|
|
9
19
|
- Add support for Rails 7 ActiveSupport [[#105](https://github.com/ManageIQ/more_core_extensions/pull/105)]
|
|
@@ -112,7 +122,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
112
122
|
- Upgraded to RSpec 3 [[#16](https://github.com/ManageIQ/more_core_extensions/pull/16)]
|
|
113
123
|
- Added the Change Log!
|
|
114
124
|
|
|
115
|
-
[Unreleased]: https://github.com/ManageIQ/more_core_extensions/compare/v4.
|
|
125
|
+
[Unreleased]: https://github.com/ManageIQ/more_core_extensions/compare/v4.5.1...HEAD
|
|
126
|
+
[4.5.1]: https://github.com/ManageIQ/more_core_extensions/compare/v4.5.0...v4.5.1
|
|
127
|
+
[4.5.0]: https://github.com/ManageIQ/more_core_extensions/compare/v4.3.1...v4.5.0
|
|
116
128
|
[4.4.0]: https://github.com/ManageIQ/more_core_extensions/compare/v4.3.1...v4.4.0
|
|
117
129
|
[4.3.1]: https://github.com/ManageIQ/more_core_extensions/compare/v4.3.0...v4.3.1
|
|
118
130
|
[4.3.0]: https://github.com/ManageIQ/more_core_extensions/compare/v4.2.0...v4.3.0
|
data/Gemfile
CHANGED
|
@@ -6,11 +6,20 @@ require File.join(Bundler::Plugin.index.load_paths("bundler-inject")[0], "bundle
|
|
|
6
6
|
# Specify your gem's dependencies in more_core_extensions.gemspec
|
|
7
7
|
gemspec
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
minimum_version =
|
|
10
|
+
case ENV.fetch("TEST_RAILS_VERSION", "7.2")
|
|
11
|
+
when "7.2"
|
|
12
|
+
"~>7.2.2"
|
|
13
|
+
when "7.1"
|
|
14
|
+
"~>7.1.5"
|
|
15
|
+
when "7.0"
|
|
16
|
+
"~>7.0.8"
|
|
17
|
+
when "6.1"
|
|
18
|
+
"~>6.1.7"
|
|
19
|
+
when "6.0"
|
|
20
|
+
"~>6.0.6"
|
|
21
|
+
else
|
|
22
|
+
raise "Unexpected Rails version #{ENV['TEST_RAILS_VERSION'].inspect}"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
gem "activesupport", minimum_version
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ MoreCoreExtensions are a set of core extensions beyond those provided by ActiveS
|
|
|
4
4
|
|
|
5
5
|
[](http://badge.fury.io/rb/more_core_extensions)
|
|
6
6
|
[](https://github.com/ManageIQ/more_core_extensions/actions/workflows/ci.yaml)
|
|
7
|
-
[](https://codeclimate.com/github/ManageIQ/more_core_extensions)
|
|
8
8
|
[](https://coveralls.io/r/ManageIQ/more_core_extensions)
|
|
9
9
|
|
|
10
10
|
[](https://gitter.im/ManageIQ/more_core_extensions?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require "logger" # Require logger due to active_support breaking on Rails <= 7.0. See https://github.com/rails/rails/pull/54264
|
|
1
2
|
require 'active_support'
|
|
2
3
|
require 'active_support/core_ext/class/subclasses'
|
|
3
4
|
require 'active_support/core_ext/object/try'
|
|
@@ -22,6 +23,8 @@ module MoreCoreExtensions
|
|
|
22
23
|
|
|
23
24
|
# Returns a tree-like Hash structure of all descendants.
|
|
24
25
|
#
|
|
26
|
+
# If a block is passed, that block is used to format the keys of the hierarchy
|
|
27
|
+
#
|
|
25
28
|
# require 'socket'
|
|
26
29
|
# IO.hierarchy
|
|
27
30
|
# # => {BasicSocket=>
|
|
@@ -29,8 +32,18 @@ module MoreCoreExtensions
|
|
|
29
32
|
# # IPSocket=>{TCPSocket=>{TCPServer=>{}}, UDPSocket=>{}},
|
|
30
33
|
# # UNIXSocket=>{UNIXServer=>{}}},
|
|
31
34
|
# # File=>{}}
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
#
|
|
36
|
+
# IO.hierarchy(&:name)
|
|
37
|
+
# # => {"BasicSocket"=>
|
|
38
|
+
# # {"Socket"=>{},
|
|
39
|
+
# # "IPSocket"=>{"TCPSocket"=>{"TCPServer"=>{}}, "UDPSocket"=>{}},
|
|
40
|
+
# # "UNIXSocket"=>{"UNIXServer"=>{}}},
|
|
41
|
+
# # "File"=>{}}
|
|
42
|
+
def hierarchy(&block)
|
|
43
|
+
subclasses.each_with_object({}) do |k, h|
|
|
44
|
+
key = block ? yield(k) : k
|
|
45
|
+
h[key] = k.hierarchy(&block)
|
|
46
|
+
end
|
|
34
47
|
end
|
|
35
48
|
|
|
36
49
|
# Returns an Array of all superclasses.
|
data/renovate.json
ADDED
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: more_core_extensions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Frey
|
|
8
8
|
- Brandon Dunne
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: exe
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2025-01-31 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: activesupport
|
|
@@ -198,11 +197,11 @@ files:
|
|
|
198
197
|
- lib/more_core_extensions/core_ext/symbol/to_i.rb
|
|
199
198
|
- lib/more_core_extensions/version.rb
|
|
200
199
|
- more_core_extensions.gemspec
|
|
200
|
+
- renovate.json
|
|
201
201
|
homepage: http://github.com/ManageIQ/more_core_extensions
|
|
202
202
|
licenses:
|
|
203
203
|
- MIT
|
|
204
204
|
metadata: {}
|
|
205
|
-
post_install_message:
|
|
206
205
|
rdoc_options: []
|
|
207
206
|
require_paths:
|
|
208
207
|
- lib
|
|
@@ -217,8 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
217
216
|
- !ruby/object:Gem::Version
|
|
218
217
|
version: '0'
|
|
219
218
|
requirements: []
|
|
220
|
-
rubygems_version: 3.
|
|
221
|
-
signing_key:
|
|
219
|
+
rubygems_version: 3.6.2
|
|
222
220
|
specification_version: 4
|
|
223
221
|
summary: MoreCoreExtensions are a set of core extensions beyond those provided by
|
|
224
222
|
ActiveSupport.
|