path: root/ext/json
AgeCommit message (Collapse)Author
2021-02-01Fix GC compatibility: Don't stash encodings in global constantsAaron Patterson
This value should either be pinned, or looked up when needed at runtime. Without pinning, the GC may move the encoding object, and that could cause a crash. In this case it is easier to find the value at runtime, and there is no performance penalty (as Ruby caches encoding indexes). We can shorten the code, be compaction friendly, and incur no performance penalty.
2020-12-22Merge json-2.5.1Hiroshi SHIBATA
2020-12-22Prepare to release json-2.5.0Hiroshi SHIBATA
Notes: Merged:
2020-12-21[json] Avoid method redefinitionKenta Murata
2020-12-21[json] Make json Ractor safeKenta Murata
2020-12-21[json] JSON_parse_float: Fix how to convert numberKenta Murata
Stop BigDecimal-specific optimization. Instead, it tries the conversion methods in the following order: 1. `try_convert`, 2. `new`, and 3. class-named function, e.g. `Foo::Bar.Baz` function for `Foo::Bar::Baz` class If all the above candidates are unavailable, it fallbacks to Float.
2020-12-21[json] Make JSON.create_id thread-safeKenta Murata
2020-12-21[json] Stop using prototype objectsKenta Murata
2020-12-17expand VERSION path for ruby repository.Hiroshi SHIBATA
2020-12-17Bump version to json-2.4.1 and use VERSION file for json version same as ↵Hiroshi SHIBATA
2020-12-15Bump version to json-2.4.0Hiroshi SHIBATA
2020-11-10Complex and Rational is embedded classes nowHiroshi SHIBATA
Notes: Merged:
2020-10-20Implement a freeze: parser optionJean Boussier
If set to true all parsed objects will be immediately frozen, and strings will be deduplicated if the Ruby implementation allows it.
2020-09-25[flori/json] Fix JSON.load_file docJean Boussier Notes: Merged:
2020-09-25[flori/json] Partial compliance with doc/method_documentation.rdocBurdetteLamar Notes: Merged:
2020-09-25[flori/json] Enhanced RDoc for JSON.dump (#443)Burdette Lamar
* Enhanced RDoc for JSON.dump Notes: Merged:
2020-09-25bundle the LICENSE file in the gemJulien Feltesse
Notes: Merged:
2020-09-25[flori/json] Nodoc for recurse_procBurdetteLamar Notes: Merged:
2020-09-25[flori/json] RDoc for JSON.load with procBurdetteLamar Notes: Merged:
2020-09-25unify json-java gemspec with the baselineKarol Bucek
Notes: Merged:
2020-09-25[flori/json] RDoc example for JSON.loadBurdetteLamar Notes: Merged:
2020-09-25[flori/json] Enhance RDoc for JSON.parseBurdetteLamar Notes: Merged:
2020-09-25[flori/json] Move options from #generate and #parse to common areaBurdetteLamar Notes: Merged:
2020-09-25[flori/json] Add `load_file` and `load_file!` methods, with tests. Fixes ↵Keith Bennett
issue #386. Notes: Merged:
2020-09-25Add an option to escape forward slash characterJean Boussier
Squashed commit of the following: commit 26d181059989279a79c433cedcd893b4f52e42ee Author: Francois Chagnon <> Date: Tue Sep 15 21:17:34 2015 +0000 add config options for escape_slash commit fa282334051b16df91ca097dd7304b46f3bc7719 Author: Francois Chagnon <> Date: Mon Feb 9 21:09:33 2015 +0000 add forward slash to escape character Notes: Merged:
2020-08-27sed -i '/rmodule.h/d'卜部昌平
Notes: Merged:
2020-08-27sed -i '/r_cast.h/d'卜部昌平
Notes: Merged:
2020-08-27sed -i '\,2/extern.h,d'卜部昌平
Notes: Merged:
2020-07-01Merge json-2.3.1 from flori/jsonHiroshi SHIBATA
2020-07-01[flori/json] Typo fixMarc-Andre Lafortune
2020-07-01[flori/json] Added :call-seq: to RDOc for some methodsBurdetteLamar
2020-07-01[flori/json] Use frozen string for hash keyWatson
When use non-frozen string for hash key with `rb_hash_aset()`, it will duplicate and freeze it internally. To avoid duplicate and freeze, this patch will give a frozen string in `rb_hash_aset()`. ``` Warming up -------------------------------------- json 14.000 i/100ms Calculating ------------------------------------- json 148.844 (± 1.3%) i/s - 756.000 in 5.079969s ``` ``` Warming up -------------------------------------- json 16.000 i/100ms Calculating ------------------------------------- json 165.608 (± 1.8%) i/s - 832.000 in 5.025367s ``` ``` require 'json' require 'securerandom' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { "id": i, "uuid": SecureRandom.uuid, "created_at": } end json = obj.to_json Benchmark.ips do |x| "json" do |iter| count = 0 while count < iter JSON.parse(json) count += 1 end end end ```
2020-07-01[flori/json] RDoc enhancementsBurdetteLamar
2020-07-01[flori/json] RDoc enhancementsBurdetteLamar
2020-07-01[flori/json] RDoc enhancementsBurdetteLamar
2020-07-01[flori/json] Rdoc enhancementsBurdetteLamar
2020-06-25Removed nonsense `rubygems_version` in input gemspec filesNobuyoshi Nakada
As it is ignored and set at building packages automatically, it is just nonsense to set in gemspec file for input.
2020-06-25[flori/json] add metadatanoraj
2020-06-25[flori/json] Gem::Specification#date is set automatically by SHIBATA
2020-06-25[flori/json] keyword argument is provided after Ruby 2.0+Hiroshi SHIBATA
2020-05-14ext/json/parser/ remove type-limit warning if char is unsignedYusuke Endoh
Ragel generates a code `0 <= (*p)` where `*p` is char. As char is unsigned by default on arm and RISC-V, it is warned by gcc: ``` compiling parser.c parser.c: In function ‘JSON_parse_string’: parser.c:1566:2: warning: comparison is always true due to limited range of data type [-Wtype-limits] if ( 0 <= (*p) && (*p) <= 31 ) ^ parser.c:1596:2: warning: comparison is always true due to limited range of data type [-Wtype-limits] if ( 0 <= (*p) && (*p) <= 31 ) ^ ``` This change removes the warning by substituting the condition with `0 <= (signed char)(*p)`.
2020-05-11sed -i 's|ruby/impl|ruby/internal|'卜部昌平
To fix build failures. Notes: Merged:
2020-05-11sed -i s|ruby/3|ruby/impl|g卜部昌平
This shall fix compile errors. Notes: Merged:
2020-04-08Merge pull request #2991 from shyouhei/ruby.h卜部昌平
Split ruby.h Notes: Merged-By: shyouhei <>
2020-01-06[flori/json] Add :nodoc: for GeneratorMethodszverok
2020-01-06[flori/json] Fix examples syntaxzverok
2020-01-06[flori/json] Enchance generic JSON and #generate docszverok
2020-01-06[flori/json] Remove invalid JSON.generate description from JSON module rdocJeremy Evans
This text used to be true in older versions of json, but has not been true for a number of years (since json version 2 I think).
2019-12-12Import json-2.3.0 from flori/jsonHiroshi SHIBATA
2019-11-11Removed duplicate fileNobuyoshi Nakada
"./tests/test_helper.rb" and "tests/test_helper.rb" in `s.files` are same.