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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- json_builder (3.1.4)
4
+ json_builder (3.1.5)
5
5
  activesupport (>= 2.0.0)
6
6
 
7
7
  GEM
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 root_path
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
@@ -20,7 +20,7 @@ class String
20
20
  "\n" => '\n',
21
21
  "\r" => '\n',
22
22
  '"' => '\\"',
23
- "'" => "\\'"
23
+ "'" => "\'"
24
24
  }
25
25
 
26
26
  def to_builder
@@ -1,3 +1,3 @@
1
1
  module JSONBuilder
2
- VERSION = '3.1.4'
2
+ VERSION = '3.1.5'
3
3
  end
@@ -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.4
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-01 00:00:00 Z
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: -2873359075764623678
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: -2873359075764623678
92
+ hash: -85403141558173154
93
93
  segments:
94
94
  - 0
95
95
  version: "0"