json-merge-patch
Version, currently 0.1.02 versions
- 0.1.1latestJun 11, 2022
- 0.1.0not indexedJun 15, 2022
github.com/caspiano/json-merge-patch
Implementation of JSON Merge Patch RFC7396
1 stars
2 dependents
License: MIT
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
json-merge-patch:
github: caspiano/json-merge-patch
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
JSON Merge Patch
Implementation of JSON Merge Patch RFC7396
Installation
- Add the dependency to your
shard.yml:
dependencies:
json-merge-patch:
github: caspiano/json-merge-patch
- Run
shards install
Usage
Via Module
require "json-merge-patch"
a = JSON.parse %({"hi": 1, "bye": 1})
b = JSON.parse %({"hi": 2, "bye": 2})
# use the module scope
puts JSON::Any::MergePatch.merge(a, b).to_json # => {"hi": 2, "bye": 2}
puts JSON::Any::MergePatch.merge(b, a).to_json # => {"hi": 1, "bye": 1}
# or...
puts JSON::RFC7396.merge(a, b).to_json # => {"hi": 2, "bye": 2}
puts JSON::RFC7396.merge(b, a).to_json # => {"hi": 1, "bye": 1}
Via require "json-merge-patch/ext"
require "json-merge-patch/ext"
a = JSON.parse %({"hi": 1, "bye": 1})
b = JSON.parse %({"hi": 2, "bye": 2})
# The module methods are included in addition to instance methods on `JSON::Any`
puts a.merge(b) # => {"hi": 2, "bye": 2}
puts b.merge(a) # => {"hi": 1, "bye": 1}
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Caspian Baska - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Jun 15, 2022
- Commit
d063067d1edc- Indexed
- not yet
Dependents
Repository
github.com/caspiano/json-merge-patch
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 29, 2026
- Synced
- Sep 29, 2026
- Versions
- 2