multi_json 1.15.0 → 1.21.2
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 +4 -4
- data/LICENSE.md +1 -1
- data/README.md +207 -47
- data/lib/multi_json/adapter.rb +205 -20
- data/lib/multi_json/adapter_error.rb +36 -9
- data/lib/multi_json/adapter_selector.rb +214 -0
- data/lib/multi_json/adapters/fast_jsonparser.rb +74 -0
- data/lib/multi_json/adapters/json_gem.rb +97 -4
- data/lib/multi_json/adapters/oj.rb +72 -46
- data/lib/multi_json/adapters/oj_common.rb +50 -0
- data/lib/multi_json/adapters/yajl.rb +25 -4
- data/lib/multi_json/concurrency.rb +57 -0
- data/lib/multi_json/deprecated.rb +113 -0
- data/lib/multi_json/legacy_constant.rb +56 -0
- data/lib/multi_json/options.rb +162 -15
- data/lib/multi_json/options_cache/mutex_store.rb +65 -0
- data/lib/multi_json/options_cache.rb +73 -20
- data/lib/multi_json/parse_error.rb +101 -10
- data/lib/multi_json/version.rb +20 -7
- data/lib/multi_json.rb +233 -124
- metadata +23 -60
- data/CHANGELOG.md +0 -275
- data/CONTRIBUTING.md +0 -46
- data/lib/multi_json/adapters/gson.rb +0 -20
- data/lib/multi_json/adapters/jr_jackson.rb +0 -25
- data/lib/multi_json/adapters/json_common.rb +0 -23
- data/lib/multi_json/adapters/json_pure.rb +0 -11
- data/lib/multi_json/adapters/nsjsonserialization.rb +0 -35
- data/lib/multi_json/adapters/ok_json.rb +0 -23
- data/lib/multi_json/convertible_hash_keys.rb +0 -43
- data/lib/multi_json/vendor/okjson.rb +0 -606
data/lib/multi_json/version.rb
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MultiJSON
|
|
4
|
+
# Version information for MultiJSON
|
|
5
|
+
#
|
|
6
|
+
# @api private
|
|
2
7
|
class Version
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
# Major version number
|
|
9
|
+
MAJOR = 1 unless defined? MultiJSON::Version::MAJOR
|
|
10
|
+
# Minor version number
|
|
11
|
+
MINOR = 21 unless defined? MultiJSON::Version::MINOR
|
|
12
|
+
# Patch version number
|
|
13
|
+
PATCH = 2 unless defined? MultiJSON::Version::PATCH
|
|
14
|
+
# Pre-release version suffix
|
|
15
|
+
PRE = nil unless defined? MultiJSON::Version::PRE
|
|
7
16
|
|
|
8
17
|
class << self
|
|
9
|
-
#
|
|
18
|
+
# Return the version string
|
|
19
|
+
#
|
|
20
|
+
# @api private
|
|
21
|
+
# @return [String] version in semver format
|
|
10
22
|
def to_s
|
|
11
|
-
[MAJOR, MINOR, PATCH, PRE].compact.join(
|
|
23
|
+
[MAJOR, MINOR, PATCH, PRE].compact.join(".")
|
|
12
24
|
end
|
|
13
25
|
end
|
|
14
26
|
end
|
|
15
27
|
|
|
28
|
+
# Current version string in semver format
|
|
16
29
|
VERSION = Version.to_s.freeze
|
|
17
30
|
end
|
data/lib/multi_json.rb
CHANGED
|
@@ -1,161 +1,270 @@
|
|
|
1
|
-
|
|
2
|
-
require 'multi_json/version'
|
|
3
|
-
require 'multi_json/adapter_error'
|
|
4
|
-
require 'multi_json/parse_error'
|
|
5
|
-
require 'multi_json/options_cache'
|
|
1
|
+
# frozen_string_literal: true
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
require_relative "multi_json/concurrency"
|
|
4
|
+
require_relative "multi_json/options"
|
|
5
|
+
require_relative "multi_json/version"
|
|
6
|
+
require_relative "multi_json/adapter_error"
|
|
7
|
+
require_relative "multi_json/parse_error"
|
|
8
|
+
require_relative "multi_json/options_cache"
|
|
9
|
+
require_relative "multi_json/adapter_selector"
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
# A unified interface for JSON libraries in Ruby
|
|
12
|
+
#
|
|
13
|
+
# MultiJSON allows swapping between JSON backends without changing your code.
|
|
14
|
+
# It auto-detects available JSON libraries and uses the fastest one available.
|
|
15
|
+
#
|
|
16
|
+
# ## Method-definition patterns
|
|
17
|
+
#
|
|
18
|
+
# The current public API uses two patterns, each chosen for a specific reason:
|
|
19
|
+
#
|
|
20
|
+
# 1. ``module_function`` creates both a class method and a private instance
|
|
21
|
+
# method from a single ``def``. This is used for the hot-path API
|
|
22
|
+
# (``adapter``, ``use``, ``adapter=``, ``parse``, ``generate``,
|
|
23
|
+
# ``current_adapter``) so that both ``MultiJSON.parse(...)`` and legacy
|
|
24
|
+
# ``Class.new { include MultiJSON }.new.send(:parse, ...)`` invocations
|
|
25
|
+
# work through the same body. The instance versions are re-publicized
|
|
26
|
+
# below so YARD renders them as part of the public API.
|
|
27
|
+
# 2. ``def self.foo`` creates only a singleton method, giving mutation
|
|
28
|
+
# testing a single canonical definition to target. This is used for
|
|
29
|
+
# {.with_adapter}, which needs precise mutation coverage of its
|
|
30
|
+
# fiber-local save/restore logic.
|
|
31
|
+
#
|
|
32
|
+
# Deprecated public API (``decode``, ``encode``, ``engine``, ``load``,
|
|
33
|
+
# ``dump``, etc.) lives in {file:lib/multi_json/deprecated.rb} so this
|
|
34
|
+
# file stays focused on the current surface.
|
|
35
|
+
#
|
|
36
|
+
# @example Basic usage
|
|
37
|
+
# MultiJSON.parse('{"foo":"bar"}') #=> {"foo" => "bar"}
|
|
38
|
+
# MultiJSON.generate({foo: "bar"}) #=> '{"foo":"bar"}'
|
|
39
|
+
#
|
|
40
|
+
# @example Specifying an adapter
|
|
41
|
+
# MultiJSON.use(:oj)
|
|
42
|
+
# MultiJSON.parse('{"foo":"bar"}', adapter: :json_gem)
|
|
43
|
+
#
|
|
44
|
+
# @api public
|
|
45
|
+
module MultiJSON
|
|
46
|
+
extend Options
|
|
47
|
+
extend AdapterSelector
|
|
14
48
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'Use MultiJson.load_options or MultiJson.dump_options instead'
|
|
49
|
+
# Tracks which deprecation warnings have already been emitted so each one
|
|
50
|
+
# fires at most once per process. Stored as a Set rather than a Hash so
|
|
51
|
+
# presence checks have unambiguous semantics for mutation tests.
|
|
52
|
+
DEPRECATION_WARNINGS_SHOWN = Set.new
|
|
53
|
+
private_constant :DEPRECATION_WARNINGS_SHOWN
|
|
21
54
|
|
|
22
|
-
|
|
23
|
-
|
|
55
|
+
# Emit a deprecation warning at most once per process for the given key
|
|
56
|
+
#
|
|
57
|
+
# Defined as a singleton method (rather than via module_function) so
|
|
58
|
+
# there is exactly one definition for mutation tests to target.
|
|
59
|
+
# Public so the deprecated ``load_options`` / ``dump_options``
|
|
60
|
+
# aliases on the {Options} mixin can invoke it without routing
|
|
61
|
+
# through ``MultiJSON.send(...)``.
|
|
62
|
+
#
|
|
63
|
+
# The warning is tagged with the ``:deprecated`` category so callers
|
|
64
|
+
# can silence the whole set with ``Warning[:deprecated] = false`` or
|
|
65
|
+
# surface it via ``ruby -W:deprecated`` — the standard Ruby idiom for
|
|
66
|
+
# library deprecations since 2.7.
|
|
67
|
+
#
|
|
68
|
+
# @api private
|
|
69
|
+
# @param key [Symbol] identifier for the deprecation (typically the method name)
|
|
70
|
+
# @param message [String] warning message to emit on first call
|
|
71
|
+
# @return [void]
|
|
72
|
+
# @example
|
|
73
|
+
# MultiJSON.warn_deprecation_once(:foo, "MultiJSON.foo is deprecated")
|
|
74
|
+
def self.warn_deprecation_once(key, message)
|
|
75
|
+
Concurrency.synchronize(:deprecation_warnings) do
|
|
76
|
+
return if DEPRECATION_WARNINGS_SHOWN.include?(key)
|
|
24
77
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Kernel.warn "MultiJson.#{method_name} method is deprecated and no longer used."
|
|
78
|
+
Kernel.warn(message, category: :deprecated)
|
|
79
|
+
DEPRECATION_WARNINGS_SHOWN.add(key)
|
|
28
80
|
end
|
|
29
81
|
end
|
|
30
82
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
return :gson if defined?(::Gson)
|
|
52
|
-
|
|
53
|
-
REQUIREMENT_MAP.each do |adapter, library|
|
|
54
|
-
begin
|
|
55
|
-
require library
|
|
56
|
-
return adapter
|
|
57
|
-
rescue ::LoadError
|
|
58
|
-
next
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
Kernel.warn '[WARNING] MultiJson is using the default adapter (ok_json). ' \
|
|
63
|
-
'We recommend loading a different JSON library to improve performance.'
|
|
83
|
+
# Resolve the ``ParseError`` constant for an adapter class
|
|
84
|
+
#
|
|
85
|
+
# The result is memoized on the adapter class itself in a
|
|
86
|
+
# ``@_multi_json_parse_error`` ivar so subsequent ``MultiJSON.load``
|
|
87
|
+
# calls skip the constant lookup entirely. The lookup is performed
|
|
88
|
+
# with ``inherit: false`` so a stray top-level ``::ParseError``
|
|
89
|
+
# constant in the host process is correctly ignored on every
|
|
90
|
+
# supported Ruby implementation — TruffleRuby's ``::`` operator
|
|
91
|
+
# walks the ancestor chain and would otherwise pick up the top-level
|
|
92
|
+
# constant. Custom adapters that don't define their own
|
|
93
|
+
# ``ParseError`` get a clear {AdapterError} instead of the bare
|
|
94
|
+
# ``NameError`` Ruby would raise from the rescue clause.
|
|
95
|
+
#
|
|
96
|
+
# @api private
|
|
97
|
+
# @param adapter_class [Class] adapter class to inspect
|
|
98
|
+
# @return [Class] the adapter's ParseError class
|
|
99
|
+
# @raise [AdapterError] when the adapter doesn't define ParseError
|
|
100
|
+
def self.parse_error_class_for(adapter_class)
|
|
101
|
+
cached = adapter_class.instance_variable_get(:@_multi_json_parse_error)
|
|
102
|
+
return cached if cached
|
|
64
103
|
|
|
65
|
-
:
|
|
104
|
+
resolved = adapter_class.const_get(:ParseError, false)
|
|
105
|
+
adapter_class.instance_variable_set(:@_multi_json_parse_error, resolved)
|
|
106
|
+
rescue NameError
|
|
107
|
+
raise AdapterError, "Adapter #{adapter_class} must define a ParseError constant"
|
|
66
108
|
end
|
|
67
|
-
alias_method :default_engine, :default_adapter
|
|
68
109
|
|
|
69
|
-
#
|
|
70
|
-
|
|
71
|
-
|
|
110
|
+
# ===========================================================================
|
|
111
|
+
# Public API (module_function: class + private instance method)
|
|
112
|
+
# ===========================================================================
|
|
72
113
|
|
|
73
|
-
|
|
114
|
+
# @!visibility private
|
|
115
|
+
module_function
|
|
74
116
|
|
|
75
|
-
|
|
117
|
+
# Returns the current adapter class
|
|
118
|
+
#
|
|
119
|
+
# Honors a fiber-local override set by {.with_adapter} so concurrent
|
|
120
|
+
# blocks observe their own adapter without clobbering the process-wide
|
|
121
|
+
# default. Falls back to the process default when no override is set.
|
|
122
|
+
#
|
|
123
|
+
# @api public
|
|
124
|
+
# @return [Class] the current adapter class
|
|
125
|
+
# @example
|
|
126
|
+
# MultiJSON.adapter #=> MultiJSON::Adapters::Oj
|
|
127
|
+
def adapter
|
|
128
|
+
override = Fiber[:multi_json_adapter]
|
|
129
|
+
return override if override
|
|
130
|
+
|
|
131
|
+
@adapter ||= use(nil)
|
|
76
132
|
end
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
#
|
|
80
|
-
#
|
|
81
|
-
#
|
|
82
|
-
#
|
|
83
|
-
#
|
|
84
|
-
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
87
|
-
#
|
|
88
|
-
#
|
|
89
|
-
# * <tt>:jr_jackson</tt> (JRuby only)
|
|
133
|
+
|
|
134
|
+
# Sets the adapter to use for JSON operations
|
|
135
|
+
#
|
|
136
|
+
# The merged-options cache is only reset when the new adapter loads
|
|
137
|
+
# successfully. A failed ``use(:nonexistent)`` leaves the cache in
|
|
138
|
+
# place so the previously-active adapter keeps its cached entries.
|
|
139
|
+
#
|
|
140
|
+
# @api public
|
|
141
|
+
# @param new_adapter [Symbol, String, Module, nil] adapter specification
|
|
142
|
+
# @return [Class] the loaded adapter class
|
|
143
|
+
# @example
|
|
144
|
+
# MultiJSON.use(:oj)
|
|
90
145
|
def use(new_adapter)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
alias_method :adapter=, :use
|
|
96
|
-
alias_method :engine=, :use
|
|
97
|
-
|
|
98
|
-
def load_adapter(new_adapter)
|
|
99
|
-
case new_adapter
|
|
100
|
-
when String, Symbol
|
|
101
|
-
load_adapter_from_string_name new_adapter.to_s
|
|
102
|
-
when NilClass, FalseClass
|
|
103
|
-
load_adapter default_adapter
|
|
104
|
-
when Class, Module
|
|
105
|
-
new_adapter
|
|
106
|
-
else
|
|
107
|
-
fail ::LoadError, new_adapter
|
|
146
|
+
loaded = load_adapter(new_adapter)
|
|
147
|
+
Concurrency.synchronize(:adapter) do
|
|
148
|
+
OptionsCache.reset
|
|
149
|
+
@adapter = loaded
|
|
108
150
|
end
|
|
109
|
-
rescue ::LoadError => exception
|
|
110
|
-
raise AdapterError.build(exception)
|
|
111
151
|
end
|
|
112
152
|
|
|
113
|
-
#
|
|
153
|
+
# Sets the adapter to use for JSON operations
|
|
114
154
|
#
|
|
115
|
-
#
|
|
155
|
+
# @api public
|
|
156
|
+
# @return [Class] the loaded adapter class
|
|
157
|
+
# @example
|
|
158
|
+
# MultiJSON.adapter = :json_gem
|
|
159
|
+
alias_method :adapter=, :use
|
|
160
|
+
module_function :adapter=
|
|
161
|
+
|
|
162
|
+
# Parses a JSON string into a Ruby object
|
|
116
163
|
#
|
|
117
|
-
#
|
|
118
|
-
#
|
|
119
|
-
|
|
120
|
-
|
|
164
|
+
# Returns ``nil`` for ``nil``, empty, and whitespace-only inputs
|
|
165
|
+
# instead of raising. Pass an explicit non-blank string if you want
|
|
166
|
+
# to surface a {ParseError} for empty payloads at the call site.
|
|
167
|
+
#
|
|
168
|
+
# @api public
|
|
169
|
+
# @param string [String, #read] JSON string or IO-like object
|
|
170
|
+
# @param options [Hash] parsing options (adapter-specific)
|
|
171
|
+
# @return [Object, nil] parsed Ruby object, or nil for blank input
|
|
172
|
+
# @raise [ParseError] if parsing fails
|
|
173
|
+
# @raise [AdapterError] if the adapter doesn't define a ``ParseError`` constant
|
|
174
|
+
# @example
|
|
175
|
+
# MultiJSON.parse('{"foo":"bar"}') #=> {"foo" => "bar"}
|
|
176
|
+
# MultiJSON.parse("") #=> nil
|
|
177
|
+
# MultiJSON.parse(" \n") #=> nil
|
|
178
|
+
def parse(string, options = {})
|
|
179
|
+
adapter_class = current_adapter(options)
|
|
180
|
+
parse_error_class = MultiJSON.parse_error_class_for(adapter_class)
|
|
121
181
|
begin
|
|
122
|
-
|
|
123
|
-
rescue
|
|
124
|
-
raise ParseError.build(
|
|
182
|
+
adapter_class.load(string, options)
|
|
183
|
+
rescue parse_error_class => e
|
|
184
|
+
raise ParseError.build(e, string)
|
|
125
185
|
end
|
|
126
186
|
end
|
|
127
|
-
alias_method :decode, :load
|
|
128
187
|
|
|
188
|
+
# Returns the adapter to use for the given options
|
|
189
|
+
#
|
|
190
|
+
# ``nil`` is accepted as a no-options sentinel — explicit
|
|
191
|
+
# ``current_adapter(nil)`` calls fall through to the process default
|
|
192
|
+
# adapter without raising.
|
|
193
|
+
#
|
|
194
|
+
# @api public
|
|
195
|
+
# @param options [Hash, nil] options that may contain :adapter key, or
|
|
196
|
+
# nil to use the process default
|
|
197
|
+
# @return [Class] adapter class
|
|
198
|
+
# @example
|
|
199
|
+
# MultiJSON.current_adapter(adapter: :oj) #=> MultiJSON::Adapters::Oj
|
|
129
200
|
def current_adapter(options = {})
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
adapter
|
|
134
|
-
end
|
|
201
|
+
options ||= Options::EMPTY_OPTIONS
|
|
202
|
+
adapter_override = options[:adapter]
|
|
203
|
+
adapter_override ? load_adapter(adapter_override) : adapter
|
|
135
204
|
end
|
|
136
205
|
|
|
137
|
-
#
|
|
138
|
-
|
|
206
|
+
# Serializes a Ruby object to a JSON string
|
|
207
|
+
#
|
|
208
|
+
# @api public
|
|
209
|
+
# @param object [Object] object to serialize
|
|
210
|
+
# @param options [Hash] serialization options (adapter-specific)
|
|
211
|
+
# @return [String] JSON string
|
|
212
|
+
# @example
|
|
213
|
+
# MultiJSON.generate({foo: "bar"}) #=> '{"foo":"bar"}'
|
|
214
|
+
def generate(object, options = {})
|
|
139
215
|
current_adapter(options).dump(object, options)
|
|
140
216
|
end
|
|
141
|
-
alias_method :encode, :dump
|
|
142
217
|
|
|
143
|
-
#
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
218
|
+
# Re-publicize the instance versions of the module_function methods so
|
|
219
|
+
# YARD/yardstick render them as part of the public API and legacy
|
|
220
|
+
# ``include MultiJSON`` consumers can call them without ``.send``.
|
|
221
|
+
public :adapter, :use, :adapter=, :parse, :current_adapter, :generate
|
|
222
|
+
|
|
223
|
+
# ===========================================================================
|
|
224
|
+
# Public API (def self.foo: singleton-only, for mutation-test precision)
|
|
225
|
+
# ===========================================================================
|
|
226
|
+
|
|
227
|
+
# Executes a block using the specified adapter
|
|
228
|
+
#
|
|
229
|
+
# Defined as a singleton method so mutation testing has exactly one
|
|
230
|
+
# definition to target. The override is stored in fiber-local storage
|
|
231
|
+
# so concurrent fibers and threads each see their own adapter without
|
|
232
|
+
# racing on a shared module variable; nested calls save and restore
|
|
233
|
+
# the previous fiber-local value.
|
|
234
|
+
#
|
|
235
|
+
# @api public
|
|
236
|
+
# @param new_adapter [Symbol, String, Module] adapter to use
|
|
237
|
+
# @yield block to execute with the temporary adapter
|
|
238
|
+
# @return [Object] result of the block
|
|
239
|
+
# @example
|
|
240
|
+
# MultiJSON.with_adapter(:json_gem) { MultiJSON.dump({}) }
|
|
241
|
+
def self.with_adapter(new_adapter)
|
|
242
|
+
previous_override = Fiber[:multi_json_adapter]
|
|
243
|
+
Fiber[:multi_json_adapter] = load_adapter(new_adapter)
|
|
147
244
|
yield
|
|
148
245
|
ensure
|
|
149
|
-
|
|
246
|
+
Fiber[:multi_json_adapter] = previous_override
|
|
150
247
|
end
|
|
151
|
-
alias_method :with_engine, :with_adapter
|
|
152
248
|
|
|
153
|
-
|
|
249
|
+
# ===========================================================================
|
|
250
|
+
# Private instance-method delegates for the singleton-only methods above
|
|
251
|
+
# ===========================================================================
|
|
252
|
+
|
|
253
|
+
private
|
|
154
254
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
255
|
+
# Instance-method delegate for {MultiJSON.with_adapter}
|
|
256
|
+
#
|
|
257
|
+
# @api private
|
|
258
|
+
# @param new_adapter [Symbol, String, Module] adapter to use
|
|
259
|
+
# @yield block to execute with the temporary adapter
|
|
260
|
+
# @return [Object] result of the block
|
|
261
|
+
# @example
|
|
262
|
+
# class Foo; include MultiJSON; end
|
|
263
|
+
# Foo.new.send(:with_adapter, :json_gem) { ... }
|
|
264
|
+
def with_adapter(new_adapter, &)
|
|
265
|
+
MultiJSON.with_adapter(new_adapter, &)
|
|
160
266
|
end
|
|
161
267
|
end
|
|
268
|
+
|
|
269
|
+
require_relative "multi_json/deprecated"
|
|
270
|
+
require_relative "multi_json/legacy_constant"
|
metadata
CHANGED
|
@@ -1,90 +1,54 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: multi_json
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.21.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Bleigh
|
|
8
8
|
- Josh Kalderimis
|
|
9
|
-
- Erik
|
|
9
|
+
- Erik Berlin
|
|
10
10
|
- Pavel Pravosud
|
|
11
|
-
autorequire:
|
|
12
11
|
bindir: bin
|
|
13
12
|
cert_chain: []
|
|
14
|
-
date:
|
|
15
|
-
dependencies:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
|
19
|
-
requirements:
|
|
20
|
-
- - "~>"
|
|
21
|
-
- !ruby/object:Gem::Version
|
|
22
|
-
version: '10.5'
|
|
23
|
-
type: :development
|
|
24
|
-
prerelease: false
|
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
-
requirements:
|
|
27
|
-
- - "~>"
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
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'
|
|
44
|
-
description: A common interface to multiple JSON libraries, including Oj, Yajl, the
|
|
45
|
-
JSON gem (with C-extensions), the pure-Ruby JSON gem, NSJSONSerialization, gson.rb,
|
|
46
|
-
JrJackson, and OkJson.
|
|
13
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
|
+
dependencies: []
|
|
15
|
+
description: A common interface to multiple JSON libraries, including fast_jsonparser,
|
|
16
|
+
Oj, Yajl, and the JSON gem.
|
|
47
17
|
email:
|
|
48
|
-
- michael@intridea.com
|
|
49
|
-
- josh.kalderimis@gmail.com
|
|
50
18
|
- sferik@gmail.com
|
|
51
|
-
- pavel@pravosud.com
|
|
52
19
|
executables: []
|
|
53
20
|
extensions: []
|
|
54
21
|
extra_rdoc_files: []
|
|
55
22
|
files:
|
|
56
|
-
- CHANGELOG.md
|
|
57
|
-
- CONTRIBUTING.md
|
|
58
23
|
- LICENSE.md
|
|
59
24
|
- README.md
|
|
60
25
|
- lib/multi_json.rb
|
|
61
26
|
- lib/multi_json/adapter.rb
|
|
62
27
|
- lib/multi_json/adapter_error.rb
|
|
63
|
-
- lib/multi_json/
|
|
64
|
-
- lib/multi_json/adapters/
|
|
65
|
-
- lib/multi_json/adapters/json_common.rb
|
|
28
|
+
- lib/multi_json/adapter_selector.rb
|
|
29
|
+
- lib/multi_json/adapters/fast_jsonparser.rb
|
|
66
30
|
- lib/multi_json/adapters/json_gem.rb
|
|
67
|
-
- lib/multi_json/adapters/json_pure.rb
|
|
68
|
-
- lib/multi_json/adapters/nsjsonserialization.rb
|
|
69
31
|
- lib/multi_json/adapters/oj.rb
|
|
70
|
-
- lib/multi_json/adapters/
|
|
32
|
+
- lib/multi_json/adapters/oj_common.rb
|
|
71
33
|
- lib/multi_json/adapters/yajl.rb
|
|
72
|
-
- lib/multi_json/
|
|
34
|
+
- lib/multi_json/concurrency.rb
|
|
35
|
+
- lib/multi_json/deprecated.rb
|
|
36
|
+
- lib/multi_json/legacy_constant.rb
|
|
73
37
|
- lib/multi_json/options.rb
|
|
74
38
|
- lib/multi_json/options_cache.rb
|
|
39
|
+
- lib/multi_json/options_cache/mutex_store.rb
|
|
75
40
|
- lib/multi_json/parse_error.rb
|
|
76
|
-
- lib/multi_json/vendor/okjson.rb
|
|
77
41
|
- lib/multi_json/version.rb
|
|
78
|
-
homepage: https://github.com/
|
|
42
|
+
homepage: https://github.com/sferik/multi_json
|
|
79
43
|
licenses:
|
|
80
44
|
- MIT
|
|
81
45
|
metadata:
|
|
82
|
-
bug_tracker_uri: https://github.com/
|
|
83
|
-
changelog_uri: https://github.com/
|
|
84
|
-
documentation_uri: https://www.rubydoc.info/gems/multi_json/1.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
46
|
+
bug_tracker_uri: https://github.com/sferik/multi_json/issues
|
|
47
|
+
changelog_uri: https://github.com/sferik/multi_json/blob/v1.21.2/CHANGELOG.md
|
|
48
|
+
documentation_uri: https://www.rubydoc.info/gems/multi_json/1.21.2
|
|
49
|
+
rubygems_mfa_required: 'true'
|
|
50
|
+
source_code_uri: https://github.com/sferik/multi_json/tree/v1.21.2
|
|
51
|
+
wiki_uri: https://github.com/sferik/multi_json/wiki
|
|
88
52
|
rdoc_options: []
|
|
89
53
|
require_paths:
|
|
90
54
|
- lib
|
|
@@ -92,15 +56,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
92
56
|
requirements:
|
|
93
57
|
- - ">="
|
|
94
58
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '
|
|
59
|
+
version: '3.2'
|
|
96
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
61
|
requirements:
|
|
98
62
|
- - ">="
|
|
99
63
|
- !ruby/object:Gem::Version
|
|
100
|
-
version:
|
|
64
|
+
version: '0'
|
|
101
65
|
requirements: []
|
|
102
|
-
rubygems_version:
|
|
103
|
-
signing_key:
|
|
66
|
+
rubygems_version: 4.0.20
|
|
104
67
|
specification_version: 4
|
|
105
68
|
summary: A common interface to multiple JSON libraries.
|
|
106
69
|
test_files: []
|