Commit graph

92 commits

Author SHA1 Message Date
Florian Frank
9245b28d34
[flori/json] Bump version to 2.6.2
5de358f655
2022-05-20 17:49:13 +09:00
Hiroshi SHIBATA
1be2875e1d
[flori/json] Bump version to v2.6.1
2db5894cfa
2021-10-24 09:25:20 +09:00
Josef Šimánek
4cbce79438
[flori/json] Bump JSON::VERSION to 2.6.0.
da94d9f059
2021-10-24 09:25:01 +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.

dc4b62424f
2021-05-17 19:26:03 +09: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
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
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
17e7a819f7 Complex and Rational is embedded classes now 2020-11-10 13:14:42 +09:00
Jean Boussier
927a377a7c [flori/json] Fix JSON.load_file doc
cb61a00ba8
2020-09-25 17:28:42 +09:00
BurdetteLamar
038252fe66 [flori/json] Partial compliance with doc/method_documentation.rdoc
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
03f1699ec4
2020-09-25 17:28:42 +09:00
BurdetteLamar
de0e0ffad4 [flori/json] Nodoc for recurse_proc
f8c0fe2408
2020-09-25 17:28:42 +09:00
BurdetteLamar
e9096f796c [flori/json] RDoc for JSON.load with proc
a55c91934e
2020-09-25 17:28:42 +09:00
BurdetteLamar
8c057bb845 [flori/json] RDoc example for JSON.load
e4eead665c
2020-09-25 17:28:42 +09:00
BurdetteLamar
36b2177ea8 [flori/json] Enhance RDoc for JSON.parse
33e64ef255
2020-09-25 17:28:42 +09:00
BurdetteLamar
71b1bbad02 [flori/json] Move options from #generate and #parse to common area
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.
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
Hiroshi SHIBATA
0aac138e0b
Merge json-2.3.1 from flori/json 2020-07-01 18:50:39 +09:00
BurdetteLamar
d69b55ac05
[flori/json] Added :call-seq: to RDOc for some methods
ee5b6a74e9
2020-07-01 18:47:51 +09:00
BurdetteLamar
7d8ce96de6
[flori/json] RDoc enhancements
ada48f0236
2020-07-01 18:47:51 +09:00
BurdetteLamar
be6447381c
[flori/json] RDoc enhancements
470d909c0d
2020-07-01 18:47:51 +09:00
BurdetteLamar
99980b3034
[flori/json] RDoc enhancements
7bee2c7c13
2020-07-01 18:47:51 +09:00
BurdetteLamar
4689fd5f99
[flori/json] Rdoc enhancements
e7e3732130
2020-07-01 18:47:50 +09:00
zverok
41ef6df8c9 [flori/json] Fix examples syntax
3845491d92
2020-01-06 15:13:35 +09:00
zverok
2e5ef30cb9 [flori/json] Enchance generic JSON and #generate docs
4ede0a7d19
2020-01-06 15:13:15 +09:00
Jeremy Evans
1658e6b5db
[flori/json] Remove invalid JSON.generate description from JSON module rdoc
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).

373b633f38
2020-01-06 15:09:55 +09:00
Hiroshi SHIBATA
53e8589c69
Import json-2.3.0 from flori/json 2019-12-12 09:14:09 +09:00
Sho Hashimoto
d9e50fcbeb
[flori/json] Pass args all #to_json in json/add/*.
36a7ef6790
2019-10-14 19:54:48 +09:00
Jeremy Evans
80b5a0ff2a
Make rb_scan_args handle keywords more similar to Ruby methods (#2460)
Cfuncs that use rb_scan_args with the : entry suffer similar keyword
argument separation issues that Ruby methods suffer if the cfuncs
accept optional or variable arguments.

This makes the following changes to : handling.

* Treats as **kw, prompting keyword argument separation warnings
  if called with a positional hash.

* Do not look for an option hash if empty keywords are provided.
  For backwards compatibility, treat an empty keyword splat as a empty
  mandatory positional hash argument, but emit a a warning, as this
  behavior will be removed in Ruby 3.  The argument number check
  needs to be moved lower so it can correctly handle an empty
  positional argument being added.

* If the last argument is nil and it is necessary to treat it as an option
  hash in order to make sure all arguments are processed, continue to
  treat the last argument as the option hash. Emit a warning in this case,
  as this behavior will be removed in Ruby 3.

* If splitting the keyword hash into two hashes, issue a warning, as we
  will not be splitting hashes in Ruby 3.

* If the keyword argument is required to fill a mandatory positional
  argument, continue to do so, but emit a warning as this behavior will
  be going away in Ruby 3.

* If keyword arguments are provided and the last argument is not a hash,
  that indicates something wrong. This can happen if a cfunc is calling
  rb_scan_args multiple times, and providing arguments that were not
  passed to it from Ruby.  Callers need to switch to the new
  rb_scan_args_kw function, which allows passing of whether keywords
  were provided.

This commit fixes all warnings caused by the changes above.

It switches some function calls to *_kw versions with appropriate
kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS
is used.  If creating new arguments, RB_PASS_KEYWORDS is used if
the last argument is a hash to be treated as keywords.

In open_key_args in io.c, use rb_scan_args_kw.
In this case, the arguments provided come from another C
function, not Ruby.  The last argument may or may not be a hash,
so we can't set keyword argument mode.  However, if it is a
hash, we don't want to warn when treating it as keywords.

In Ruby files, make sure to appropriately use keyword splats
or literal keywords when calling Cfuncs that now issue keyword
argument separation warnings through rb_scan_args.  Also, make
sure not to pass nil in place of an option hash.

Work around Kernel#warn warnings due to problems in the Rubygems
override of the method.  There is an open pull request to fix
these issues in Rubygems, but part of the Rubygems tests for
their override fail on ruby-head due to rb_scan_args not
recognizing empty keyword splats, which this commit fixes.

Implementation wise, adding rb_scan_args_kw is kind of a pain,
because rb_scan_args takes a variable number of arguments.
In order to not duplicate all the code, the function internals need
to be split into two functions taking a va_list, and to avoid passing
in a ton of arguments, a single struct argument is used to handle
the variables previously local to the function.
2019-09-25 11:18:49 -07:00
hsbt
6604e1b7cd Merge json-2.2.0 from flori/json.
https://github.com/flori/json/releases/tag/v2.2.0

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-23 03:43:58 +00:00
hsbt
b304078ae6 Merge json-2.1.0 from https://github.com/flori/json
https://github.com/flori/json/blob/master/CHANGES.md#2017-04-18-210

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-16 03:04:46 +00:00
hsbt
83735ba29a Merge json-2.0.4.
* https://github.com/flori/json/releases/tag/v2.0.4
  * 09fabeb03e/CHANGES.md (2017-03-23-204)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-12 00:21:18 +00:00
nobu
c2d77880c0 Fix rdoc of OpenStruct.json_create [ci skip]
* ext/json/lib/json/add/ostruct.rb (OpenStruct.json_create):
  Correct documentation, fix the name of values.  [Fix GH-1421]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-30 06:27:29 +00:00
hsbt
11a94f2a36 * ext/json/*, test/json/json_parser_test.rb: Update json-2.0.2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-01 03:16:30 +00:00
nobu
6c1f4f7eba json/ext: remove stale directory
* ext/json/lib/json/ext: remove stale directory.  bundled
  extension libraries are placed under the directory for each
  architectures, but not mixed with plain text script libraries.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-14 04:10:56 +00:00
svn
a9acbeed78 * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-14 03:48:55 +00:00
hsbt
bf7cc652ae * ext/json/**/*.rb: merge original files from upstream repository.
It only fixes styles of frozen string literal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-14 03:48:54 +00:00
svn
3345322572 * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-05 11:49:40 +00:00
hsbt
1130658738 * ext/json/*, test/json/*: Update json-2.0.1.
Changes of 2.0.0: f679ebd0c6/CHANGES.md (2015-09-11-200)
  Changes of 2.0.1: f679ebd0c6/CHANGES.md (2016-07-01-201)
  [Feature #12542][ruby-dev:49706][fix GH-1395]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-05 11:49:39 +00:00
hsbt
3261d3f3cc * ext/json/lib/*.rb: Removed some comments. Because these are unnecessary
class description. [ci skip][Bug #12255][ruby-core:74835]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-11 09:38:04 +00:00
naruse
c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
hsbt
1f1e3d1297 * ext/json/json.gemspec: bump version to json 1.8.3. CRuby already contained
upstream changes.
  4d059bf9f5
  d4c99de789
* ext/json/lib/json/version.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-05 23:40:24 +00:00
hsbt
1bc5669857 * ext/json/json.gemspec: bump version to 1.8.2.
* ext/json/lib/json/version.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 09:40:11 +00:00
hsbt
2e4f0af00f * ext/json/*, test/json/*: Reverted r50231. Because it's not works with
cross-compile environment.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 08:36:37 +00:00
hsbt
cfaddc2a32 * ext/json/*, test/json/*, defs/default_gems: Gemify JSON library.
[fix GH-867][Feature #11057]
* test/ruby/test_extlibs.rb: removed json gem from existence extentions.
* gems/bundled_gems: added json gem into bundled gem.
* lib/rdoc/rubygems_hook.rb: ignored no json environment.
* lib/rubygems/test_case.rb, test/rubygems/*: ditto.
* lib/rdoc/test_case.rb, test/rdoc/*: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-11 11:14:36 +00:00
nobu
c0ee6f2af9 generic_object.rb: useless methods
* ext/json/lib/json/generic_object.rb (JSON::GenericObject):
  remove useless overriding methods, [] and []=.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-06 05:32:41 +00:00