tolerate_json 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/xunker/tolerate_json.png?branch=master)](https://travis-ci.org/xunker/tolerate_json)
2
+
1
3
  # TolerateJson
2
4
 
3
5
  A JSON formatter written in pure Ruby that works "good enough" and has no gem dependencies. 60% of the time, it works every time.
@@ -1,3 +1,3 @@
1
1
  module TolerateJson
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/tolerate_json.rb CHANGED
@@ -10,6 +10,7 @@ module TolerateJson
10
10
 
11
11
  if json.match(/[^\n]\}$/)
12
12
  json.gsub!(/\}$/, "\n}")
13
+ json.gsub!(/\}\}/, "}\n}")
13
14
  end
14
15
 
15
16
  if json.match(/[^\n]\]$/)
@@ -45,6 +45,13 @@ describe TolerateJson do
45
45
  expect(t.pretty_print_json(unformatted)).to eq(formatted)
46
46
  end
47
47
 
48
+ it "should separate concurrant curly braces with a cr" do
49
+ unformatted = '{"qux":{"foo":{"bar":"baz"}}, "quux":"quuux"}'
50
+ formatted= "{\n \"qux\":{\n \"foo\":{\n \"bar\":\"baz\"\n }\n },\n \"quux\":\"quuux\"\n}\n"
51
+
52
+ expect(t.pretty_print_json(unformatted)).to eq(formatted)
53
+ end
54
+
48
55
  it "should include only one cr at the end of the result" do
49
56
  unformatted = "{}\n\n\n"
50
57
  formatted= "{\n}\n"
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["xunker@pyxidis.org"]
11
11
  spec.description = %q{A JSON formatter written in pure Ruby that works "good enough" and has no gem dependencies. 60% of the time, it works every time.}
12
12
  spec.summary = %q{Tolerate_json is a pure-ruby Json formatter that has no outside gem dependencies. It almost works right and is good enough so you can tolerate reading JSON from your screen (hence the name). It is designed to be a simple formatter for when you need a lightweight component, but it is not suitable for cases where proper formatting is mission-critical. Compatible with MRI 1.8.7, 1.9.3 and 2.0.0 as well as JRuby and Rubinius in those modes.}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/xunker/tolerate_json"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tolerate_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-31 00:00:00.000000000 Z
12
+ date: 2013-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -80,7 +80,7 @@ files:
80
80
  - spec/lib/tolerate_json_spec.rb
81
81
  - spec/spec_helper.rb
82
82
  - tolerate_json.gemspec
83
- homepage: ''
83
+ homepage: https://github.com/xunker/tolerate_json
84
84
  licenses:
85
85
  - MIT
86
86
  post_install_message: