neatjson 0.10.1 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -9
- data/lib/neatjson.rb +0 -0
- data/neatjson.gemspec +1 -1
- data/test/large.json +401 -401
- data/test/test_neatjson.lua +83 -83
- data/test/test_neatjson.rb +0 -0
- data/test/tests.js +11 -10
- data/test/tests.lua +12 -0
- data/test/tests.rb +12 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e29bd247652e7a911282fd3556f0a19cdb3e1fca0f83b04892ae961e11394ea
|
4
|
+
data.tar.gz: c3b4105091a863dc151e49e7d4af197f247af17eb5bdfaf9cc42c584ba76114b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 372b882820a3ea8288c214e305254b54d1234798baa949c4a4b4f3a442d6043c488b14ff160d6323be8cc3ef12c89bac90bf8bcec2312bff40cf9e00ef9e04aa
|
7
|
+
data.tar.gz: cc97ed7a14dea8224747c405213fcefefdc3866aef0a6686d73fa9c9259bf87b3c0cc573786c9ad1fcdf4652a6a045cd7554c922854390d119d49b5b7dd5bcc4
|
data/README.md
CHANGED
@@ -5,10 +5,13 @@
|
|
5
5
|
|
6
6
|
Pretty-print your JSON in Ruby or JavaScript or Lua with more power than is provided by `JSON.pretty_generate` (Ruby) or `JSON.stringify` (JS). For example, like Ruby's `pp` (pretty print), NeatJSON can keep objects on one line if they fit, but break them over multiple lines if needed.
|
7
7
|
|
8
|
-
**Features
|
8
|
+
**Features:**
|
9
9
|
|
10
|
-
*
|
11
|
-
*
|
10
|
+
* [Online webpage](http://phrogz.net/JS/NeatJSON) for performing conversions and experimenting with options.
|
11
|
+
* _Modifying graphical options on the webpage also gives you the JS code you would need to call to get the same results._
|
12
|
+
* Keep multiple values on one line, with variable wrap width.
|
13
|
+
* Format numeric values to specified decimal precision.
|
14
|
+
* Optionally force specific keys to use floating point representation instead of bare integers for whole number values (e.g. `42.0` instead of `42`).
|
12
15
|
* Sort object keys to be in alphabetical order.
|
13
16
|
* Arbitrary whitespace (or really, any string) for indentation.
|
14
17
|
* "Short" wrapping uses fewer lines, indentation based on values. (See last example below.)
|
@@ -16,7 +19,6 @@ Pretty-print your JSON in Ruby or JavaScript or Lua with more power than is prov
|
|
16
19
|
* Adjust number of spaces inside array/object braces.
|
17
20
|
* Adjust number of spaces before/after commas and colons (both for single- vs. multi-line).
|
18
21
|
* Line up the values for an object across lines.
|
19
|
-
* [Online webpage](http://phrogz.net/JS/NeatJSON) for conversions and experimenting with options.
|
20
22
|
* [Lua only] Produce Lua table serialization.
|
21
23
|
|
22
24
|
|
@@ -27,7 +29,7 @@ Pretty-print your JSON in Ruby or JavaScript or Lua with more power than is prov
|
|
27
29
|
* [Examples](#examples)
|
28
30
|
* [Options](#options)
|
29
31
|
* [License & Contact](#license--contact)
|
30
|
-
* [TODO
|
32
|
+
* [TODO (aka Known Limitations)](#todo-aka-known-limitations)
|
31
33
|
* [History](#history)
|
32
34
|
|
33
35
|
|
@@ -176,17 +178,17 @@ You may pass any of the following options to `neat_generate` (Ruby) or `neatJSON
|
|
176
178
|
|
177
179
|
~~~ ruby
|
178
180
|
# Ruby
|
179
|
-
json = JSON.neat_generate my_value, array_padding:1, after_comma:1, before_colon_n:2
|
181
|
+
json = JSON.neat_generate my_value, array_padding:1, after_comma:1, before_colon_n:2
|
180
182
|
~~~
|
181
183
|
|
182
184
|
~~~ js
|
183
185
|
// JavaScript
|
184
|
-
var json = neatJSON( myValue, { arrayPadding:1, afterComma:1, beforeColonN:2
|
186
|
+
var json = neatJSON( myValue, { arrayPadding:1, afterComma:1, beforeColonN:2 } );
|
185
187
|
~~~
|
186
188
|
|
187
189
|
~~~ lua
|
188
190
|
-- Lua
|
189
|
-
local json = neatJSON( myValue, { arrayPadding=1, afterComma=1, beforeColonN=2
|
191
|
+
local json = neatJSON( myValue, { arrayPadding=1, afterComma=1, beforeColonN=2 } )
|
190
192
|
~~~
|
191
193
|
|
192
194
|
* `wrap` — Maximum line width before wrapping. Use `false` to never wrap, `true` to always wrap. default:`80`
|
@@ -276,7 +278,17 @@ For other communication you can [email the author directly](mailto:!@phrogz.net?
|
|
276
278
|
* Possibly allow "JSON5" output (legal identifiers unquoted, etc.)
|
277
279
|
|
278
280
|
|
279
|
-
##
|
281
|
+
## History
|
282
|
+
|
283
|
+
* **v0.10.4** — November 17, 2022
|
284
|
+
* Online tool shows input/output bytes
|
285
|
+
|
286
|
+
* **v0.10.2** — August 31, 2022
|
287
|
+
* Fix bugs found in JavaScript version related to `trim_trailing_zeros`.
|
288
|
+
|
289
|
+
* **v0.10.1** — August 29, 2022
|
290
|
+
* Fix bugs found when `force_floats_in` was combined with wrapping.
|
291
|
+
* Update interactive HTML tool to support new features.
|
280
292
|
|
281
293
|
* **v0.10** — August 29, 2022
|
282
294
|
* Add `force_floats` and `force_floats_in` to support serialization for non-standard parsers that differentiate between integers and floats.
|
data/lib/neatjson.rb
CHANGED
File without changes
|