json_builder 3.1.4 → 3.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +2 -4
- data/lib/json_builder/extensions.rb +1 -1
- data/lib/json_builder/version.rb +1 -1
- data/test/member_test.rb +4 -0
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -10,10 +10,9 @@ require 'json_builder'
|
|
10
10
|
json = JSONBuilder::Compiler.generate do
|
11
11
|
name 'Garrett Bjerkhoel'
|
12
12
|
email 'spam@garrettbjerkhoel.com'
|
13
|
-
url
|
13
|
+
url user_url(user)
|
14
14
|
address do
|
15
15
|
street '1234 1st Ave'
|
16
|
-
street2 'Apt 1'
|
17
16
|
city 'New York'
|
18
17
|
state 'NY'
|
19
18
|
zip 10065
|
@@ -36,10 +35,9 @@ Which will generate:
|
|
36
35
|
{
|
37
36
|
"name": "Garrett Bjerkhoel",
|
38
37
|
"email": "spam@garrettbjerkhoel.com",
|
39
|
-
"url": "/",
|
38
|
+
"url": "http://examplesite.com/dewski",
|
40
39
|
"address": {
|
41
40
|
"street": "1234 1st Ave",
|
42
|
-
"street2": "Apt 1",
|
43
41
|
"city": "New York",
|
44
42
|
"state": "NY",
|
45
43
|
"zip": 10065
|
data/lib/json_builder/version.rb
CHANGED
data/test/member_test.rb
CHANGED
@@ -43,6 +43,10 @@ class TestMember < Test::Unit::TestCase
|
|
43
43
|
assert_equal '"hello": "\"Hello\" he said"', member('hello', '"Hello" he said').to_s
|
44
44
|
end
|
45
45
|
|
46
|
+
def test_single_quoted_value
|
47
|
+
assert_equal %Q("hello": "hello 'test'!"), member('hello', "hello 'test'!").to_s
|
48
|
+
end
|
49
|
+
|
46
50
|
def test_without_key
|
47
51
|
assert_raises(JSONBuilder::MissingKeyError) { member(nil, true).to_s }
|
48
52
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: json_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.1.
|
5
|
+
version: 3.1.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Garrett Bjerkhoel
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-07-
|
13
|
+
date: 2012-07-04 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -80,7 +80,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
hash: -
|
83
|
+
hash: -85403141558173154
|
84
84
|
segments:
|
85
85
|
- 0
|
86
86
|
version: "0"
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
requirements:
|
90
90
|
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
hash: -
|
92
|
+
hash: -85403141558173154
|
93
93
|
segments:
|
94
94
|
- 0
|
95
95
|
version: "0"
|