multi_json 1.9.2 → 1.9.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43f5709d1510f214433839f07ec267a8b90e1078
4
- data.tar.gz: e26ae12730dcc51982e0d8afd3d8aa50c2c5550e
3
+ metadata.gz: 7c2a387cf1082722ed68ed290ba53909de8fa882
4
+ data.tar.gz: d06db47576a3cb2801b12af6d15fbd227facc800
5
5
  SHA512:
6
- metadata.gz: 322d6e7444d708c5e18045383d8ab12cc7730a4aea6a352bdf0bc40f5d57c437d62119bc290b064b90af438fe1e7852d1e167307bd786b863da9877416a13d46
7
- data.tar.gz: 357ba441d1ec3e0a4290f0a7b6e11209fda0f8705d3b7d06ec800187ae26988778f452367bb0f36320b7fa826b49bb8cc895156fb81651bd7fc2cd38eb377041
6
+ metadata.gz: dab04d4d5f9f3bcda964d379a9d9fee49cd09b2a72cf5ecf67d3f1be339f12e4a54c8fae1269b07437d4be0b87f93c8ef3719bd74b2096fb75a9db69d3ecd6a5
7
+ data.tar.gz: 723e745ecc160b1ae47ea0e35b79d0833b8c65549b787c8f3e2b2e9ae26055239a2d0cac18b1b3a637cdf5b7778d99ed0ee91f116e55156e1c304146b7558110
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 1.9.3
2
+ -----
3
+ * [Convert indent option to Fixnum before passing to Oj](https://github.com/intridea/multi_json/commit/826fc5535b863b74fc9f981dfdda3e26f1ee4e5b)
4
+
1
5
  1.9.2
2
6
  -----
3
7
  * [Enable use_to_json option for Oj adapter by default](https://github.com/intridea/multi_json/commit/76a4aaf697b10bbabd5d535d83cf1149efcfe5c7)
data/Gemfile CHANGED
@@ -23,7 +23,7 @@ platforms :jruby do
23
23
  end
24
24
 
25
25
  platforms :mingw, :mswin, :ruby do
26
- gem 'oj', '~> 2.0', :require => nil
26
+ gem 'oj', '~> 2.8', :require => nil
27
27
  gem 'yajl-ruby', '~> 1.0', :require => nil
28
28
  end
29
29
 
@@ -17,6 +17,7 @@ module MultiJson
17
17
 
18
18
  def dump(object, options={})
19
19
  options.merge!(:indent => 2) if options[:pretty]
20
+ options[:indent] = options[:indent].to_i if options[:indent]
20
21
  ::Oj.dump(object, options)
21
22
  end
22
23
  end
@@ -2,7 +2,7 @@ module MultiJson
2
2
  class Version
3
3
  MAJOR = 1 unless defined? MultiJson::Version::MAJOR
4
4
  MINOR = 9 unless defined? MultiJson::Version::MINOR
5
- PATCH = 2 unless defined? MultiJson::Version::PATCH
5
+ PATCH = 3 unless defined? MultiJson::Version::PATCH
6
6
  PRE = nil unless defined? MultiJson::Version::PRE
7
7
 
8
8
  class << self
@@ -7,4 +7,4 @@ require 'multi_json/adapters/gson'
7
7
 
8
8
  describe MultiJson::Adapters::Gson do
9
9
  it_behaves_like 'an adapter', described_class
10
- end
10
+ end
@@ -7,4 +7,14 @@ require 'multi_json/adapters/oj'
7
7
 
8
8
  describe MultiJson::Adapters::Oj do
9
9
  it_behaves_like 'an adapter', described_class
10
- end
10
+
11
+ describe '.dump' do
12
+ describe '#dump_options' do
13
+ around{ |example| with_default_options(&example) }
14
+
15
+ it 'ensures indent is a Fixnum' do
16
+ expect{ MultiJson.dump(42, :indent => '')}.not_to raise_error
17
+ end
18
+ end
19
+ end
20
+ end
data/spec/spec_helper.rb CHANGED
@@ -79,3 +79,11 @@ def get_exception(exception_class = StandardError)
79
79
  exception
80
80
  end
81
81
  end
82
+
83
+ def with_default_options
84
+ adapter = MultiJson.adapter
85
+ adapter.load_options = adapter.dump_options = MultiJson.load_options = MultiJson.dump_options = nil
86
+ yield
87
+ ensure
88
+ adapter.load_options = adapter.dump_options = MultiJson.load_options = MultiJson.dump_options = nil
89
+ 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.9.2
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
@@ -33,7 +33,7 @@ cert_chain:
33
33
  7BTxdlSpJZDcAK29Ni3NRCRu6Air4wfDln0Ilzeuut6cJ4/j2/RlvsccVSRaEfOa
34
34
  wM7GTK5SEdU3qelyBdc4+RRs6uU=
35
35
  -----END CERTIFICATE-----
36
- date: 2014-03-19 00:00:00.000000000 Z
36
+ date: 2014-04-27 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: bundler
metadata.gz.sig CHANGED
Binary file