Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tenderlove/hana
An implementation of JSON Patch and JSON Pointer for Ruby
https://github.com/tenderlove/hana
json json-patch json-pointer ruby
Last synced: 16 days ago
JSON representation
An implementation of JSON Patch and JSON Pointer for Ruby
- Host: GitHub
- URL: https://github.com/tenderlove/hana
- Owner: tenderlove
- License: mit
- Created: 2012-09-05T23:22:16.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2023-11-14T15:37:58.000Z (12 months ago)
- Last Synced: 2024-05-15T13:56:15.834Z (6 months ago)
- Topics: json, json-patch, json-pointer, ruby
- Language: Ruby
- Homepage:
- Size: 61.5 KB
- Stars: 215
- Watchers: 12
- Forks: 28
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - tenderlove/hana - An implementation of JSON Patch and JSON Pointer for Ruby (json)
README
# hana
* http://github.com/tenderlove/hana
## DESCRIPTION:
Implementation of [JSON Patch][1] and [JSON Pointer][2] RFC.
## FEATURES/PROBLEMS:
Implements specs of the [JSON Patch][1] and [JSON pointer][2] RFCs:
This works against Ruby objects, so you should load the JSON to Ruby,
process it, then emit as JSON again.## SYNOPSIS:
```ruby
patch = Hana::Patch.new [
{ 'op' => 'add', 'path' => '/baz', 'value' => 'qux' }
]patch.apply('foo' => 'bar') # => {'baz' => 'qux', 'foo' => 'bar'}
```## REQUIREMENTS:
* Ruby
## INSTALL:
$ gem install hana
## DEVELOPMENT:
hana runs tests from [json-patch/json-patch-tests](https://github.com/json-patch/json-patch-tests). Fetch the git submodule by running:
```bash
git submodule init
git submodule update
```Install dependencies with:
```bash
bundle install
```Then run the tests with:
```bash
rake test
```[1]: https://datatracker.ietf.org/doc/rfc6902/
[2]: http://tools.ietf.org/html/rfc6901