multi_json 1.6.0 → 1.6.1

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.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,9 +1,14 @@
1
+ 1.6.1
2
+ -----
3
+ * [Revert "Use JSON.generate instead of #to_json"](https://github.com/intridea/multi_json/issues/86)
4
+
1
5
  1.6.0
2
6
  -----
3
7
  * [Add gson.rb support](https://github.com/intridea/multi_json/pull/71)
4
8
  * [Add MultiJson.default_options](https://github.com/intridea/multi_json/pull/70)
5
9
  * [Add MultiJson.with_adapter](https://github.com/intridea/multi_json/pull/67)
6
10
  * [Stringify all possible keys for ok_json](https://github.com/intridea/multi_json/pull/66)
11
+ * [Use JSON.generate instead of #to_json](https://github.com/intridea/multi_json/issues/73)
7
12
  * [Alias `MultiJson::DecodeError` to `MultiJson::LoadError`](https://github.com/intridea/multi_json/pull/79)
8
13
 
9
14
  1.5.1
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rake', '>= 0.9'
4
4
  gem 'yard', '>= 0.8'
data/README.md CHANGED
@@ -48,6 +48,7 @@ MultiJSON falls back to [OkJson][], a simple, vendorable JSON parser.
48
48
  * [JSON](https://github.com/flori/json) The default JSON gem with C-extensions (ships with Ruby 1.9)
49
49
  * [JSON Pure](https://github.com/flori/json) A Ruby variant of the JSON gem
50
50
  * [NSJSONSerialization](https://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSJSONSerialization_Class/Reference/Reference.html) Wrapper for Apple's NSJSONSerialization in the Cocoa Framework (MacRuby only)
51
+ * [gson.rb](https://github.com/avsej/gson.rb) A Ruby wrapper for google-gson library (JRuby only)
51
52
  * [OkJson][okjson] A simple, vendorable JSON parser
52
53
 
53
54
  ## Supported Ruby Versions
@@ -7,7 +7,7 @@ module MultiJson
7
7
  end
8
8
 
9
9
  def dump(object, options={})
10
- ::JSON.generate([object], process_dump_options!(options)).strip[1..-2]
10
+ object.to_json(process_dump_options!(options))
11
11
  end
12
12
 
13
13
  protected
@@ -1,3 +1,3 @@
1
1
  module MultiJson
2
- VERSION = "1.6.0" unless defined?(MultiJson::VERSION)
2
+ VERSION = "1.6.1" unless defined?(MultiJson::VERSION)
3
3
  end
data/spec/helper.rb CHANGED
@@ -42,4 +42,4 @@ module MockModuleDecoder
42
42
  def dump(string)
43
43
  '{"abc":"def"}'
44
44
  end
45
- end
45
+ end
@@ -10,15 +10,17 @@ shared_examples_for 'JSON-like adapter' do |adapter|
10
10
  describe '.dump' do
11
11
  describe 'with :pretty option set to true' do
12
12
  it 'passes default pretty options' do
13
- ::JSON.should_receive(:generate).with(['foo'], JSON::PRETTY_STATE_PROTOTYPE.to_h).and_return('["foo"]')
14
- MultiJson.dump('foo', :pretty => true)
13
+ object = 'foo'
14
+ object.should_receive(:to_json).with(JSON::PRETTY_STATE_PROTOTYPE.to_h).and_return('["foo"]')
15
+ MultiJson.dump(object, :pretty => true)
15
16
  end
16
17
  end
17
18
 
18
19
  describe 'with :indent option' do
19
20
  it 'passes it on dump' do
20
- ::JSON.should_receive(:generate).with(['foo'], {:indent => "\t"}).and_return('["foo"]')
21
- MultiJson.dump('foo', :indent => "\t")
21
+ object = 'foo'
22
+ object.should_receive(:to_json).with(:indent => "\t").and_return('["foo"]')
23
+ MultiJson.dump(object, :indent => "\t")
22
24
  end
23
25
  end
24
26
  end
@@ -31,4 +33,4 @@ shared_examples_for 'JSON-like adapter' do |adapter|
31
33
  end
32
34
  end
33
35
  end
34
- end
36
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -39,7 +39,7 @@ cert_chain:
39
39
  U0xxV3ZRUnNCbHlwSGZoczZKSnVMbHlaUEdoVTNSL3YKU2YzbFZLcEJDV2dS
40
40
  cEdUdnk0NVhWcEIrNTl5MzNQSm1FdVExUFRFT1l2UXlhbzlVS01BQWFBTi83
41
41
  cVdRdGpsMApobHc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
42
- date: 2013-02-12 00:00:00.000000000 Z
42
+ date: 2013-02-14 00:00:00.000000000 Z
43
43
  dependencies:
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: bundler
metadata.gz.sig CHANGED
Binary file