json_pure 2.7.3 → 2.7.4

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: '028937ab43af8f1ada9a531711dad5b787350f4422ac24d8c611646a016aba28'
4
- data.tar.gz: 774ccaced1f1bec5adc3088caabe6667b16efaca072e29a497608c38b2db39a8
3
+ metadata.gz: '088e992126b90dfedd6384a72ef625d2ba88fc512d53c456d6dace2e47113f74'
4
+ data.tar.gz: 56f1c68c346faea122ebfd5883ee23231d773a395ffa12a73992fe7e848ae4f6
5
5
  SHA512:
6
- metadata.gz: 6a4b99d6eb69a794332edbf4dfc3b1466bff0698eb4596222b9c3c8eab5f84f785bc6ac63dacdc20c049cdec2b643cb083bbab7eaa139aab88cfa4e3cdab2f85
7
- data.tar.gz: 767dfddc4f6c6de51b78c29b8dd62671a7838a6dcdf6750db21cdce706c747ddff197a23dbb69696b3d4da4380b2c402e83d517fa298226ebab7a3927d28ac60
6
+ metadata.gz: 0fd7d0ff4b86c5be76e3556b5568ec03eb4dd33f07349945b13ed91fd46766c24cb0251d9abc821519ae2a5e99659e90ce67cda3749564a09a53779acd2478c1
7
+ data.tar.gz: 814eb2de2b847e014cac1115b8c41c40267d13f377afedcaa28443aa08c3dbf3f8b965167e53c360d8061743fb6a95999a3f8b2aea87b5b0d041055c8e23bc99
data/CHANGES.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changes
2
2
 
3
+ ### 2024-10-25 (2.7.4)
4
+
5
+ * Workaround a bug in 3.4.8 and older https://github.com/rubygems/rubygems/pull/6490.
6
+ This bug would cause some gems with native extension to fail during compilation.
7
+ * Workaround different versions of `json` and `json_pure` being loaded (not officially supported).
8
+ * Make `json_pure` Ractor compatible.
9
+
3
10
  ### 2024-10-24 (2.7.3)
4
11
 
5
12
  * Numerous performance optimizations in `JSON.generate` and `JSON.dump` (up to 2 times faster).
data/lib/json/ext.rb CHANGED
@@ -15,9 +15,6 @@ module JSON
15
15
  else
16
16
  require 'json/ext/parser'
17
17
  require 'json/ext/generator'
18
- unless RUBY_ENGINE == 'jruby'
19
- require 'json/ext/generator/state'
20
- end
21
18
  $DEBUG and warn "Using Ext extension for JSON."
22
19
  JSON.parser = Parser
23
20
  JSON.generator = Generator
@@ -148,25 +148,25 @@ module JSON
148
148
  end
149
149
 
150
150
  # Unescape characters in strings.
151
- UNESCAPE_MAP = Hash.new { |h, k| h[k] = k.chr }
152
- UNESCAPE_MAP.update({
153
- ?" => '"',
154
- ?\\ => '\\',
155
- ?/ => '/',
156
- ?b => "\b",
157
- ?f => "\f",
158
- ?n => "\n",
159
- ?r => "\r",
160
- ?t => "\t",
161
- ?u => nil,
162
- })
151
+ UNESCAPE_MAP = {
152
+ '"' => '"',
153
+ '\\' => '\\',
154
+ '/' => '/',
155
+ 'b' => "\b",
156
+ 'f' => "\f",
157
+ 'n' => "\n",
158
+ 'r' => "\r",
159
+ 't' => "\t",
160
+ 'u' => nil,
161
+ }.freeze
163
162
 
164
163
  STR_UMINUS = ''.respond_to?(:-@)
165
164
  def parse_string
166
165
  if scan(STRING)
167
166
  return '' if self[1].empty?
168
- string = self[1].gsub(%r((?:\\[\\bfnrt"/]|(?:\\u(?:[A-Fa-f\d]{4}))+|\\[\x20-\xff]))n) do |c|
169
- if u = UNESCAPE_MAP[$&[1]]
167
+ string = self[1].gsub(%r{(?:\\[\\bfnrt"/]|(?:\\u(?:[A-Fa-f\d]{4}))+|\\[\x20-\xff])}n) do |c|
168
+ k = $&[1]
169
+ if u = UNESCAPE_MAP.fetch(k) { k.chr }
170
170
  u
171
171
  else # \uXXXX
172
172
  bytes = ''.b
data/lib/json/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JSON
4
- VERSION = '2.7.3'
4
+ VERSION = '2.7.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_pure
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.3
4
+ version: 2.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-24 00:00:00.000000000 Z
11
+ date: 2024-10-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a JSON implementation in pure Ruby.
14
14
  email: flori@ping.de