/drjson

DrJson: Closes abruptly cut-off JSON strings.

Primary LanguageRubyMIT LicenseMIT

Dr. JSON

Closes abruptly cut-off JSON strings. (Say, when you want to parse JSON formatted logs that were truncated by syslog.)

Build Status Code Climate

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request