neatjson 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neatjson.rb +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cff24839e89c229c76121fba1b7b80235277791c
|
4
|
+
data.tar.gz: 0dbae08ff8ed14287f153878482c5467268c5811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c78d5c02fcf286910cf257d1ed7ab671f8e0384856d01adcc37f1dbd6fb812aa539bdeba4635df25c64e5e7c1398f7b52818c6817e59ad39e6005746f7d5303
|
7
|
+
data.tar.gz: e49c4a654e4ac0f2de3418b4163b3fe4dcce7acb0482fa823b2f10f3520a4f14440060b80e26c7c3e43cfb08c953edfa694b7e462d7a396d49b15c228ea81b0a
|
data/lib/neatjson.rb
CHANGED
@@ -40,6 +40,7 @@ module JSON
|
|
40
40
|
colon = "#{' '*opts[:before_colon]}:#{' '*opts[:after_colon]}"
|
41
41
|
|
42
42
|
build = ->(o,indent) do
|
43
|
+
puts "OH! #{indent.inspect}" if indent=~/\S/
|
43
44
|
case o
|
44
45
|
when String then "#{indent}#{o.inspect}"
|
45
46
|
when Symbol then "#{indent}#{o.to_s.inspect}"
|
@@ -59,7 +60,7 @@ module JSON
|
|
59
60
|
one_line
|
60
61
|
elsif opts[:short]
|
61
62
|
pieces = o.map{ |v| build[ v,"#{indent} #{apad}" ] }
|
62
|
-
pieces[0]
|
63
|
+
pieces[0].sub! /^#{indent} #{apad}/, "#{indent}[#{apad}"
|
63
64
|
pieces.last << apad << "]"
|
64
65
|
pieces.join ",\n"
|
65
66
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neatjson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Kistner
|
@@ -18,7 +18,8 @@ extra_rdoc_files: []
|
|
18
18
|
files:
|
19
19
|
- lib/neatjson.rb
|
20
20
|
homepage: http://github.com/Phrogz/NeatJSON
|
21
|
-
licenses:
|
21
|
+
licenses:
|
22
|
+
- MIT license (MIT)
|
22
23
|
metadata: {}
|
23
24
|
post_install_message:
|
24
25
|
rdoc_options: []
|
@@ -39,6 +40,6 @@ rubyforge_project:
|
|
39
40
|
rubygems_version: 2.4.5
|
40
41
|
signing_key:
|
41
42
|
specification_version: 4
|
42
|
-
summary: Pretty, powerful JSON generation.
|
43
|
+
summary: Pretty, powerful, flexible JSON generation.
|
43
44
|
test_files: []
|
44
45
|
has_rdoc: yard
|