multi_json 1.13.1 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1b1089ce9b52b1a5bd0685e39d5b7ec690d181a6
4
- data.tar.gz: f25d7e5f1f290a8c0b37e3346e6ea62639feb996
2
+ SHA256:
3
+ metadata.gz: ba3f1870ebd467a8356a8138d7bba83f224659a5cea2d4f9a845fa88e8d4934f
4
+ data.tar.gz: 89051067684a2f7f101dbc1b00e8cc4a417fdb9b829e476db6d90ea2cc4cf37b
5
5
  SHA512:
6
- metadata.gz: d1a31d1e0da0c28e7491e5ba64ed0a894eeae616d786f7308118031982f77712a2b03429622744700f3aef6577305190ca16c07d593cf2eaf4dd2b7978ba737f
7
- data.tar.gz: c983f3a10091b727058907e2518094164937a807c2f415a32743dad2f7526efd2ede74351007a29fd25b17e7472f68e50fb1f3514e6acd285e92443318af07d8
6
+ metadata.gz: 3f317d2719838c2466a2ca066b25259a2653cf639198a9e47fc0c0365a8a02e8307feaa4392b445ae1f918c92c4cc7deb833e1c1945c4682cd3dac3d91af9789
7
+ data.tar.gz: 81b37aeb82f9744a93eec867a54e3a83537bedb6f29747818187b6fc27d599a6ee88f239db382f85ed840319e19452f43f09c29655ac664e9a4680bc33c335a8
@@ -1,3 +1,18 @@
1
+ 1.14.2
2
+ ------
3
+
4
+ * [Improve detection of json_gem adapter](https://github.com/intridea/multi_json/commit/62d54019b17ebf83b28c8deb871a02a122e7d9cf)
5
+
6
+ 1.14.1
7
+ ------
8
+
9
+ * [Fix a warning in Ruby 2.7](https://github.com/intridea/multi_json/commit/26a94ab8c78a394cc237e2ea292c1de4f6ed30d7)
10
+
11
+ 1.14.0
12
+ ------
13
+
14
+ * [Support Oj 3.x gem](https://github.com/intridea/multi_json/commit/5d8febdbebc428882811b90d514f3628617a61d5)
15
+
1
16
  1.13.1
2
17
  ------
3
18
 
data/README.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  [![Gem Version](http://img.shields.io/gem/v/multi_json.svg)][gem]
4
4
  [![Build Status](http://travis-ci.org/intridea/multi_json.svg)][travis]
5
- [![Dependency Status](http://img.shields.io/gemnasium/intridea/multi_json.svg)][gemnasium]
6
- [![Code Climate](http://img.shields.io/codeclimate/github/intridea/multi_json.svg)][codeclimate]
5
+ [![Code Climate](https://codeclimate.com/github/intridea/multi_json.svg)][codeclimate]
7
6
 
8
7
  Lots of Ruby libraries parse JSON and everyone has their favorite JSON coder.
9
8
  Instead of choosing a single JSON coder and forcing users of your library to be
@@ -61,17 +60,16 @@ MultiJSON falls back to [OkJson][], a simple, vendorable JSON parser.
61
60
  This library aims to support and is [tested against][travis] the following Ruby
62
61
  implementations:
63
62
 
64
- * Ruby 1.8.7
65
- * Ruby 1.9.2
66
- * Ruby 1.9.3
67
- * Ruby 2.0.0
68
- * Ruby 2.1.10
69
- * Ruby 2.2.9
70
- * Ruby 2.4.3
71
- * Ruby 2.5.0
63
+ * Ruby 1.8
64
+ * Ruby 1.9
65
+ * Ruby 2.0
66
+ * Ruby 2.1
67
+ * Ruby 2.2
68
+ * Ruby 2.4
69
+ * Ruby 2.5
70
+ * Ruby 2.6
71
+ * Ruby 2.7
72
72
  * [JRuby][]
73
- * [Rubinius][]
74
- * [MacRuby][] (not tested on Travis CI)
75
73
 
76
74
  If something doesn't work in one of these implementations, it's a bug.
77
75
 
@@ -107,7 +105,6 @@ and Pavel Pravosud. See [LICENSE][] for details.
107
105
 
108
106
  [codeclimate]: https://codeclimate.com/github/intridea/multi_json
109
107
  [gem]: https://rubygems.org/gems/multi_json
110
- [gemnasium]: https://gemnasium.com/intridea/multi_json
111
108
  [gson]: https://github.com/avsej/gson.rb
112
109
  [jrjackson]: https://github.com/guyboertje/jrjackson
113
110
  [jruby]: http://www.jruby.org/
@@ -119,7 +116,6 @@ and Pavel Pravosud. See [LICENSE][] for details.
119
116
  [oj]: https://github.com/ohler55/oj
120
117
  [okjson]: https://github.com/kr/okjson
121
118
  [pvc]: http://docs.rubygems.org/read/chapter/16#page74
122
- [rubinius]: http://rubini.us/
123
119
  [semver]: http://semver.org/
124
120
  [travis]: http://travis-ci.org/intridea/multi_json
125
121
  [yajl]: https://github.com/brianmario/yajl-ruby
@@ -47,7 +47,7 @@ module MultiJson
47
47
  return :oj if defined?(::Oj)
48
48
  return :yajl if defined?(::Yajl)
49
49
  return :jr_jackson if defined?(::JrJackson)
50
- return :json_gem if defined?(::JSON::JSON_LOADED)
50
+ return :json_gem if defined?(::JSON::Ext::Parser)
51
51
  return :gson if defined?(::Gson)
52
52
 
53
53
  REQUIREMENT_MAP.each do |adapter, library|
@@ -1,3 +1,6 @@
1
+ # This adapter is here for legacy reasons. We can't really test it, so it's hard
2
+ # to tell if it's even working properly. If you're still using it, please
3
+ # consider migrating to any other adapter out there.
1
4
  framework 'Foundation'
2
5
  require 'multi_json/adapters/ok_json'
3
6
 
@@ -34,10 +34,29 @@ module MultiJson
34
34
  ::Oj.load(string, options)
35
35
  end
36
36
 
37
- def dump(object, options = {})
38
- options.merge!(:indent => 2) if options[:pretty]
39
- options[:indent] = options[:indent].to_i if options[:indent]
40
- ::Oj.dump(object, options)
37
+ case ::Oj::VERSION
38
+ when /\A2\./
39
+ def dump(object, options = {})
40
+ options.merge!(:indent => 2) if options[:pretty]
41
+ options[:indent] = options[:indent].to_i if options[:indent]
42
+ ::Oj.dump(object, options)
43
+ end
44
+ when /\A3\./
45
+ PRETTY_STATE_PROTOTYPE = {
46
+ :indent => " ",
47
+ :space => " ",
48
+ :space_before => "",
49
+ :object_nl => "\n",
50
+ :array_nl => "\n",
51
+ :ascii_only => false,
52
+ }
53
+
54
+ def dump(object, options = {})
55
+ options.merge!(PRETTY_STATE_PROTOTYPE.dup) if options.delete(:pretty)
56
+ ::Oj.dump(object, options)
57
+ end
58
+ else
59
+ fail "Unsupported Oj version: #{::Oj::VERSION}"
41
60
  end
42
61
  end
43
62
  end
@@ -7,9 +7,9 @@ module MultiJson
7
7
  @load_cache = {}
8
8
  end
9
9
 
10
- def fetch(type, key)
10
+ def fetch(type, key, &block)
11
11
  cache = instance_variable_get("@#{type}_cache")
12
- cache.key?(key) ? cache[key] : write(cache, key, &Proc.new)
12
+ cache.key?(key) ? cache[key] : write(cache, key, &block)
13
13
  end
14
14
 
15
15
  private
@@ -1,8 +1,8 @@
1
1
  module MultiJson
2
2
  class Version
3
3
  MAJOR = 1 unless defined? MultiJson::Version::MAJOR
4
- MINOR = 13 unless defined? MultiJson::Version::MINOR
5
- PATCH = 1 unless defined? MultiJson::Version::PATCH
4
+ MINOR = 15 unless defined? MultiJson::Version::MINOR
5
+ PATCH = 0 unless defined? MultiJson::Version::PATCH
6
6
  PRE = nil unless defined? MultiJson::Version::PRE
7
7
 
8
8
  class << self
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.13.1
4
+ version: 1.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
@@ -10,45 +10,37 @@ authors:
10
10
  - Pavel Pravosud
11
11
  autorequire:
12
12
  bindir: bin
13
- cert_chain:
14
- - |
15
- -----BEGIN CERTIFICATE-----
16
- MIIDYDCCAkigAwIBAgIBATANBgkqhkiG9w0BAQUFADA7MQ0wCwYDVQQDDAR5b3Vy
17
- MRUwEwYKCZImiZPyLGQBGRYFZW1haWwxEzARBgoJkiaJk/IsZAEZFgNjb20wHhcN
18
- MTgwMTA4MjIyOTMyWhcNMTkwMTA4MjIyOTMyWjA7MQ0wCwYDVQQDDAR5b3VyMRUw
19
- EwYKCZImiZPyLGQBGRYFZW1haWwxEzARBgoJkiaJk/IsZAEZFgNjb20wggEiMA0G
20
- CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDG77wIkJev2/a8aPpyEYBhj7izfPiP
21
- C66ZWkPauvkV6MB2CPEH27ivgtHAxxu8R31C+ZXDL9WA+LLwrklcbAyaPynTEV/g
22
- eYp6dxptxmeXoHT+CLrDaQtpEpOmljEUg7CPaSNjXw3/Qi7QndsPh88c8X97dFvb
23
- +yCf9NCI1QjyES4dLEioKqk/smf54zEM508iPlsAdxKDZ12LPOxVY8+q/dWRtlCK
24
- 6upwAddBhiVl5uksKD26NtaQNMgPXmqYLN3A2eLtktPncF+IYK5DRIPnRd6RhNuV
25
- ZCxXw6UPH0IIYp62bNAb5IneaooJ/ROlBRC1qGfLIx1IA8BkwfITUJYrAgMBAAGj
26
- bzBtMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQudQhSt5zoh7J8
27
- RFSAHv5Aycm0pDAZBgNVHREEEjAQgQ55b3VyQGVtYWlsLmNvbTAZBgNVHRIEEjAQ
28
- gQ55b3VyQGVtYWlsLmNvbTANBgkqhkiG9w0BAQUFAAOCAQEAuDFit+TKy6Z8i02y
29
- htEeuNL9ZNVBfmv6Li6AdUKoiCgStjbH0NKaC6eTx+4glHfZS3o/vLdnHKeoWwJs
30
- kVIWEQgaUVabD+bkdS9s5icM3ox2XxRJd9uDW62WvFHFZzbJiLkop9XvnnAgMlGy
31
- O4oewvfU2u5E1kTY9nGnnTngKaw0Zh1VN6yexwv1FIOBXAaAYclVTfbEEzBqHLK/
32
- 80mUboJWH2DXpWM6JCwGR7Blt2Zsfp172JjwW75/VQwPndKZDCkjTN/7MbHgvUQR
33
- X7myOZyY2pB6iYleyWB68zhOnqbtf/3ZYS8vfSd1M5qt8TzmgR4VdbogpEr4wRV6
34
- KG+kpw==
35
- -----END CERTIFICATE-----
36
- date: 2018-01-10 00:00:00.000000000 Z
13
+ cert_chain: []
14
+ date: 2020-07-10 00:00:00.000000000 Z
37
15
  dependencies:
38
16
  - !ruby/object:Gem::Dependency
39
- name: bundler
17
+ name: rake
40
18
  requirement: !ruby/object:Gem::Requirement
41
19
  requirements:
42
20
  - - "~>"
43
21
  - !ruby/object:Gem::Version
44
- version: '1.0'
22
+ version: '10.5'
45
23
  type: :development
46
24
  prerelease: false
47
25
  version_requirements: !ruby/object:Gem::Requirement
48
26
  requirements:
49
27
  - - "~>"
50
28
  - !ruby/object:Gem::Version
51
- version: '1.0'
29
+ version: '10.5'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - "~>"
35
+ - !ruby/object:Gem::Version
36
+ version: '3.9'
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '3.9'
52
44
  description: A common interface to multiple JSON libraries, including Oj, Yajl, the
53
45
  JSON gem (with C-extensions), the pure-Ruby JSON gem, NSJSONSerialization, gson.rb,
54
46
  JrJackson, and OkJson.
@@ -83,10 +75,15 @@ files:
83
75
  - lib/multi_json/parse_error.rb
84
76
  - lib/multi_json/vendor/okjson.rb
85
77
  - lib/multi_json/version.rb
86
- homepage: http://github.com/intridea/multi_json
78
+ homepage: https://github.com/intridea/multi_json
87
79
  licenses:
88
80
  - MIT
89
- metadata: {}
81
+ metadata:
82
+ bug_tracker_uri: https://github.com/intridea/multi_json/issues
83
+ changelog_uri: https://github.com/intridea/multi_json/blob/v1.15.0/CHANGELOG.md
84
+ documentation_uri: https://www.rubydoc.info/gems/multi_json/1.15.0
85
+ source_code_uri: https://github.com/intridea/multi_json/tree/v1.15.0
86
+ wiki_uri: https://github.com/intridea/multi_json/wiki
90
87
  post_install_message:
91
88
  rdoc_options: []
92
89
  require_paths:
@@ -102,8 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
99
  - !ruby/object:Gem::Version
103
100
  version: 1.3.5
104
101
  requirements: []
105
- rubyforge_project:
106
- rubygems_version: 2.6.14
102
+ rubygems_version: 3.0.3
107
103
  signing_key:
108
104
  specification_version: 4
109
105
  summary: A common interface to multiple JSON libraries.
Binary file
data.tar.gz.sig DELETED
@@ -1 +0,0 @@
1
- kx|�1��a��eW�V貏�a�ڏ�_P�D*���>R�%���I"]�C������W<���H%�J��7c�R�߻�HMV0�2�h32jj9W�e��ar����>;\o��p��ܬ���;ԕyC�N��
metadata.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- R�N1-0�}�D9Ҧ��1Y-�m{v�N{ ���:������N.��o�w� "���P�q�����d� F�\&�In^x��o��iN`�����=�t�GU��iJ�~�L���FM�p<���������
2
- sEb���0���g�V�2W}�