gon 7.0.0 → 7.1.0

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
  SHA256:
3
- metadata.gz: a1f213a83073d4b73d4a732ad6c08dd46bdc76f288f9501a59fd573654161029
4
- data.tar.gz: 24c735289aca21c4946ee2a7b7ae46347b02f00bbce78aa9f2a1efa8c3cb74ac
3
+ metadata.gz: 0f6c1ea562fb5905e119179a42c8f98a33dd59b163ba23fb6cad4cb14233e5a4
4
+ data.tar.gz: d72eafdc9044dc21514354608f309fb6ffb312ee57aeb0849fea680f7f37212a
5
5
  SHA512:
6
- metadata.gz: ade05ffde11f213b5fb94961ed24185dfaede24e8e04db90970fae561bb15730866d6d205161d23b130e49d8bcb9218ef4a007554a0aa478472a0799d50ca879
7
- data.tar.gz: a1adcea362385383cae266310055a237fb5f00bc0895f6089958b2e76e7de7b3d84c33378d13ca87772c8a35dfdc453a5cc70ce3c9def15ab0b83b80d84da2c7
6
+ metadata.gz: 69f8734f5979ab7409c979490754a467ef1506eef1f13e5502b6ae00feea8faf17067b6a97c799243c7eddc3730d46453c762b9b523a83cd5df16f2288bc2116
7
+ data.tar.gz: 509bcaa61b4953ed76521be600a62865e3ef3918fea97a78c4cc889b026979cda435ffe96b04a6343ad70badfd0eafe193951ab3f38e96afc03e3cc803d06f63
data/README.md CHANGED
@@ -221,7 +221,7 @@ usage gon.global.
221
221
  ## Speed up Gon
222
222
 
223
223
  You can use any [JSON Engine](https://github.com/sferik/multi_json#supported-json-engines) you want.
224
- Gon uses `MultiJson` with autodetect mode, so all you need is just require your JSON library.
224
+ Gon uses multi_json with autodetect mode, so all you need is just require your JSON library.
225
225
 
226
226
  ## Current Maintainers
227
227
 
@@ -13,8 +13,13 @@ class Gon
13
13
  }
14
14
 
15
15
  def self.dump(object)
16
- dumped_json = MultiJson.dump object,
17
- mode: :compat, escape_mode: :xss_safe, time_format: :ruby
16
+ options = { mode: :compat, escape_mode: :xss_safe, time_format: :ruby }
17
+ dumped_json = if defined?(MultiJSON)
18
+ MultiJSON.generate(object, options)
19
+ else
20
+ MultiJson.dump(object, options)
21
+ end
22
+
18
23
  escape(dumped_json)
19
24
  end
20
25
 
data/lib/gon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Gon
4
- VERSION = '7.0.0'
4
+ VERSION = '7.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gon
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gazay
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  - !ruby/object:Gem::Version
197
197
  version: '0'
198
198
  requirements: []
199
- rubygems_version: 4.0.3
199
+ rubygems_version: 4.0.10
200
200
  specification_version: 4
201
201
  summary: Get your Rails variables in your JS
202
202
  test_files: []