tidy_json 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +36 -40
- data/lib/tidy_json/dedication.rb +4 -3
- data/lib/tidy_json/version.rb +1 -1
- data/lib/tidy_json.rb +89 -59
- data/test/test_tidy_json.rb +23 -4
- data/tidy_json.gemspec +1 -2
- metadata +8 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfdad155c72b5ef6d411fbdd2dae876a4d7951e97f2f59f0817d09be0d1b1f8a
|
4
|
+
data.tar.gz: 40fbd785790e3dc649c1ab8ac16696b359f832cc43da577e71fe9b55a5467212
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a62c5325d5ec264c61321518e26997170f5a1b34210d6c93052dfa2ab7aedce355ef0f9f9688dc4a18cd4113fafb121b314528374ba509b7e47f7a1f0f4afb7f
|
7
|
+
data.tar.gz: 2351e73fd6c2c6e8da966b02cec5da2eeaff8ca77a090c5ac5e7aff96122e27f12ac8c770b1b89ce943e6300e21325b099442750137ca54183fee568b8db048b
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# TidyJson
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Build Status][travis_build_status_badge]][travis_build_status] [![cci_build_status_badge]][cci_build_status] ![Gem Version][gem_version_badge]
|
4
4
|
|
5
5
|
A mixin providing (recursive) JSON serialization and pretty printing.
|
6
6
|
|
@@ -24,7 +24,7 @@ gem 'tidy_json'
|
|
24
24
|
```ruby
|
25
25
|
require 'tidy_json'
|
26
26
|
|
27
|
-
class
|
27
|
+
class JsonableObject
|
28
28
|
attr_reader :a, :b
|
29
29
|
def initialize
|
30
30
|
@a = { a: 'uno', b: 'dos', c: ['I', 'II', 'III', ['i.', 'ii.', 'iii.', { 'ichi': "\u{4e00}", 'ni': "\u{4e8c}", 'san': "\u{4e09}", 'yon': "\u{56db}" }]] }
|
@@ -32,45 +32,42 @@ class Jsonable
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
my_jsonable = JsonableObject.new
|
36
|
+
|
37
|
+
JSON.parse my_jsonable.stringify
|
37
38
|
# => {"class"=>"Jsonable", "a"=>{"a"=>"uno", "b"=>"dos", "c"=>["I", "II", "III", ["i.", "ii.", "iii.", {"ichi"=>"一", "ni"=>"二", "san"=>"三", "yon"=>"四"}]]}, "b"=>{"a"=>1, "b"=>["two", 3, "<abbr title=\"four\">IV</abbr>"]}}
|
38
39
|
|
39
|
-
puts
|
40
|
+
puts my_jsonable.to_tidy_json(indent: 8)
|
40
41
|
# {
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
# 3,
|
71
|
-
# "<abbr title=\"four\">IV</abbr>"
|
72
|
-
# ]
|
73
|
-
# }
|
42
|
+
# "class": "JsonableObject",
|
43
|
+
# "a": {
|
44
|
+
# "a": "uno",
|
45
|
+
# "b": "dos",
|
46
|
+
# "c": [
|
47
|
+
# "I",
|
48
|
+
# "II",
|
49
|
+
# "III",
|
50
|
+
# [
|
51
|
+
# "i.",
|
52
|
+
# "ii.",
|
53
|
+
# "iii.",
|
54
|
+
# {
|
55
|
+
# "ichi": "一",
|
56
|
+
# "ni": "二",
|
57
|
+
# "san": "三",
|
58
|
+
# "yon": "四"
|
59
|
+
# }
|
60
|
+
# ]
|
61
|
+
# ]
|
62
|
+
# },
|
63
|
+
# "b": {
|
64
|
+
# "a": 1,
|
65
|
+
# "b": [
|
66
|
+
# "two",
|
67
|
+
# 3,
|
68
|
+
# "<abbr title=\"four\">IV</abbr>"
|
69
|
+
# ]
|
70
|
+
# }
|
74
71
|
# }
|
75
72
|
# => nil
|
76
73
|
```
|
@@ -81,7 +78,6 @@ puts complex_object.to_tidy_json
|
|
81
78
|
- [json](https://rubygems.org/gems/json) ~> 2.2
|
82
79
|
|
83
80
|
#### Building
|
84
|
-
- [bundler](https://rubygems.org/gems/bundler) ~> 1.17
|
85
81
|
- [minitest](https://rubygems.org/gems/minitest) ~> 5.0
|
86
82
|
- [yard](https://rubygems.org/gems/yard) ~> 0.9
|
87
83
|
|
@@ -91,6 +87,6 @@ puts complex_object.to_tidy_json
|
|
91
87
|
|
92
88
|
[travis_build_status]: https://travis-ci.com/rdipardo/tidy_json
|
93
89
|
[cci_build_status]: https://circleci.com/gh/rdipardo/tidy_json
|
94
|
-
[travis_build_status_badge]: https://travis-ci.com/rdipardo/tidy_json.svg
|
95
90
|
[cci_build_status_badge]: https://circleci.com/gh/rdipardo/tidy_json.svg?style=svg
|
91
|
+
[travis_build_status_badge]: https://travis-ci.com/rdipardo/tidy_json.svg
|
96
92
|
[gem_version_badge]: https://img.shields.io/gem/v/tidy_json
|
data/lib/tidy_json/dedication.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
module TidyJson # :nodoc:
|
2
|
-
DEDICATION = "#{'.' * 50}\n#{'.' * 19} IN MEMORIAM #{'.' * 18}\n" \
|
2
|
+
DEDICATION = "\n#{'.' * 50}\n#{'.' * 19} IN MEMORIAM #{'.' * 18}\n" \
|
3
3
|
"#{'.' * 16} Michael Di Pardo #{'.' * 16}\n" \
|
4
|
-
"#{'.' *
|
4
|
+
"#{'.' * 11} Feb 4, 1950 - Oct 28, 2019 #{'.' * 11}\n" \
|
5
|
+
"#{'.' * 50}\n" \
|
5
6
|
"#{'.' * 11} Please consider supporting #{'.' * 11}\n" \
|
6
7
|
"#{'.' * 13} the MS Society of Canada #{'.' * 11}\n" \
|
7
8
|
"#{'.' * 8} https://mssociety.ca/get-involved #{'.' * 7}\n" \
|
8
|
-
"#{'.' * 50}\n"
|
9
|
+
"#{'.' * 50}\n\n".freeze
|
9
10
|
end
|
data/lib/tidy_json/version.rb
CHANGED
data/lib/tidy_json.rb
CHANGED
@@ -9,16 +9,19 @@ module TidyJson
|
|
9
9
|
# Emits a pretty-printed JSON representation of the given +obj+.
|
10
10
|
#
|
11
11
|
# @param obj [Object] A Ruby object that can be parsed as JSON.
|
12
|
+
# @param opts [Hash] Formatting options.
|
13
|
+
# [:indent] the number of white spaces to indent
|
12
14
|
# @return [String] A pretty-printed JSON string.
|
13
|
-
def self.tidy(obj = {})
|
15
|
+
def self.tidy(obj = {}, opts = {})
|
16
|
+
formatter = Formatter.new(opts)
|
14
17
|
str = ''
|
15
18
|
|
16
19
|
if obj.instance_of?(Hash)
|
17
20
|
str << "{\n"
|
18
21
|
|
19
22
|
obj.each do |k, v|
|
20
|
-
str << "\"#{k}\": "
|
21
|
-
str <<
|
23
|
+
str << formatter.indent << "\"#{k}\": "
|
24
|
+
str << formatter.format_node(v, obj)
|
22
25
|
end
|
23
26
|
|
24
27
|
str << "}\n"
|
@@ -27,7 +30,8 @@ module TidyJson
|
|
27
30
|
str << "[\n"
|
28
31
|
|
29
32
|
obj.each do |v|
|
30
|
-
str <<
|
33
|
+
str << formatter.indent
|
34
|
+
str << formatter.format_node(v, obj)
|
31
35
|
end
|
32
36
|
|
33
37
|
str << "]\n"
|
@@ -37,19 +41,16 @@ module TidyJson
|
|
37
41
|
end
|
38
42
|
|
39
43
|
##
|
40
|
-
# Like +TidyJson::tidy+, but callable by the sender object
|
44
|
+
# Like +TidyJson::tidy+, but callable by the sender object.
|
41
45
|
#
|
42
|
-
# @param
|
46
|
+
# @param opts [Hash] Formatting options.
|
47
|
+
# [:indent] the number of white spaces to indent
|
43
48
|
# @return [String] A pretty-printed JSON string.
|
44
|
-
def to_tidy_json(
|
49
|
+
def to_tidy_json(opts = {})
|
45
50
|
if !instance_variables.empty?
|
46
|
-
|
47
|
-
else stringify
|
48
|
-
end
|
51
|
+
TidyJson.tidy(JSON.parse(stringify), opts)
|
49
52
|
else
|
50
|
-
|
51
|
-
else to_json
|
52
|
-
end
|
53
|
+
TidyJson.tidy(self, opts)
|
53
54
|
end
|
54
55
|
end
|
55
56
|
|
@@ -70,16 +71,18 @@ module TidyJson
|
|
70
71
|
end
|
71
72
|
|
72
73
|
##
|
73
|
-
# Writes a
|
74
|
+
# Writes a JSON representation of the sender object to the file specified by +out+.
|
74
75
|
#
|
75
|
-
# @param
|
76
|
-
# @param
|
76
|
+
# @param out [String] The destination filename.
|
77
|
+
# @param opts [Hash] Formatting options for this object's +#to_tidy_json+ method.
|
78
|
+
# [:tidy] whether or not the output should be pretty-printed
|
79
|
+
# [:indent] the number of white spaces to indent
|
77
80
|
# @return [String, nil] The path to the written output file, if successful.
|
78
|
-
def write_json(
|
81
|
+
def write_json(out = "#{self.class.name}_#{Time.now.to_i}", opts = { tidy: false })
|
79
82
|
path = nil
|
80
83
|
|
81
84
|
File.open("#{out}.json", 'w') do |f|
|
82
|
-
path = f << to_tidy_json(
|
85
|
+
path = f << to_tidy_json(opts)
|
83
86
|
end
|
84
87
|
|
85
88
|
path.path
|
@@ -92,15 +95,6 @@ module TidyJson
|
|
92
95
|
#
|
93
96
|
# @api private
|
94
97
|
class Serializer
|
95
|
-
##
|
96
|
-
# The number of times to reduce the left margin of a nested array's opening
|
97
|
-
# bracket
|
98
|
-
@margins_to_backspace = 0
|
99
|
-
|
100
|
-
##
|
101
|
-
# True if printing a nested array
|
102
|
-
@should_backspace = false
|
103
|
-
|
104
98
|
##
|
105
99
|
# Searches +obj+ to a *maximum* depth of 2 for readable attributes,
|
106
100
|
# storing them as key-value pairs in +json_hash+.
|
@@ -210,7 +204,7 @@ module TidyJson
|
|
210
204
|
json_hash[key] << val
|
211
205
|
end
|
212
206
|
|
213
|
-
# process uncollected
|
207
|
+
# process uncollected class members
|
214
208
|
else
|
215
209
|
# member a class object
|
216
210
|
if val.instance_variables.first
|
@@ -238,6 +232,37 @@ module TidyJson
|
|
238
232
|
json_hash
|
239
233
|
end
|
240
234
|
# ~Serializer.serialize
|
235
|
+
end
|
236
|
+
# ~Serializer
|
237
|
+
|
238
|
+
##
|
239
|
+
# A purpose-built JSON formatter.
|
240
|
+
#
|
241
|
+
# @api private
|
242
|
+
class Formatter
|
243
|
+
attr_reader :indent
|
244
|
+
|
245
|
+
# @!attribute indent
|
246
|
+
# @return [String] the string of white space used by this +Formatter+ to indent object members.
|
247
|
+
|
248
|
+
def initialize(format_options = {})
|
249
|
+
##
|
250
|
+
# The number of times to reduce the left indent of a nested array's opening
|
251
|
+
# bracket
|
252
|
+
@left_bracket_offset = 0
|
253
|
+
|
254
|
+
##
|
255
|
+
# True if printing a nested array
|
256
|
+
@need_offset = false
|
257
|
+
|
258
|
+
indent_width = format_options[:indent]
|
259
|
+
|
260
|
+
# don't use the more explicit #integer? method because it's defined for
|
261
|
+
# floating point numbers also
|
262
|
+
good_width = indent_width.positive? if indent_width.respond_to? :times
|
263
|
+
|
264
|
+
@indent = "\s" * (good_width ? indent_width : 2)
|
265
|
+
end
|
241
266
|
|
242
267
|
##
|
243
268
|
# Returns the given +node+ as pretty-printed JSON.
|
@@ -245,70 +270,71 @@ module TidyJson
|
|
245
270
|
# @param node [#to_s] A visible attribute of +obj+.
|
246
271
|
# @param obj [{Object => Object}, <Object>] The enumerable object containing +node+.
|
247
272
|
# @return [String] A formatted string representation of +node+.
|
248
|
-
def
|
273
|
+
def format_node(node, obj)
|
249
274
|
str = ''
|
275
|
+
indent = @indent
|
250
276
|
|
251
277
|
if node.instance_of?(Array)
|
252
|
-
str << "
|
278
|
+
str << "[\n"
|
253
279
|
|
254
280
|
node.each do |elem|
|
255
281
|
if elem.instance_of?(Hash)
|
256
|
-
str << "
|
282
|
+
str << "#{(indent * 2)}{\n"
|
257
283
|
|
258
284
|
elem.each_with_index do |inner_h, h_idx|
|
259
|
-
str << "\
|
260
|
-
str << node_to_str(inner_h.last)
|
285
|
+
str << "#{(indent * 3)}\"#{inner_h.first}\": "
|
286
|
+
str << node_to_str(inner_h.last, 4)
|
261
287
|
str << ', ' unless h_idx == (elem.to_a.length - 1)
|
262
288
|
str << "\n"
|
263
289
|
end
|
264
290
|
|
265
|
-
str << "
|
291
|
+
str << "#{(indent * 2)}}"
|
266
292
|
str << ',' unless node.index(elem) == (node.length - 1)
|
267
293
|
str << "\n" unless node.index(elem) == (node.length - 1)
|
268
294
|
|
269
295
|
else
|
270
296
|
|
271
297
|
if elem.instance_of?(Array) && elem.any? { |e| e.instance_of?(Array) }
|
272
|
-
@
|
298
|
+
@left_bracket_offset = elem.take_while { |e| e.instance_of?(Array) }.size
|
273
299
|
end
|
274
300
|
|
275
|
-
str <<
|
301
|
+
str << (indent * 2)
|
276
302
|
str << node_to_str(elem)
|
277
303
|
str << ",\n" unless node.index(elem) == (node.length - 1)
|
278
304
|
end
|
279
305
|
end
|
280
306
|
|
281
|
-
str << "\n
|
307
|
+
str << "\n#{indent}]\n"
|
282
308
|
|
283
309
|
elsif node.instance_of?(Hash)
|
284
|
-
str << "
|
310
|
+
str << "{\n"
|
285
311
|
|
286
312
|
node.each_with_index do |h, idx|
|
287
313
|
if h.last.instance_of?(Hash)
|
288
314
|
key = if h.first.eql? ''
|
289
|
-
"\
|
315
|
+
"#{indent * 2}\"<##{h.last.class.name.downcase}>\": "
|
290
316
|
else
|
291
|
-
"\
|
317
|
+
"#{indent * 2}\"#{h.first}\": "
|
292
318
|
end
|
293
319
|
str << key
|
294
|
-
str << "
|
320
|
+
str << "{\n"
|
295
321
|
|
296
322
|
h.last.each_with_index do |inner_h, inner_h_idx|
|
297
|
-
str << "\
|
323
|
+
str << "#{indent * 3}\"#{inner_h.first}\": "
|
298
324
|
str << node_to_str(inner_h.last, 4)
|
299
325
|
str << ",\n" unless inner_h_idx == (h.last.to_a.length - 1)
|
300
326
|
end
|
301
327
|
|
302
|
-
str << "\n
|
328
|
+
str << "\n#{indent * 2}}"
|
303
329
|
else
|
304
|
-
str << "\
|
330
|
+
str << "#{indent * 2}\"#{h.first}\": "
|
305
331
|
str << node_to_str(h.last)
|
306
332
|
end
|
307
333
|
|
308
334
|
str << ",\n" unless idx == (node.to_a.length - 1)
|
309
335
|
end
|
310
336
|
|
311
|
-
str << "\n
|
337
|
+
str << "\n#{indent}}"
|
312
338
|
str << ', ' unless (obj.length <= 1) || \
|
313
339
|
((obj.length > 1) && \
|
314
340
|
(obj.instance_of?(Hash) && \
|
@@ -326,50 +352,54 @@ module TidyJson
|
|
326
352
|
str << "\n"
|
327
353
|
end
|
328
354
|
|
329
|
-
str.gsub(
|
355
|
+
str.gsub(/(#{indent})+[\n\r]+/, '').gsub(/\}\,+/, '},').gsub(/\]\,+/, '],')
|
330
356
|
end
|
331
|
-
# ~
|
357
|
+
# ~Formatter#format_node
|
332
358
|
|
333
359
|
##
|
334
360
|
# Returns a JSON-appropriate string representation of +node+.
|
335
361
|
#
|
336
362
|
# @param node [#to_s] A visible attribute of a Ruby object.
|
337
|
-
# @param tabs [
|
363
|
+
# @param tabs [Integer] Tab width at which to start printing this node.
|
338
364
|
# @return [String] A formatted string representation of +node+.
|
339
|
-
def
|
365
|
+
def node_to_str(node, tabs = 0)
|
340
366
|
graft = ''
|
341
|
-
|
342
367
|
tabs += 2 if tabs.zero?
|
343
|
-
|
368
|
+
|
369
|
+
if @need_offset
|
344
370
|
tabs -= 1
|
345
|
-
@
|
371
|
+
@left_bracket_offset -= 1
|
346
372
|
end
|
347
373
|
|
374
|
+
indent = @indent * (tabs / 2)
|
375
|
+
|
348
376
|
if node.nil? then graft << 'null'
|
349
|
-
elsif node.instance_of?(Hash)
|
350
377
|
|
378
|
+
elsif node.instance_of?(Hash)
|
351
379
|
format_node(node, node).scan(/.*$/) do |n|
|
352
|
-
graft << "\n" <<
|
380
|
+
graft << "\n" << indent << n
|
353
381
|
end
|
354
382
|
|
355
383
|
elsif node.instance_of?(Array)
|
356
|
-
@
|
384
|
+
@need_offset = @left_bracket_offset.positive?
|
357
385
|
|
358
386
|
format_node(node, {}).scan(/.*$/) do |n|
|
359
|
-
graft << "\n" <<
|
387
|
+
graft << "\n" << indent << n
|
360
388
|
end
|
361
389
|
|
362
390
|
elsif !node.instance_of?(String) then graft << node.to_s
|
391
|
+
|
363
392
|
else graft << "\"#{node.gsub(/\"/, '\\"')}\""
|
364
393
|
end
|
365
394
|
|
366
|
-
graft.
|
395
|
+
graft.strip
|
367
396
|
end
|
368
|
-
# ~
|
397
|
+
# ~Formatter.node_to_str
|
369
398
|
end
|
370
|
-
# ~
|
399
|
+
# ~Formatter
|
371
400
|
|
372
401
|
private_constant :Serializer
|
402
|
+
private_constant :Formatter
|
373
403
|
end
|
374
404
|
# ~TidyJson
|
375
405
|
|
data/test/test_tidy_json.rb
CHANGED
@@ -27,13 +27,15 @@ class TidyJsonTest < Minitest::Test
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_tidy_static
|
30
|
-
assert_equal(TidyJson.tidy(a: 'one', A: 'ONE', b: nil), "{\n\"a\": \"one\", \n\"A\": \"ONE\", \n\"b\": null\n}\n")
|
30
|
+
assert_equal(TidyJson.tidy(a: 'one', A: 'ONE', b: nil), "{\n \"a\": \"one\", \n \"A\": \"ONE\", \n \"b\": null\n}\n")
|
31
31
|
assert_equal(TidyJson.tidy({}).length, 4)
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_tidy_instance
|
35
35
|
assert_equal({}.to_tidy_json, "{\n}\n")
|
36
|
-
assert_equal(
|
36
|
+
assert_equal([].to_tidy_json, "[\n]\n")
|
37
|
+
assert_equal(Object.new.to_tidy_json, '')
|
38
|
+
assert_equal(JsonableObject.new.to_tidy_json.length, 650)
|
37
39
|
end
|
38
40
|
|
39
41
|
def test_stringify_instance
|
@@ -41,9 +43,26 @@ class TidyJsonTest < Minitest::Test
|
|
41
43
|
end
|
42
44
|
|
43
45
|
def test_writers
|
44
|
-
output = @@t.write_json
|
46
|
+
output = @@t.write_json
|
45
47
|
assert(File.exist?(output))
|
46
|
-
pretty_output = @@t.write_json(true,
|
48
|
+
pretty_output = @@t.write_json('prettified', tidy: true, indent: 4)
|
47
49
|
assert(File.exist?(pretty_output))
|
48
50
|
end
|
51
|
+
|
52
|
+
def test_indent_bounds_checking
|
53
|
+
assert_equal(Object.new.to_tidy_json(indent: '8'), '')
|
54
|
+
assert_equal('Object'.to_tidy_json(indent: []), '')
|
55
|
+
assert_equal(0.to_tidy_json(indent: -89), '')
|
56
|
+
assert_equal(3.1425.to_tidy_json(indent: 3.1425), '')
|
57
|
+
assert_equal(''.to_tidy_json(indent: +0), '')
|
58
|
+
assert_equal([].to_tidy_json(indent: -8.00009), "[\n]\n")
|
59
|
+
assert_equal(JSON.parse(Object.new.stringify).to_tidy_json(indent: nil),
|
60
|
+
"{\n \"class\": \"Object\"\n}\n")
|
61
|
+
assert_equal(JSON.parse(''.stringify).to_tidy_json(indent: -16.009),
|
62
|
+
"{\n \"class\": \"String\"\n}\n")
|
63
|
+
assert_equal(JSON.parse({}.stringify).to_tidy_json(indent: '8'),
|
64
|
+
"{\n \"class\": \"Hash\"\n}\n")
|
65
|
+
assert_equal(JSON.parse(%w[k l m].stringify).to_tidy_json(indent: '<<'),
|
66
|
+
"{\n \"class\": \"Array\"\n}\n")
|
67
|
+
end
|
49
68
|
end
|
data/tidy_json.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ['Robert Di Pardo']
|
11
11
|
spec.email = 'rdipardo0520@conestogac.on.ca'
|
12
12
|
spec.homepage = 'https://github.com/rdipardo/tidy_json'
|
13
|
-
spec.metadata = {'documentation_uri' => 'https://rubydoc.org/github/rdipardo/tidy_json'}
|
13
|
+
spec.metadata = { 'documentation_uri' => 'https://rubydoc.org/github/rdipardo/tidy_json/master' }
|
14
14
|
spec.license = 'MIT'
|
15
15
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
16
16
|
['.yardopts'].concat(`git ls-files -z`.split("\x0").reject { |f| f.match(/^(\.[\w+\.]+|test|spec|features)/) })
|
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.3')
|
21
21
|
spec.add_runtime_dependency 'json', '~> 2.2'
|
22
|
-
spec.add_development_dependency 'bundler', '~> 1.17'
|
23
22
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
24
23
|
spec.add_development_dependency 'yard', '~> 0.9'
|
25
24
|
spec.rdoc_options = ['-x test/*']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tidy_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Di Pardo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.2'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.17'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.17'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: minitest
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,17 +72,19 @@ homepage: https://github.com/rdipardo/tidy_json
|
|
86
72
|
licenses:
|
87
73
|
- MIT
|
88
74
|
metadata:
|
89
|
-
documentation_uri: https://rubydoc.org/github/rdipardo/tidy_json
|
90
|
-
post_install_message: |
|
75
|
+
documentation_uri: https://rubydoc.org/github/rdipardo/tidy_json/master
|
76
|
+
post_install_message: |2+
|
77
|
+
|
91
78
|
..................................................
|
92
79
|
................... IN MEMORIAM ..................
|
93
80
|
................ Michael Di Pardo ................
|
94
|
-
|
81
|
+
........... Feb 4, 1950 - Oct 28, 2019 ...........
|
95
82
|
..................................................
|
96
83
|
........... Please consider supporting ...........
|
97
84
|
............. the MS Society of Canada ...........
|
98
85
|
........ https://mssociety.ca/get-involved .......
|
99
86
|
..................................................
|
87
|
+
|
100
88
|
rdoc_options:
|
101
89
|
- "-x test/*"
|
102
90
|
require_paths:
|
@@ -112,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
100
|
- !ruby/object:Gem::Version
|
113
101
|
version: '0'
|
114
102
|
requirements: []
|
115
|
-
rubygems_version: 3.
|
103
|
+
rubygems_version: 3.0.6
|
116
104
|
signing_key:
|
117
105
|
specification_version: 4
|
118
106
|
summary: Serialize any Ruby object as readable JSON
|