nested_objects 0.1.16 → 0.1.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e46cbbe94fd34a0e69804d0ce6e1a6d3228fa5ff656db4e050c9d29c0e592fc
4
- data.tar.gz: 0adb30d3a7ead3749df4f863efaabd2dbc8bb20332ff5e7b1d131bc86dbeb267
3
+ metadata.gz: 83ade50105b58330d52486368bf31c36396ad6f12e135418bfb04be50b863764
4
+ data.tar.gz: e0fbfb421c4a4370cca8ff5660913baec9e8338b0a2a74d9a52b9c19003fa77e
5
5
  SHA512:
6
- metadata.gz: 69ce1523d3959da5f968dc197d1d2375afbdf25be62c5faea10c9cb911edc637733f9172e326e0b0be8b77e24b2880625ee3f8cc659dcc15098417e366ec22e2
7
- data.tar.gz: af925766a658fdef76b2ca260e9bdf6322afd737a35e16e56974e2ab7a1769d868fc7b0ec6c0b42d6358bd32c82e86774ecf3f16288da484dab16a8789182411
6
+ metadata.gz: 620c0900e01d2244c73159559e769a9f133dfba49b9caadb7bb306d7b18a13275ff150bdf28551592e62fb517796ec1c5f71907f6a5edb7e32a06779d6cc82e7
7
+ data.tar.gz: 8c0d7bc25ddf9fdef17def566c8fa850a7842ee7505590a3372525fc73ab9b901886d66d52338f4f4c53221cb6e6df06a2d76bc027f799e735ccf193a35dae78
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.1.16"
2
+ ".": "0.1.17"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.17](https://github.com/main-branch/nested_objects/compare/v0.1.16...v0.1.17) (2025-04-27)
4
+
5
+
6
+ ### Other Changes
7
+
8
+ * Update online yardoc links and simplify readme ([5777d3e](https://github.com/main-branch/nested_objects/commit/5777d3e6a643d3d14c05b1b699a20b0f9fdebebd))
9
+
3
10
  ## [0.1.16](https://github.com/main-branch/nested_objects/compare/v0.1.15...v0.1.16) (2025-04-27)
4
11
 
5
12
 
data/README.md CHANGED
@@ -2,72 +2,57 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/nested_objects.svg)](https://badge.fury.io/rb/nested_objects)
4
4
  [![Build Status](https://github.com/main-branch/nested_objects/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/main-branch/nested_objects/actions/workflows/continuous_integration.yml)
5
- [![Documentation](https://img.shields.io/badge/Documentation-Latest-green)](https://rubydoc.info/gems/nested_objects/)
5
+ [![Documentation](https://img.shields.io/badge/Documentation-Latest-green)](https://gemdocs.org/gems/nested_objects)
6
6
  [![Change Log](https://img.shields.io/badge/CHANGELOG-Latest-green)](https://rubydoc.info/gems/nested_objects/file/CHANGELOG.md)
7
7
  [![Slack](https://img.shields.io/badge/slack-main--branch/track__open__instances-yellow.svg?logo=slack)](https://main-branch.slack.com/archives/C01CHR7TMM2)
8
8
 
9
- The `NestedObjects` module provides module level methods to safely navigate and
9
+ The `NestedObjects` module provides module methods to safely navigate and
10
10
  manage a heirarchy of Ruby POROs nested using Hashes or Arrays. Think of these
11
11
  nested data objects like what you would get after reading in a JSON file.
12
12
 
13
- The key methods are:
13
+ ## Usage
14
14
 
15
- * `NestedObjects.deep_copy(data)` - returns a deep copy of data including nested hash
16
- values and array elements
17
- * `NestedObjects.dig(data, path)` - returns the value at the given path
18
- * `NestedObjects.bury(data, path, value)` - sets a value within the data structure at
19
- the given path
20
- * `NestedObjects.delete(data, path)` - deletes the Hash key or Array index at the
21
- given path
22
- * `NestedObjects.path?(data, path)` - returns true if the path exists in the given
23
- data structure
15
+ ### Module Methods
24
16
 
25
- These methods (prefixed with `nested_` to avoid method conflicts) can be mixed into
26
- `Object` for ease of use:
17
+ These methods are exposted on the `NestedObjects` module. The key methods are:
18
+ `deep_copy`, `dig`, `bury`, `delete`, and `path?`.
27
19
 
28
- ```Ruby
29
- Object.include NestedObjects::Mixin
20
+ Here is an example of using the `dig` method:
30
21
 
31
- data = { 'users' => [{ 'name' => 'John Smith'}, { 'name' => 'Jane Doe' }] }
22
+ ```Ruby
23
+ require 'nested_objects'
32
24
 
33
- data.nested_dig(%w[users 1 name]) #=> 'Jane Doe'
25
+ data = { 'people' => [{ 'name' => 'John'}, { 'name', 'Jane' }] }
26
+ path = 'people/0/name'.split('/')
27
+ NestedObjects.dig(data, path) #=> 'John'
34
28
  ```
35
29
 
36
- If the path is malformed or does not exist, a `BadPathError` will be raised.
37
-
38
- ## Development
39
-
40
- After checking out the repo, run `bin/setup` to install dependencies. Then, run
41
- `bundle exec rake` to run tests, static analysis, and build the gem.
42
-
43
- For experimentation, you can also run `bin/console` for an interactive (IRB) prompt that
44
- automatically requires nested_objects.
30
+ See documentation and examples of the full API in
31
+ [the gem's YARD documentation](https://gemdocs.org/gems/nested_objects/).
45
32
 
46
- ## Contributing
47
-
48
- Bug reports and pull requests are welcome on GitHub at <https://github.com/main-branch/nested_objects>.
33
+ ### Object Mixin
49
34
 
50
- ### Commit message guidelines
35
+ As a convenience, these methods can be mixed into other classes by including the `NestedObjects::Mixin` module.
51
36
 
52
- All commit messages must follow the [Conventional Commits
53
- standard](https://www.conventionalcommits.org/en/v1.0.0/). This helps us maintain a
54
- clear and structured commit history, automate versioning, and generate changelogs
55
- effectively.
37
+ In order to reduce the possibility of method name conflicts, all methods are prefixed with `nested_`.
56
38
 
57
- To ensure compliance, this project includes:
39
+ ```Ruby
40
+ Object.include NestedObjects::Mixin
58
41
 
59
- - A git commit-msg hook that validates your commit messages before they are accepted.
42
+ data = { 'people' => [{ 'name' => 'John'}, { 'name', 'Jane' }] }
43
+ path = 'people/0/name'.split('/')
44
+ data.nested_dig(path) #=> 'John'
45
+ ```
60
46
 
61
- To activate the hook, you must have node installed and run `npm install`.
47
+ ## Development
62
48
 
63
- - A GitHub Actions workflow that will enforce the Conventional Commit standard as
64
- part of the continuous integration pipeline.
49
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
50
+ `bundle exec rake` to run tests, static analysis, and build the gem.
65
51
 
66
- Any commit message that does not conform to the Conventional Commits standard will
67
- cause the workflow to fail and not allow the PR to be merged.
52
+ For experimentation, you can also run `bin/console` for an interactive (IRB) prompt
53
+ that automatically requires nested_objects.
68
54
 
69
- ### Pull request guidelines
55
+ ## Contributing
70
56
 
71
- All pull requests must be merged using rebase merges. This ensures that commit
72
- messages from the feature branch are preserved in the release branch, keeping the
73
- history clean and meaningful.
57
+ See [the contributing guildlines](CONTRIBUTING.md) for guidance on how to contriute
58
+ to this project.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module NestedObjects
4
4
  # The last released gem version
5
- VERSION = '0.1.16'
5
+ VERSION = '0.1.17'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nested_objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Couball
@@ -218,8 +218,8 @@ metadata:
218
218
  allowed_push_host: https://rubygems.org
219
219
  homepage_uri: https://github.com/main-branch/nested_objects
220
220
  source_code_uri: https://github.com/main-branch/nested_objects
221
- documentation_uri: https://rubydoc.info/gems/nested_objects/0.1.16
222
- changelog_uri: https://rubydoc.info/gems/nested_objects/0.1.16/file/CHANGELOG.md
221
+ documentation_uri: https://gemdocs.org/nested_objects/0.1.17
222
+ changelog_uri: https://gemdocs.org/nested_objects/0.1.17/file.CHANGELOG.md
223
223
  rubygems_mfa_required: 'true'
224
224
  rdoc_options: []
225
225
  require_paths: