everythingrb 0.9.0 → 0.9.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/CHANGELOG.md +8 -1
- data/README.md +2 -21
- data/lib/everythingrb/hash.rb +5 -0
- data/lib/everythingrb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7361ef45ed502564c8e27fd3b2173702320f2076665ae9f495f5645fc7b57587
|
|
4
|
+
data.tar.gz: 411dc777df9851c7204903dde8ce12ce6951cf2308d9c02e6184bf0fef67a056
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 548f88f645e3d1731ccbe258e9e8d4157003f9b5f584942f8a2b14657bab1c04de965c16bd2a7bb0f2305edfc92c3e73c5bcd7a07f9627cccd3eef46e5488076
|
|
7
|
+
data.tar.gz: fb00c066860dc38a4b8b1091978618af0d6ee06bc477dbdb9d2a8603e043e0de8b7b93aab09964035f13efae77e0ec0a05fa00ea6caa3a70ad9d1c32b577c8d4
|
data/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
15
|
### Removed
|
|
16
16
|
-->
|
|
17
17
|
|
|
18
|
+
## [0.9.1] - 12026-01-22
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- **Deprecated `Hash.new_nested_hash`** - This method is now deprecated and will be removed in v1.0.0. Consider using `Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }` instead.
|
|
23
|
+
|
|
18
24
|
## [0.9.0] - 12025-08-01
|
|
19
25
|
|
|
20
26
|
### Added
|
|
@@ -342,7 +348,8 @@ This change aligns our method signatures with Ruby's conventions and matches our
|
|
|
342
348
|
|
|
343
349
|
- Added alias `each` to `each_pair` in OpenStruct for better enumerable compatibility
|
|
344
350
|
|
|
345
|
-
[unreleased]: https://github.com/itsthedevman/everythingrb/compare/v0.9.
|
|
351
|
+
[unreleased]: https://github.com/itsthedevman/everythingrb/compare/v0.9.1...HEAD
|
|
352
|
+
[0.9.1]: https://github.com/itsthedevman/everythingrb/compare/v0.9.0...v0.9.1
|
|
346
353
|
[0.9.0]: https://github.com/itsthedevman/everythingrb/compare/v0.8.3...v0.9.0
|
|
347
354
|
[0.8.3]: https://github.com/itsthedevman/everythingrb/compare/v0.8.2...v0.8.3
|
|
348
355
|
[0.8.3]: https://github.com/itsthedevman/everythingrb/compare/v0.8.2...v0.8.3
|
data/README.md
CHANGED
|
@@ -307,26 +307,7 @@ _Methods used: [`to_or_sentence`](https://itsthedevman.com/docs/everythingrb/Arr
|
|
|
307
307
|
|
|
308
308
|
### Hash Convenience
|
|
309
309
|
|
|
310
|
-
Work with hashes more intuitively
|
|
311
|
-
|
|
312
|
-
```ruby
|
|
313
|
-
# BEFORE
|
|
314
|
-
stats = {}
|
|
315
|
-
stats[:server] ||= {}
|
|
316
|
-
stats[:server][:region] ||= {}
|
|
317
|
-
stats[:server][:region][:us_east] ||= {}
|
|
318
|
-
stats[:server][:region][:us_east][:errors] ||= []
|
|
319
|
-
stats[:server][:region][:us_east][:errors] << "Connection timeout"
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
```ruby
|
|
323
|
-
# AFTER
|
|
324
|
-
stats = Hash.new_nested_hash(depth: 3)
|
|
325
|
-
(stats[:server][:region][:us_east][:errors] ||= []) << "Connection timeout"
|
|
326
|
-
# No need to initialize each level first!
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
_Methods used: [`new_nested_hash`](https://itsthedevman.com/docs/everythingrb/Hash.html#new_nested_hash-class_method)_
|
|
310
|
+
Work with hashes more intuitively.
|
|
330
311
|
|
|
331
312
|
Transform values with access to their keys:
|
|
332
313
|
|
|
@@ -473,7 +454,7 @@ config.compact_blank_merge(timeout: "", retries: nil, debug: true, tags: [])
|
|
|
473
454
|
|
|
474
455
|
_Methods used: [`compact_blank_merge`](https://itsthedevman.com/docs/everythingrb/Hash.html#compact_blank_merge-instance_method)_
|
|
475
456
|
|
|
476
|
-
**Extensions:** [`
|
|
457
|
+
**Extensions:** [`transform_values(with_key: true)`](https://itsthedevman.com/docs/everythingrb/Hash.html#transform_values-instance_method), [`value_where`](https://itsthedevman.com/docs/everythingrb/Hash.html#value_where-instance_method), [`values_where`](https://itsthedevman.com/docs/everythingrb/Hash.html#values_where-instance_method), [`rename_key`](https://itsthedevman.com/docs/everythingrb/Hash.html#rename_key-instance_method), [`rename_keys`](https://itsthedevman.com/docs/everythingrb/Hash.html#rename_keys-instance_method), [`merge_if`](https://itsthedevman.com/docs/everythingrb/Hash.html#merge_if-instance_method), [`merge_if!`](https://itsthedevman.com/docs/everythingrb/Hash.html#merge_if%21-instance_method), [`merge_if_values`](https://itsthedevman.com/docs/everythingrb/Hash.html#merge_if_values-instance_method), [`merge_if_values!`](https://itsthedevman.com/docs/everythingrb/Hash.html#merge_if_values%21-instance_method), [`compact_merge`](https://itsthedevman.com/docs/everythingrb/Hash.html#compact_merge-instance_method), [`compact_merge!`](https://itsthedevman.com/docs/everythingrb/Hash.html#compact_merge%21-instance_method), [`compact_blank_merge`](https://itsthedevman.com/docs/everythingrb/Hash.html#compact_blank_merge-instance_method), [`compact_blank_merge!`](https://itsthedevman.com/docs/everythingrb/Hash.html#compact_blank_merge%21-instance_method)
|
|
477
458
|
|
|
478
459
|
### Array Cleaning
|
|
479
460
|
|
data/lib/everythingrb/hash.rb
CHANGED
|
@@ -78,6 +78,11 @@ class Hash
|
|
|
78
78
|
# parameter to control this behavior.
|
|
79
79
|
#
|
|
80
80
|
def self.new_nested_hash(depth: nil)
|
|
81
|
+
Everythingrb.deprecator.warn(
|
|
82
|
+
"Hash.new_nested_hash is deprecated and will be removed in v1.0.0. " \
|
|
83
|
+
"Consider using Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) } instead."
|
|
84
|
+
)
|
|
85
|
+
|
|
81
86
|
new do |hash, key|
|
|
82
87
|
next if depth == 0
|
|
83
88
|
|
data/lib/everythingrb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: everythingrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bryan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ostruct
|