Граф коммитов

256 Коммитов

Автор SHA1 Сообщение Дата
Jean Boussier 66b52f046f [flori/json] Stop including the parser source __LINE__ in exceptions
It makes testing for JSON errors very tedious. You either have
to use a Regexp or to regularly update all your assertions
when JSON is upgraded.

https://github.com/flori/json/commit/de9eb1d28e
2022-07-29 19:10:10 +09:00
Florian Frank 9245b28d34
[flori/json] Bump version to 2.6.2
https://github.com/flori/json/commit/5de358f655
2022-05-20 17:49:13 +09:00
Andrew Bromwich a15d0e267a
[flori/json] Fix parser bug for empty string allocation
When `HAVE_RB_ENC_INTERNED_STR` is enabled it is possible to
pass through a null pointer to `rb_enc_interned_str` resulting
in a segfault

Fixes #495

https://github.com/flori/json/commit/b59368a8c2
2022-05-20 17:49:13 +09:00
Hiroshi SHIBATA 767f3904ee
[flori/json] Doc: Improve documentation on JSON#parse and JSON#parse!
https://github.com/flori/json/commit/75ada77b96

Co-authored-by: Bruno Gomes da Silva <brunojabs@gmail.com>
2022-05-20 17:49:13 +09:00
Peter Zhu 2d5ecd60a5 [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
Nobuyoshi Nakada ac152b3cac
Update dependencies 2021-11-21 16:21:18 +09:00
Hiroshi SHIBATA 1be2875e1d
[flori/json] Bump version to v2.6.1
https://github.com/flori/json/commit/2db5894cfa
2021-10-24 09:25:20 +09:00
Josef Šimánek 4cbce79438
[flori/json] Bump JSON::VERSION to 2.6.0.
https://github.com/flori/json/commit/da94d9f059
2021-10-24 09:25:01 +09:00
Hiroshi SHIBATA 91c2069dcf [flori/json] Bump up json version to 2.6.0
https://github.com/flori/json/commit/1942689b67
2021-10-14 17:04:37 +09:00
卜部昌平 5c167a9778 ruby tool/update-deps --fix 2021-10-05 14:18:23 +09:00
Hiroshi SHIBATA a889ab486e
Update the latest version of json.gemspec from flori/json 2021-07-29 15:57:58 +09:00
Nobuyoshi Nakada 1d170fdc6d
ext/json/parser/parser.h: Add fallback MAYBE_UNUSED
e2ad91fc20
2021-05-19 10:16:22 +09:00
Nobuyoshi Nakada 7c716b686c
ext/json/parser/prereq.mk: fix warnings for code generated by ragel
* type-limits when plain-char is unsigned
* unused-const-variable for NFA constants
2021-05-18 23:26:03 +09:00
Hiroshi SHIBATA ee611341c9
Bump version of required_ruby_version to 2.3. Fixes #464 2021-05-17 19:51:51 +09:00
Jean Boussier 2de594ca98
[flori/json] Deduplicate strings inside json_string_unescape
[ci 2]

https://github.com/flori/json/commit/1982070cb8
2021-05-17 19:51:51 +09:00
Jean Boussier 1d2b4ccaf2
[flori/json] Refactor json_string_unescape
https://github.com/flori/json/commit/f398769332
2021-05-17 19:51:50 +09:00
Masafumi Koba 8a974dc83c [flori/json] Fix incorrect `#` position in API doc
This change fixes an incorrect `#` position in the API documentation of the `JSON` module.

https://github.com/flori/json/commit/dc4b62424f
2021-05-17 19:26:03 +09:00
卜部昌平 6413dc27dc dependency updates 2021-04-13 14:30:21 +09:00
Aaron Patterson 8ef30bcc04
Fix GC compatibility: Don't stash encodings in global constants
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.
2021-02-01 12:20:34 -08:00
Hiroshi SHIBATA 034c19ce28
Merge json-2.5.1 2020-12-22 21:51:15 +09:00
Hiroshi SHIBATA edb76e8765 Prepare to release json-2.5.0 2020-12-22 19:44:27 +09:00
Kenta Murata 0b6a80c0be
[json] Avoid method redefinition 2020-12-21 22:41:24 +09:00
Kenta Murata 14d7d1df25
[json] Make json Ractor safe 2020-12-21 22:10:43 +09:00
Kenta Murata 4c2e7f26bd
[json] JSON_parse_float: Fix how to convert number
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 22:10:43 +09:00
Kenta Murata 596da98b3f
[json] Make JSON.create_id thread-safe 2020-12-21 22:10:42 +09:00
Kenta Murata 98cc15ed1e
[json] Stop using prototype objects 2020-12-21 22:10:33 +09:00
Hiroshi SHIBATA a09c3c6fe1
expand VERSION path for ruby repository. 2020-12-17 14:37:45 +09:00
Hiroshi SHIBATA 46ea74297e
Bump version to json-2.4.1 and use VERSION file for json version same as upstream 2020-12-17 14:20:42 +09:00
Hiroshi SHIBATA ad3e3bd65a
Bump version to json-2.4.0 2020-12-15 19:54:58 +09:00
Hiroshi SHIBATA 17e7a819f7 Complex and Rational is embedded classes now 2020-11-10 13:14:42 +09:00
Jean Boussier 520e0916af
Implement a freeze: parser option
If set to true all parsed objects will be
immediately frozen, and strings will be
deduplicated if the Ruby implementation
allows it.
2020-10-20 21:40:25 +09:00
Jean Boussier 927a377a7c [flori/json] Fix JSON.load_file doc
https://github.com/flori/json/commit/cb61a00ba8
2020-09-25 17:28:42 +09:00
BurdetteLamar 038252fe66 [flori/json] Partial compliance with doc/method_documentation.rdoc
https://github.com/flori/json/commit/6dfa885134
2020-09-25 17:28:42 +09:00
Burdette Lamar 71f64e15b9 [flori/json] Enhanced RDoc for JSON.dump (#443)
* Enhanced RDoc for JSON.dump
https://github.com/flori/json/commit/03f1699ec4
2020-09-25 17:28:42 +09:00
Julien Feltesse 3d5e833998 bundle the LICENSE file in the gem 2020-09-25 17:28:42 +09:00
BurdetteLamar de0e0ffad4 [flori/json] Nodoc for recurse_proc
https://github.com/flori/json/commit/f8c0fe2408
2020-09-25 17:28:42 +09:00
BurdetteLamar e9096f796c [flori/json] RDoc for JSON.load with proc
https://github.com/flori/json/commit/a55c91934e
2020-09-25 17:28:42 +09:00
Karol Bucek f8d43e5370 unify json-java gemspec with the baseline 2020-09-25 17:28:42 +09:00
BurdetteLamar 8c057bb845 [flori/json] RDoc example for JSON.load
https://github.com/flori/json/commit/e4eead665c
2020-09-25 17:28:42 +09:00
BurdetteLamar 36b2177ea8 [flori/json] Enhance RDoc for JSON.parse
https://github.com/flori/json/commit/33e64ef255
2020-09-25 17:28:42 +09:00
BurdetteLamar 71b1bbad02 [flori/json] Move options from #generate and #parse to common area
https://github.com/flori/json/commit/20d7be605a
2020-09-25 17:28:42 +09:00
Keith Bennett c3614877d2 [flori/json] Add `load_file` and `load_file!` methods, with tests. Fixes issue #386.
https://github.com/flori/json/commit/0be363c99b
2020-09-25 17:28:42 +09:00
Jean Boussier e1659af372 Add an option to escape forward slash character
Squashed commit of the following:

commit 26d181059989279a79c433cedcd893b4f52e42ee
Author: Francois Chagnon <francois.chagnon@jadedpixel.com>
Date:   Tue Sep 15 21:17:34 2015 +0000

    add config options for escape_slash

commit fa282334051b16df91ca097dd7304b46f3bc7719
Author: Francois Chagnon <francois.chagnon@jadedpixel.com>
Date:   Mon Feb 9 21:09:33 2015 +0000

    add forward slash to escape character
2020-09-25 17:28:42 +09:00
卜部昌平 490010084e sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
卜部昌平 756403d775 sed -i '/r_cast.h/d' 2020-08-27 15:03:36 +09:00
卜部昌平 0da2a3f1fc sed -i '\,2/extern.h,d' 2020-08-27 14:07:49 +09:00
Hiroshi SHIBATA 0aac138e0b
Merge json-2.3.1 from flori/json 2020-07-01 18:50:39 +09:00
Marc-Andre Lafortune 26041da2fb
[flori/json] Typo fix
https://github.com/flori/json/commit/26c1769969
2020-07-01 18:47:51 +09:00
BurdetteLamar d69b55ac05
[flori/json] Added :call-seq: to RDOc for some methods
https://github.com/flori/json/commit/ee5b6a74e9
2020-07-01 18:47:51 +09:00
Watson cb3e62511c
[flori/json] Use frozen string for hash key
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": Time.now
  }
end

json = obj.to_json

Benchmark.ips do |x|
  x.report "json" do |iter|
    count = 0
    while count < iter
      JSON.parse(json)
      count += 1
    end
  end
end
```

https://github.com/flori/json/commit/18292c0c1d
2020-07-01 18:47:51 +09:00