Project

ricojson

0.0
No commit activity in last 3 years
No release in over 3 years
Uses Ruby's JSON to parse and format json files, includes an option to open them in the system's default application.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
 Project Readme

Rico JSON

Code Climate Gem Version Build Status

Description

A gem to open ugly one-line-not-indented JSON files in a way that you can read them.

By default it the JSON (prettified with Ruby's JSON library) to your standard output. You can also pass the -o parameter for it to open the JSON file in your system's default application or text editor for files with the .json extension.

It works only on GNU/Linux and Mac OS X (theoretically).

Install

$ gem install ricojson

Usage

Flags:

  -f file       Read JSON from specified file.
  -o            Opens the resulting formatted JSON in your default
                text editor.
  -h            Prints help message.

Examples

You can just display a JSON file with it:

$ ricojson -f my-terrible-not-indented-json-file.json

Or pipe a file's content:

$ cat other-terrible-not-indented-file.json | ricojson

And display an API's JSON return value directly from your command line:

$ curl https://mnav.heroku.com/artworks/62 | ricojson

And if you want to see this in your default app/text editor use the -o parameter:

$ ricojson -o -f my-terrible-not-indented-json-file.json

Acknowledgements

Thanks @dcadenas for pairing with me and helping me improve the code and functionality. Thanks @poteland for improving the command line options with clap.

Jason picture by Robert Ball - https://secure.flickr.com/photos/robertball/5588712222/ CC License

LICENSE

Copyright © 2014 - Fernando Briano

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.