Dr. JSON
Closes abruptly cut-off JSON strings. (Say, when you want to parse JSON formatted logs that were truncated by syslog.)
Installation
Install the gem:
$ gem install drjson
Or add this line to your application's Gemfile:
gem 'drjson'
And then execute:
$ bundle
Usage
You can hand over your poor JSON over command line
$ echo '{"foo":nul' | drjson
{"foo":null}
$ echo -n '[7, [42' | drjson
[7, [42]]
or via file
$ echo -n '{"foo": {"bar"' > my_file.json
$ drjson my_file.json
{"foo": {"bar":null}}
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 new Pull Request