Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | | Merge branch 'zenspider/ruby-2.7' of https://github.com/zenspider/json into ↵ | Hiroshi SHIBATA | 2019-11-29 | 2 | -2/+11 | |
|\ \ \ | | | | | | | | | | | | | zenspider-zenspider/ruby-2.7 | |||||
| * | | | Fix warning from trying to access an uninitialized ivar. | Ryan Davis | 2019-11-27 | 1 | -1/+2 | |
| | | | | | | | | | | | | | | | | Signed-off-by: Ryan Davis <zenspider@chef.io> | |||||
| * | | | Minor cleanup for ruby 2.7 warnings and failures. | Ryan Davis | 2019-11-27 | 2 | -3/+12 | |
| |/ / | ||||||
* | | | Make rb_scan_args handle keywords more similar to Ruby methods (#2460) | Jeremy Evans | 2019-10-31 | 1 | -2/+2 | |
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | |||||
* | | Pass args all #to_json in json/add/*. | Sho Hashimoto | 2019-04-29 | 4 | -8/+8 | |
| | | ||||||
* | | Bump version to 2.2.0 | Florian Frank | 2019-02-21 | 1 | -1/+1 | |
| | | ||||||
* | | Fix a typo. | Sho Hashimoto | 2019-02-21 | 1 | -1/+1 | |
| | | ||||||
* | | JSON marshalling support for Set and SortedSet | Josh Kline | 2017-10-04 | 1 | -0/+29 | |
| | | ||||||
* | | Merge decimal_class patch by Michael Jaschob | Florian Frank | 2016-09-23 | 2 | -2/+6 | |
| | | | | | | | | | | | | Also: - Avoid some issues with bundler - Avoid some issues with jruby | |||||
* | | Correct documentation of OpenStruct.json_create | Kouhei Yanagita | 2016-08-30 | 1 | -1/+1 | |
| | | ||||||
* | | Fix issue #296 when parsing frozen strings | Florian Frank | 2016-07-26 | 1 | -1/+1 | |
| | | ||||||
* | | Bump version to 2.0.1v2.0.1 | Florian Frank | 2016-07-01 | 1 | -1/+1 | |
| | | ||||||
* | | Fix problem when Parser is defined on top level | Florian Frank | 2016-07-01 | 1 | -1/+1 | |
| | | | | | | | | See flori/json#287 | |||||
* | | And stay there | Florian Frank | 2016-06-22 | 1 | -0/+1 | |
| | | ||||||
* | | Fix some merge problems | Florian Frank | 2016-06-21 | 1 | -1/+0 | |
| | | ||||||
* | | Support 1.9 ruby's OpenStruct | Florian Frank | 2016-06-21 | 1 | -0/+8 | |
| | | ||||||
* | | Add frozen_string_literal: false | Nobuyoshi Nakada | 2016-06-21 | 19 | -0/+19 | |
| | | | | | | | | When you change this to true, you may need to add more tests. | |||||
* | | Remove useless methods | Nobuyoshi Nakada | 2016-06-21 | 1 | -8/+0 | |
| | | | | | | | | | | Remove useless overriding methods, [] and []=, which are same as OpenStruct. | |||||
* | | Append newline at EOF | Nobuyoshi Nakada | 2016-06-21 | 1 | -1/+1 | |
| | | ||||||
* | | Merge pull request #283 from stomar/remove-comments | Florian Frank | 2016-06-07 | 9 | -9/+0 | |
|\ \ | | | | | | | Remove comments from core classes in json/add | |||||
| * | | Remove comments from core classes in json/add | Marcus Stollsteimer | 2016-04-25 | 9 | -9/+0 | |
| | | | ||||||
* | | | Move simplecov to test_helper.rb | Florian Frank | 2016-06-03 | 2 | -14/+2 | |
| | | | ||||||
* | | | Treat ASCII_8BIT as UTF-8 by default | Florian Frank | 2016-06-03 | 1 | -2/+4 | |
| | | | ||||||
* | | | Only support newer Rubies e. g. Encoding | Florian Frank | 2016-06-03 | 1 | -101/+47 | |
| | | | ||||||
* | | | Test common interface | Florian Frank | 2016-06-03 | 1 | -14/+4 | |
| | | | ||||||
* | | | Use better name for this feature | Florian Frank | 2016-06-02 | 1 | -4/+4 | |
| | | | ||||||
* | | | Remove quirks mode | Florian Frank | 2016-06-02 | 3 | -31/+7 | |
| | | | ||||||
* | | | Change rfc reference | Florian Frank | 2016-06-02 | 2 | -24/+6 | |
|/ / | ||||||
* | | Merge branch 'v1.8' | Florian Frank | 2016-02-25 | 1 | -2/+10 | |
|\ \ | ||||||
| * | | Check for existence of #to_json method before call | Florian Frank | 2016-02-25 | 1 | -2/+10 | |
| | | | ||||||
| * | | Skip 1.8.4 | Florian Frank | 2015-10-20 | 1 | -1/+1 | |
| | | | ||||||
| * | | Bump version to 1.8.4 and add to CHANGES | Florian Frank | 2015-09-11 | 1 | -1/+1 | |
| | | | ||||||
* | | | Disallow usage of symbolize_names and create_additions | Florian Frank | 2015-06-15 | 1 | -2/+6 | |
| | | | ||||||
* | | | Refactor tests and make pure parser green | Florian Frank | 2015-06-15 | 3 | -45/+28 | |
| | | | ||||||
* | | | Remove generate restriction for […]/{…} | Florian Frank | 2015-06-13 | 1 | -7/+0 | |
| | | | ||||||
* | | | Remove byte sniffing from Pure::Parser | Florian Frank | 2015-06-13 | 1 | -33/+1 | |
| | | | ||||||
* | | | Move common setup into test_helper.rb | Florian Frank | 2015-06-13 | 1 | -2/+3 | |
|/ / | ||||||
* | | Bump version to 1.8.3v1.8.3 | Florian Frank | 2015-06-01 | 1 | -1/+1 | |
| | | ||||||
* | | Bump version number to 1.8.2 | Florian Frank | 2015-01-09 | 1 | -1/+1 | |
| | | ||||||
* | | Merge branch 'master' into zzak-ruby-2.2 | Florian Frank | 2015-01-02 | 4 | -6/+17 | |
|\ \ | ||||||
| * | | Don't mutate JSON.dump_default_options from dump | Jason R. Clark | 2015-01-02 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | | | | | | | The use of Hash#update from the JSON.dump method was mutating the dump_default_options hash on any call to dump with a limit provided. An individual method call with an overriding value shouldn't update the defaults in this way. | |||||
| * | | Reindented | Florian Frank | 2015-01-02 | 1 | -7/+6 | |
| | | | ||||||
| * | | Document `Rational` json generation methods. | Vipul A M | 2015-01-02 | 1 | -4/+10 | |
| | | | ||||||
| * | | Document `Complex` json generation methods. | Vipul A M | 2015-01-02 | 1 | -1/+7 | |
| | | | ||||||
| * | | Use method_defined? to check if method exists instead of slower check on ↵ | Vipul A M | 2015-01-02 | 1 | -1/+1 | |
| | | | | | | | | | | | | instance_methods | |||||
| * | | Change documentation to reflect new default value | Florian Frank | 2015-01-02 | 1 | -2/+2 | |
| | | | ||||||
| * | | Fix typo in comment | Ignacio Galindo | 2015-01-02 | 1 | -1/+1 | |
| | | | ||||||
* | | | Sync with trunk | Zachary Scott | 2014-12-25 | 4 | -18/+7 | |
| | | | ||||||
* | | | Don't mutate JSON.dump_default_options from dump | Jason R. Clark | 2014-09-19 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | | | | | | | The use of Hash#update from the JSON.dump method was mutating the dump_default_options hash on any call to dump with a limit provided. An individual method call with an overriding value shouldn't update the defaults in this way. | |||||
* | | | Reindented | Florian Frank | 2014-07-03 | 1 | -7/+6 | |
| | | |