pretty_json 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -3
- data/lib/pretty_json/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d050defe1a2cc82470d3c105d2435d5919e218f2
|
4
|
+
data.tar.gz: dc05a71b9e9dafef9ee43e5340574c1d18c77ef3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1282759c206e00d2e40fc076531b10485ee5e39ec272850dc77047990def473747dc554a544e0e1a76ec777098908d10afd5a12c277a9a439f516e0a2d2acd3f
|
7
|
+
data.tar.gz: 5e1eaf19808ae3e2a0dea97803aa2e7297a1952d7d76ec6bb58024f88047cba1f55265fd43823f11bd56dc4debf27bf5afcc5ab99484e37165f25abe5f8ef541
|
data/README.md
CHANGED
@@ -40,21 +40,29 @@ json.to_file('/tmp/example.json') #=> writes pretty JSON to /tmp.example.json
|
|
40
40
|
### On the command line
|
41
41
|
|
42
42
|
If you only need quick formatting for some JSON, there are three possibilities to do so using the command line tool:
|
43
|
-
|
43
|
+
|
44
|
+
1. save your JSON in a file and pass the file name to the command line tool
|
45
|
+
|
44
46
|
```shell
|
45
47
|
pretty_json example.json
|
46
48
|
```
|
47
|
-
|
49
|
+
|
50
|
+
2. pass the JSON as a single line to the command line tool:
|
51
|
+
|
48
52
|
```shell
|
49
53
|
pretty_json '{"key": "value", "array":[1,2,3]}'
|
50
54
|
```
|
55
|
+
|
51
56
|
Beware the single quotes around the JSON string. If they are omitted, the shell interpreter will split the string as it thinks correct, which will result in invalid JSON in most cases
|
52
|
-
|
57
|
+
|
58
|
+
3. you may pass multiline via STDIN using the `-` option
|
59
|
+
|
53
60
|
```shell
|
54
61
|
pretty_json - > /tmp/example.json
|
55
62
|
{"key": "value",
|
56
63
|
"array":[1,2,3]}
|
57
64
|
```
|
65
|
+
|
58
66
|
Here, the single quotes may be omitted. The example also shows how to write the result into a file (`/tmp/example.json`)instead of being printed to STDOUT.
|
59
67
|
|
60
68
|
|
@@ -67,3 +75,10 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Dervol
|
|
67
75
|
|
68
76
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
69
77
|
|
78
|
+
|
79
|
+
## Latest Changes
|
80
|
+
|
81
|
+
### 1.0.1
|
82
|
+
|
83
|
+
- Improved README markdown
|
84
|
+
|
data/lib/pretty_json/version.rb
CHANGED