vrpayment-ruby-sdk 5.1.0 → 5.2.0
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 +4 -4
- data/Gemfile.lock +5 -5
- data/lib/vrpayment-ruby-sdk/api/charge_flow_service_api.rb +1 -1
- data/lib/vrpayment-ruby-sdk/api/human_user_service_api.rb +1 -1
- data/lib/vrpayment-ruby-sdk/api/subscription_suspension_service_api.rb +8 -18
- data/lib/vrpayment-ruby-sdk/api/transaction_iframe_service_api.rb +1 -1
- data/lib/vrpayment-ruby-sdk/api/transaction_lightbox_service_api.rb +1 -1
- data/lib/vrpayment-ruby-sdk/api/transaction_mobile_sdk_service_api.rb +1 -1
- data/lib/vrpayment-ruby-sdk/api/transaction_payment_page_service_api.rb +1 -1
- data/lib/vrpayment-ruby-sdk/api/transaction_service_api.rb +1 -1
- data/lib/vrpayment-ruby-sdk/api_client.rb +1 -1
- data/lib/vrpayment-ruby-sdk/models/abstract_payment_link_update.rb +13 -1
- data/lib/vrpayment-ruby-sdk/models/pan_type.rb +1 -0
- data/lib/vrpayment-ruby-sdk/models/payment_link.rb +13 -1
- data/lib/vrpayment-ruby-sdk/models/payment_link_active.rb +13 -1
- data/lib/vrpayment-ruby-sdk/models/payment_link_create.rb +13 -1
- data/lib/vrpayment-ruby-sdk/models/payment_link_update.rb +13 -1
- data/lib/vrpayment-ruby-sdk/models/scope.rb +51 -1
- data/lib/vrpayment-ruby-sdk/models/wallet_type.rb +34 -4
- data/lib/vrpayment-ruby-sdk/version.rb +1 -1
- data/vendor/bundle/ruby/3.3.0/cache/ethon-0.15.0.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/json-2.15.1.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/typhoeus-1.5.0.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/{json-2.13.0 → json-2.15.1}/gem_make.out +10 -10
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.15.1/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.15.1/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/{json-2.13.0 → json-2.15.1}/mkmf.log +11 -10
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/.github/workflows/ruby.yml +2 -2
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/CHANGELOG.md +0 -3
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/README.md +0 -23
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curls/classes.rb +2 -12
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curls/options.rb +3 -4
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/callbacks.rb +1 -2
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/informations.rb +0 -3
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/response_callbacks.rb +1 -6
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/version.rb +1 -1
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/callbacks_spec.rb +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/informations_spec.rb +0 -6
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/mirror_spec.rb +1 -1
- data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/operations_spec.rb +0 -3
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/CHANGES.md +50 -9
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/README.md +3 -1
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/fbuffer/fbuffer.h +31 -5
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/generator/generator.c +134 -104
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/parser/parser.c +58 -8
- data/vendor/bundle/ruby/3.3.0/gems/json-2.15.1/ext/json/ext/simd/conf.rb +24 -0
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/simd/simd.h +47 -46
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/vendor/fpconv.c +12 -11
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/core.rb +1 -0
- data/vendor/bundle/ruby/3.3.0/gems/json-2.15.1/lib/json/add/string.rb +35 -0
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/common.rb +49 -23
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/ext/generator/state.rb +7 -14
- data/vendor/bundle/ruby/3.3.0/gems/json-2.15.1/lib/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/json-2.15.1/lib/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/generic_object.rb +0 -8
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/truffle_ruby/generator.rb +63 -45
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/version.rb +1 -1
- data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json.rb +23 -1
- data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/CHANGELOG.md +43 -1
- data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/expectation.rb +4 -2
- data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/responseable.rb +1 -1
- data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/version.rb +1 -1
- data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/typhoeus.gemspec +14 -4
- data/vendor/bundle/ruby/3.3.0/specifications/{ethon-0.16.0.gemspec → ethon-0.15.0.gemspec} +3 -3
- data/vendor/bundle/ruby/3.3.0/specifications/{json-2.13.0.gemspec → json-2.15.1.gemspec} +0 -0
- data/vendor/bundle/ruby/3.3.0/specifications/{typhoeus-1.4.1.gemspec → typhoeus-1.5.0.gemspec} +7 -5
- metadata +205 -252
- data/vendor/bundle/ruby/3.3.0/cache/ethon-0.16.0.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/json-2.13.0.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/cache/typhoeus-1.4.1.gem +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.13.0/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.13.0/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/json-2.13.0/ext/json/ext/simd/conf.rb +0 -20
- data/vendor/bundle/ruby/3.3.0/gems/json-2.13.0/lib/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/json-2.13.0/lib/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.github/workflows/ci.yml +0 -30
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.github/workflows/experimental.yml +0 -33
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.gitignore +0 -8
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.rspec +0 -4
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Gemfile +0 -36
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Guardfile +0 -9
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Rakefile +0 -38
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/perf/profile.rb +0 -14
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/perf/vs_nethttp.rb +0 -64
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/rack/typhoeus/middleware/params_decoder/helper_spec.rb +0 -156
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/rack/typhoeus/middleware/params_decoder_spec.rb +0 -31
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/spec_helper.rb +0 -29
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/localhost_server.rb +0 -94
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/memory_cache.rb +0 -15
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/server.rb +0 -116
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/adapters/faraday_spec.rb +0 -339
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/cache/dalli_spec.rb +0 -41
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/cache/redis_spec.rb +0 -41
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/config_spec.rb +0 -15
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/easy_factory_spec.rb +0 -143
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/errors/no_stub_spec.rb +0 -13
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/expectation_spec.rb +0 -280
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/addable_spec.rb +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/before_spec.rb +0 -98
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/block_connection_spec.rb +0 -18
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/cacheable_spec.rb +0 -88
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/memoizable_spec.rb +0 -53
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/queueable_spec.rb +0 -98
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/runnable_spec.rb +0 -137
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/stubbable_spec.rb +0 -48
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra_spec.rb +0 -22
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/pool_spec.rb +0 -137
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/actions_spec.rb +0 -19
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/before_spec.rb +0 -93
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/block_connection_spec.rb +0 -75
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/cacheable_spec.rb +0 -94
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/callbacks_spec.rb +0 -91
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/marshal_spec.rb +0 -60
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/memoizable_spec.rb +0 -34
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/operations_spec.rb +0 -101
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/responseable_spec.rb +0 -13
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/stubbable_spec.rb +0 -45
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request_spec.rb +0 -256
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/header_spec.rb +0 -147
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/informations_spec.rb +0 -323
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/status_spec.rb +0 -256
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response_spec.rb +0 -100
- data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus_spec.rb +0 -105
- /data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/{json-2.13.0 → json-2.15.1}/gem.build_complete +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/.gitignore +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/.rspec +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/Gemfile +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/Guardfile +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/LICENSE +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/Rakefile +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/ethon.gemspec +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curl.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curls/codes.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curls/constants.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curls/form_options.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curls/functions.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curls/infos.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curls/messages.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/curls/settings.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/debug_info.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/features.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/form.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/header.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/actionable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/custom.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/delete.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/get.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/head.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/options.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/patch.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/post.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/postable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/put.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http/putable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/http.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/mirror.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/operations.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/options.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/params.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/queryable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy/util.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/easy.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors/ethon_error.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors/global_init.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors/invalid_option.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors/invalid_value.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors/multi_add.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors/multi_fdset.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors/multi_remove.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors/multi_timeout.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors/select.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/errors.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/libc.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/loggable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/multi/operations.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/multi/options.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/multi/stack.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon/multi.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/lib/ethon.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/profile/benchmarks.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/profile/memory_leaks.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/profile/perf_spec_helper.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/profile/support/memory_test_helpers.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/profile/support/os_memory_leak_tracker.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/profile/support/ruby_object_leak_tracker.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/curl_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/debug_info_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/features_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/form_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/header_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/http/custom_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/http/delete_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/http/get_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/http/head_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/http/options_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/http/patch_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/http/post_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/http/put_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/http_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/options_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/queryable_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/response_callbacks_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy/util_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/easy_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/libc_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/loggable_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/multi/operations_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/multi/options_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/multi/stack_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/ethon/multi_spec.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/spec_helper.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/support/localhost_server.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.16.0 → ethon-0.15.0}/spec/support/server.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/LEGAL +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/generator/Makefile +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/generator/extconf.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/parser/Makefile +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/parser/extconf.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/vendor/jeaiii-ltoa.h +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/json.gemspec +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/bigdecimal.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/complex.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/date.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/date_time.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/exception.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/ostruct.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/range.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/rational.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/regexp.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/set.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/struct.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/symbol.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/add/time.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/lib/json/ext.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/CONTRIBUTING.md +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/LICENSE +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/UPGRADE.md +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/rack/typhoeus/middleware/params_decoder/helper.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/rack/typhoeus/middleware/params_decoder.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/rack/typhoeus.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/adapters/faraday.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/cache/dalli.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/cache/rails.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/cache/redis.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/config.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/easy_factory.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/errors/no_stub.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/errors/typhoeus_error.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/errors.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/addable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/before.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/block_connection.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/cacheable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/memoizable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/queueable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/runnable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/stubbable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/pool.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/railtie.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/actions.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/before.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/block_connection.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/cacheable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/callbacks.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/marshal.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/memoizable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/operations.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/streamable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/stubbable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response/cacheable.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response/header.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response/informations.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response/status.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response.rb +0 -0
- /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus.rb +0 -0
data/vendor/bundle/ruby/3.3.0/gems/{json-2.13.0 → json-2.15.1}/ext/json/ext/generator/generator.c
RENAMED
@@ -9,6 +9,12 @@
|
|
9
9
|
|
10
10
|
/* ruby api and some helpers */
|
11
11
|
|
12
|
+
enum duplicate_key_action {
|
13
|
+
JSON_DEPRECATED = 0,
|
14
|
+
JSON_IGNORE,
|
15
|
+
JSON_RAISE,
|
16
|
+
};
|
17
|
+
|
12
18
|
typedef struct JSON_Generator_StateStruct {
|
13
19
|
VALUE indent;
|
14
20
|
VALUE space;
|
@@ -21,6 +27,9 @@ typedef struct JSON_Generator_StateStruct {
|
|
21
27
|
long depth;
|
22
28
|
long buffer_initial_length;
|
23
29
|
|
30
|
+
enum duplicate_key_action on_duplicate_key;
|
31
|
+
|
32
|
+
bool as_json_single_arg;
|
24
33
|
bool allow_nan;
|
25
34
|
bool ascii_only;
|
26
35
|
bool script_safe;
|
@@ -31,10 +40,10 @@ typedef struct JSON_Generator_StateStruct {
|
|
31
40
|
#define RB_UNLIKELY(cond) (cond)
|
32
41
|
#endif
|
33
42
|
|
34
|
-
static VALUE mJSON, cState, cFragment,
|
43
|
+
static VALUE mJSON, cState, cFragment, eGeneratorError, eNestingError, Encoding_UTF_8;
|
35
44
|
|
36
45
|
static ID i_to_s, i_to_json, i_new, i_pack, i_unpack, i_create_id, i_extend, i_encode;
|
37
|
-
static VALUE sym_indent, sym_space, sym_space_before, sym_object_nl, sym_array_nl, sym_max_nesting, sym_allow_nan,
|
46
|
+
static VALUE sym_indent, sym_space, sym_space_before, sym_object_nl, sym_array_nl, sym_max_nesting, sym_allow_nan, sym_allow_duplicate_key,
|
38
47
|
sym_ascii_only, sym_depth, sym_buffer_initial_length, sym_script_safe, sym_escape_slash, sym_strict, sym_as_json;
|
39
48
|
|
40
49
|
|
@@ -137,8 +146,8 @@ static inline FORCE_INLINE void search_flush(search_state *search)
|
|
137
146
|
{
|
138
147
|
// Do not remove this conditional without profiling, specifically escape-heavy text.
|
139
148
|
// escape_UTF8_char_basic will advance search->ptr and search->cursor (effectively a search_flush).
|
140
|
-
// For back-to-back characters that need to be escaped,
|
141
|
-
// will be called just before calling escape_UTF8_char_basic. There will be no
|
149
|
+
// For back-to-back characters that need to be escaped, specifically for the SIMD code paths, this method
|
150
|
+
// will be called just before calling escape_UTF8_char_basic. There will be no characters to append for the
|
142
151
|
// consecutive characters that need to be escaped. While the fbuffer_append is a no-op if
|
143
152
|
// nothing needs to be flushed, we can save a few memory references with this conditional.
|
144
153
|
if (search->ptr > search->cursor) {
|
@@ -835,18 +844,6 @@ static VALUE mFloat_to_json(int argc, VALUE *argv, VALUE self)
|
|
835
844
|
return cState_partial_generate(Vstate, self, generate_json_float, Qfalse);
|
836
845
|
}
|
837
846
|
|
838
|
-
/*
|
839
|
-
* call-seq: String.included(modul)
|
840
|
-
*
|
841
|
-
* Extends _modul_ with the String::Extend module.
|
842
|
-
*/
|
843
|
-
static VALUE mString_included_s(VALUE self, VALUE modul)
|
844
|
-
{
|
845
|
-
VALUE result = rb_funcall(modul, i_extend, 1, mString_Extend);
|
846
|
-
rb_call_super(1, &modul);
|
847
|
-
return result;
|
848
|
-
}
|
849
|
-
|
850
847
|
/*
|
851
848
|
* call-seq: to_json(*)
|
852
849
|
*
|
@@ -861,51 +858,6 @@ static VALUE mString_to_json(int argc, VALUE *argv, VALUE self)
|
|
861
858
|
return cState_partial_generate(Vstate, self, generate_json_string, Qfalse);
|
862
859
|
}
|
863
860
|
|
864
|
-
/*
|
865
|
-
* call-seq: to_json_raw_object()
|
866
|
-
*
|
867
|
-
* This method creates a raw object hash, that can be nested into
|
868
|
-
* other data structures and will be generated as a raw string. This
|
869
|
-
* method should be used, if you want to convert raw strings to JSON
|
870
|
-
* instead of UTF-8 strings, e. g. binary data.
|
871
|
-
*/
|
872
|
-
static VALUE mString_to_json_raw_object(VALUE self)
|
873
|
-
{
|
874
|
-
VALUE ary;
|
875
|
-
VALUE result = rb_hash_new();
|
876
|
-
rb_hash_aset(result, rb_funcall(mJSON, i_create_id, 0), rb_class_name(rb_obj_class(self)));
|
877
|
-
ary = rb_funcall(self, i_unpack, 1, rb_str_new2("C*"));
|
878
|
-
rb_hash_aset(result, rb_utf8_str_new_lit("raw"), ary);
|
879
|
-
return result;
|
880
|
-
}
|
881
|
-
|
882
|
-
/*
|
883
|
-
* call-seq: to_json_raw(*args)
|
884
|
-
*
|
885
|
-
* This method creates a JSON text from the result of a call to
|
886
|
-
* to_json_raw_object of this String.
|
887
|
-
*/
|
888
|
-
static VALUE mString_to_json_raw(int argc, VALUE *argv, VALUE self)
|
889
|
-
{
|
890
|
-
VALUE obj = mString_to_json_raw_object(self);
|
891
|
-
Check_Type(obj, T_HASH);
|
892
|
-
return mHash_to_json(argc, argv, obj);
|
893
|
-
}
|
894
|
-
|
895
|
-
/*
|
896
|
-
* call-seq: json_create(o)
|
897
|
-
*
|
898
|
-
* Raw Strings are JSON Objects (the raw bytes are stored in an array for the
|
899
|
-
* key "raw"). The Ruby String can be created by this module method.
|
900
|
-
*/
|
901
|
-
static VALUE mString_Extend_json_create(VALUE self, VALUE o)
|
902
|
-
{
|
903
|
-
VALUE ary;
|
904
|
-
Check_Type(o, T_HASH);
|
905
|
-
ary = rb_hash_aref(o, rb_str_new2("raw"));
|
906
|
-
return rb_funcall(ary, i_pack, 1, rb_str_new2("C*"));
|
907
|
-
}
|
908
|
-
|
909
861
|
/*
|
910
862
|
* call-seq: to_json(*)
|
911
863
|
*
|
@@ -1044,8 +996,11 @@ static inline VALUE vstate_get(struct generate_json_data *data)
|
|
1044
996
|
}
|
1045
997
|
|
1046
998
|
struct hash_foreach_arg {
|
999
|
+
VALUE hash;
|
1047
1000
|
struct generate_json_data *data;
|
1048
|
-
int
|
1001
|
+
int first_key_type;
|
1002
|
+
bool first;
|
1003
|
+
bool mixed_keys_encountered;
|
1049
1004
|
};
|
1050
1005
|
|
1051
1006
|
static VALUE
|
@@ -1063,6 +1018,29 @@ convert_string_subclass(VALUE key)
|
|
1063
1018
|
return key_to_s;
|
1064
1019
|
}
|
1065
1020
|
|
1021
|
+
NOINLINE()
|
1022
|
+
static void
|
1023
|
+
json_inspect_hash_with_mixed_keys(struct hash_foreach_arg *arg)
|
1024
|
+
{
|
1025
|
+
if (arg->mixed_keys_encountered) {
|
1026
|
+
return;
|
1027
|
+
}
|
1028
|
+
arg->mixed_keys_encountered = true;
|
1029
|
+
|
1030
|
+
JSON_Generator_State *state = arg->data->state;
|
1031
|
+
if (state->on_duplicate_key != JSON_IGNORE) {
|
1032
|
+
VALUE do_raise = state->on_duplicate_key == JSON_RAISE ? Qtrue : Qfalse;
|
1033
|
+
rb_funcall(mJSON, rb_intern("on_mixed_keys_hash"), 2, arg->hash, do_raise);
|
1034
|
+
}
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
static VALUE
|
1038
|
+
json_call_as_json(JSON_Generator_State *state, VALUE object, VALUE is_key)
|
1039
|
+
{
|
1040
|
+
VALUE proc_args[2] = {object, is_key};
|
1041
|
+
return rb_proc_call_with_block(state->as_json, 2, proc_args, Qnil);
|
1042
|
+
}
|
1043
|
+
|
1066
1044
|
static int
|
1067
1045
|
json_object_i(VALUE key, VALUE val, VALUE _arg)
|
1068
1046
|
{
|
@@ -1073,21 +1051,33 @@ json_object_i(VALUE key, VALUE val, VALUE _arg)
|
|
1073
1051
|
JSON_Generator_State *state = data->state;
|
1074
1052
|
|
1075
1053
|
long depth = state->depth;
|
1076
|
-
int
|
1054
|
+
int key_type = rb_type(key);
|
1055
|
+
|
1056
|
+
if (arg->first) {
|
1057
|
+
arg->first = false;
|
1058
|
+
arg->first_key_type = key_type;
|
1059
|
+
}
|
1060
|
+
else {
|
1061
|
+
fbuffer_append_char(buffer, ',');
|
1062
|
+
}
|
1077
1063
|
|
1078
|
-
if (arg->iter > 0) fbuffer_append_char(buffer, ',');
|
1079
1064
|
if (RB_UNLIKELY(data->state->object_nl)) {
|
1080
1065
|
fbuffer_append_str(buffer, data->state->object_nl);
|
1081
1066
|
}
|
1082
1067
|
if (RB_UNLIKELY(data->state->indent)) {
|
1083
|
-
|
1084
|
-
fbuffer_append_str(buffer, data->state->indent);
|
1085
|
-
}
|
1068
|
+
fbuffer_append_str_repeat(buffer, data->state->indent, depth);
|
1086
1069
|
}
|
1087
1070
|
|
1088
1071
|
VALUE key_to_s;
|
1089
|
-
|
1072
|
+
bool as_json_called = false;
|
1073
|
+
|
1074
|
+
start:
|
1075
|
+
switch (key_type) {
|
1090
1076
|
case T_STRING:
|
1077
|
+
if (RB_UNLIKELY(arg->first_key_type != T_STRING)) {
|
1078
|
+
json_inspect_hash_with_mixed_keys(arg);
|
1079
|
+
}
|
1080
|
+
|
1091
1081
|
if (RB_LIKELY(RBASIC_CLASS(key) == rb_cString)) {
|
1092
1082
|
key_to_s = key;
|
1093
1083
|
} else {
|
@@ -1095,9 +1085,23 @@ json_object_i(VALUE key, VALUE val, VALUE _arg)
|
|
1095
1085
|
}
|
1096
1086
|
break;
|
1097
1087
|
case T_SYMBOL:
|
1088
|
+
if (RB_UNLIKELY(arg->first_key_type != T_SYMBOL)) {
|
1089
|
+
json_inspect_hash_with_mixed_keys(arg);
|
1090
|
+
}
|
1091
|
+
|
1098
1092
|
key_to_s = rb_sym2str(key);
|
1099
1093
|
break;
|
1100
1094
|
default:
|
1095
|
+
if (data->state->strict) {
|
1096
|
+
if (RTEST(data->state->as_json) && !as_json_called) {
|
1097
|
+
key = json_call_as_json(data->state, key, Qtrue);
|
1098
|
+
key_type = rb_type(key);
|
1099
|
+
as_json_called = true;
|
1100
|
+
goto start;
|
1101
|
+
} else {
|
1102
|
+
raise_generator_error(key, "%"PRIsVALUE" not allowed as object key in JSON", CLASS_OF(key));
|
1103
|
+
}
|
1104
|
+
}
|
1101
1105
|
key_to_s = rb_convert_type(key, T_STRING, "String", "to_s");
|
1102
1106
|
break;
|
1103
1107
|
}
|
@@ -1112,7 +1116,6 @@ json_object_i(VALUE key, VALUE val, VALUE _arg)
|
|
1112
1116
|
if (RB_UNLIKELY(state->space)) fbuffer_append_str(buffer, data->state->space);
|
1113
1117
|
generate_json(buffer, data, val);
|
1114
1118
|
|
1115
|
-
arg->iter++;
|
1116
1119
|
return ST_CONTINUE;
|
1117
1120
|
}
|
1118
1121
|
|
@@ -1128,7 +1131,6 @@ static inline long increase_depth(struct generate_json_data *data)
|
|
1128
1131
|
|
1129
1132
|
static void generate_json_object(FBuffer *buffer, struct generate_json_data *data, VALUE obj)
|
1130
1133
|
{
|
1131
|
-
int j;
|
1132
1134
|
long depth = increase_depth(data);
|
1133
1135
|
|
1134
1136
|
if (RHASH_SIZE(obj) == 0) {
|
@@ -1140,8 +1142,9 @@ static void generate_json_object(FBuffer *buffer, struct generate_json_data *dat
|
|
1140
1142
|
fbuffer_append_char(buffer, '{');
|
1141
1143
|
|
1142
1144
|
struct hash_foreach_arg arg = {
|
1145
|
+
.hash = obj,
|
1143
1146
|
.data = data,
|
1144
|
-
.
|
1147
|
+
.first = true,
|
1145
1148
|
};
|
1146
1149
|
rb_hash_foreach(obj, json_object_i, (VALUE)&arg);
|
1147
1150
|
|
@@ -1149,9 +1152,7 @@ static void generate_json_object(FBuffer *buffer, struct generate_json_data *dat
|
|
1149
1152
|
if (RB_UNLIKELY(data->state->object_nl)) {
|
1150
1153
|
fbuffer_append_str(buffer, data->state->object_nl);
|
1151
1154
|
if (RB_UNLIKELY(data->state->indent)) {
|
1152
|
-
|
1153
|
-
fbuffer_append_str(buffer, data->state->indent);
|
1154
|
-
}
|
1155
|
+
fbuffer_append_str_repeat(buffer, data->state->indent, depth);
|
1155
1156
|
}
|
1156
1157
|
}
|
1157
1158
|
fbuffer_append_char(buffer, '}');
|
@@ -1159,7 +1160,6 @@ static void generate_json_object(FBuffer *buffer, struct generate_json_data *dat
|
|
1159
1160
|
|
1160
1161
|
static void generate_json_array(FBuffer *buffer, struct generate_json_data *data, VALUE obj)
|
1161
1162
|
{
|
1162
|
-
int i, j;
|
1163
1163
|
long depth = increase_depth(data);
|
1164
1164
|
|
1165
1165
|
if (RARRAY_LEN(obj) == 0) {
|
@@ -1170,15 +1170,13 @@ static void generate_json_array(FBuffer *buffer, struct generate_json_data *data
|
|
1170
1170
|
|
1171
1171
|
fbuffer_append_char(buffer, '[');
|
1172
1172
|
if (RB_UNLIKELY(data->state->array_nl)) fbuffer_append_str(buffer, data->state->array_nl);
|
1173
|
-
for (i = 0; i < RARRAY_LEN(obj); i++) {
|
1173
|
+
for (int i = 0; i < RARRAY_LEN(obj); i++) {
|
1174
1174
|
if (i > 0) {
|
1175
1175
|
fbuffer_append_char(buffer, ',');
|
1176
1176
|
if (RB_UNLIKELY(data->state->array_nl)) fbuffer_append_str(buffer, data->state->array_nl);
|
1177
1177
|
}
|
1178
1178
|
if (RB_UNLIKELY(data->state->indent)) {
|
1179
|
-
|
1180
|
-
fbuffer_append_str(buffer, data->state->indent);
|
1181
|
-
}
|
1179
|
+
fbuffer_append_str_repeat(buffer, data->state->indent, depth);
|
1182
1180
|
}
|
1183
1181
|
generate_json(buffer, data, RARRAY_AREF(obj, i));
|
1184
1182
|
}
|
@@ -1186,9 +1184,7 @@ static void generate_json_array(FBuffer *buffer, struct generate_json_data *data
|
|
1186
1184
|
if (RB_UNLIKELY(data->state->array_nl)) {
|
1187
1185
|
fbuffer_append_str(buffer, data->state->array_nl);
|
1188
1186
|
if (RB_UNLIKELY(data->state->indent)) {
|
1189
|
-
|
1190
|
-
fbuffer_append_str(buffer, data->state->indent);
|
1191
|
-
}
|
1187
|
+
fbuffer_append_str_repeat(buffer, data->state->indent, depth);
|
1192
1188
|
}
|
1193
1189
|
}
|
1194
1190
|
fbuffer_append_char(buffer, ']');
|
@@ -1340,7 +1336,7 @@ static void generate_json_float(FBuffer *buffer, struct generate_json_data *data
|
|
1340
1336
|
/* for NaN and Infinity values we either raise an error or rely on Float#to_s. */
|
1341
1337
|
if (!allow_nan) {
|
1342
1338
|
if (data->state->strict && data->state->as_json) {
|
1343
|
-
VALUE casted_obj =
|
1339
|
+
VALUE casted_obj = json_call_as_json(data->state, obj, Qfalse);
|
1344
1340
|
if (casted_obj != obj) {
|
1345
1341
|
increase_depth(data);
|
1346
1342
|
generate_json(buffer, data, casted_obj);
|
@@ -1357,12 +1353,11 @@ static void generate_json_float(FBuffer *buffer, struct generate_json_data *data
|
|
1357
1353
|
}
|
1358
1354
|
|
1359
1355
|
/* This implementation writes directly into the buffer. We reserve
|
1360
|
-
* the
|
1356
|
+
* the 32 characters that fpconv_dtoa states as its maximum.
|
1361
1357
|
*/
|
1362
|
-
fbuffer_inc_capa(buffer,
|
1358
|
+
fbuffer_inc_capa(buffer, 32);
|
1363
1359
|
char* d = buffer->ptr + buffer->len;
|
1364
1360
|
int len = fpconv_dtoa(value, d);
|
1365
|
-
|
1366
1361
|
/* fpconv_dtoa converts a float to its shortest string representation,
|
1367
1362
|
* but it adds a ".0" if this is a plain integer.
|
1368
1363
|
*/
|
@@ -1429,7 +1424,7 @@ start:
|
|
1429
1424
|
general:
|
1430
1425
|
if (data->state->strict) {
|
1431
1426
|
if (RTEST(data->state->as_json) && !as_json_called) {
|
1432
|
-
obj =
|
1427
|
+
obj = json_call_as_json(data->state, obj, Qfalse);
|
1433
1428
|
as_json_called = true;
|
1434
1429
|
goto start;
|
1435
1430
|
} else {
|
@@ -1850,6 +1845,19 @@ static VALUE cState_ascii_only_set(VALUE self, VALUE enable)
|
|
1850
1845
|
return Qnil;
|
1851
1846
|
}
|
1852
1847
|
|
1848
|
+
static VALUE cState_allow_duplicate_key_p(VALUE self)
|
1849
|
+
{
|
1850
|
+
GET_STATE(self);
|
1851
|
+
switch (state->on_duplicate_key) {
|
1852
|
+
case JSON_IGNORE:
|
1853
|
+
return Qtrue;
|
1854
|
+
case JSON_DEPRECATED:
|
1855
|
+
return Qnil;
|
1856
|
+
default:
|
1857
|
+
return Qfalse;
|
1858
|
+
}
|
1859
|
+
}
|
1860
|
+
|
1853
1861
|
/*
|
1854
1862
|
* call-seq: depth
|
1855
1863
|
*
|
@@ -1907,15 +1915,30 @@ static VALUE cState_buffer_initial_length_set(VALUE self, VALUE buffer_initial_l
|
|
1907
1915
|
return Qnil;
|
1908
1916
|
}
|
1909
1917
|
|
1918
|
+
struct configure_state_data {
|
1919
|
+
JSON_Generator_State *state;
|
1920
|
+
VALUE vstate; // Ruby object that owns the state, or Qfalse if stack-allocated
|
1921
|
+
};
|
1922
|
+
|
1923
|
+
static inline void state_write_value(struct configure_state_data *data, VALUE *field, VALUE value)
|
1924
|
+
{
|
1925
|
+
if (RTEST(data->vstate)) {
|
1926
|
+
RB_OBJ_WRITE(data->vstate, field, value);
|
1927
|
+
} else {
|
1928
|
+
*field = value;
|
1929
|
+
}
|
1930
|
+
}
|
1931
|
+
|
1910
1932
|
static int configure_state_i(VALUE key, VALUE val, VALUE _arg)
|
1911
1933
|
{
|
1912
|
-
|
1934
|
+
struct configure_state_data *data = (struct configure_state_data *)_arg;
|
1935
|
+
JSON_Generator_State *state = data->state;
|
1913
1936
|
|
1914
|
-
if (key == sym_indent) { state->indent
|
1915
|
-
else if (key == sym_space) { state->space
|
1916
|
-
else if (key == sym_space_before) { state->space_before
|
1917
|
-
else if (key == sym_object_nl) { state->object_nl
|
1918
|
-
else if (key == sym_array_nl) { state->array_nl
|
1937
|
+
if (key == sym_indent) { state_write_value(data, &state->indent, string_config(val)); }
|
1938
|
+
else if (key == sym_space) { state_write_value(data, &state->space, string_config(val)); }
|
1939
|
+
else if (key == sym_space_before) { state_write_value(data, &state->space_before, string_config(val)); }
|
1940
|
+
else if (key == sym_object_nl) { state_write_value(data, &state->object_nl, string_config(val)); }
|
1941
|
+
else if (key == sym_array_nl) { state_write_value(data, &state->array_nl, string_config(val)); }
|
1919
1942
|
else if (key == sym_max_nesting) { state->max_nesting = long_config(val); }
|
1920
1943
|
else if (key == sym_allow_nan) { state->allow_nan = RTEST(val); }
|
1921
1944
|
else if (key == sym_ascii_only) { state->ascii_only = RTEST(val); }
|
@@ -1924,11 +1947,16 @@ static int configure_state_i(VALUE key, VALUE val, VALUE _arg)
|
|
1924
1947
|
else if (key == sym_script_safe) { state->script_safe = RTEST(val); }
|
1925
1948
|
else if (key == sym_escape_slash) { state->script_safe = RTEST(val); }
|
1926
1949
|
else if (key == sym_strict) { state->strict = RTEST(val); }
|
1927
|
-
else if (key ==
|
1950
|
+
else if (key == sym_allow_duplicate_key) { state->on_duplicate_key = RTEST(val) ? JSON_IGNORE : JSON_RAISE; }
|
1951
|
+
else if (key == sym_as_json) {
|
1952
|
+
VALUE proc = RTEST(val) ? rb_convert_type(val, T_DATA, "Proc", "to_proc") : Qfalse;
|
1953
|
+
state->as_json_single_arg = proc && rb_proc_arity(proc) == 1;
|
1954
|
+
state_write_value(data, &state->as_json, proc);
|
1955
|
+
}
|
1928
1956
|
return ST_CONTINUE;
|
1929
1957
|
}
|
1930
1958
|
|
1931
|
-
static void configure_state(JSON_Generator_State *state, VALUE config)
|
1959
|
+
static void configure_state(JSON_Generator_State *state, VALUE vstate, VALUE config)
|
1932
1960
|
{
|
1933
1961
|
if (!RTEST(config)) return;
|
1934
1962
|
|
@@ -1936,15 +1964,20 @@ static void configure_state(JSON_Generator_State *state, VALUE config)
|
|
1936
1964
|
|
1937
1965
|
if (!RHASH_SIZE(config)) return;
|
1938
1966
|
|
1967
|
+
struct configure_state_data data = {
|
1968
|
+
.state = state,
|
1969
|
+
.vstate = vstate
|
1970
|
+
};
|
1971
|
+
|
1939
1972
|
// We assume in most cases few keys are set so it's faster to go over
|
1940
1973
|
// the provided keys than to check all possible keys.
|
1941
|
-
rb_hash_foreach(config, configure_state_i, (VALUE)
|
1974
|
+
rb_hash_foreach(config, configure_state_i, (VALUE)&data);
|
1942
1975
|
}
|
1943
1976
|
|
1944
1977
|
static VALUE cState_configure(VALUE self, VALUE opts)
|
1945
1978
|
{
|
1946
1979
|
GET_STATE(self);
|
1947
|
-
configure_state(state, opts);
|
1980
|
+
configure_state(state, self, opts);
|
1948
1981
|
return self;
|
1949
1982
|
}
|
1950
1983
|
|
@@ -1952,7 +1985,7 @@ static VALUE cState_m_generate(VALUE klass, VALUE obj, VALUE opts, VALUE io)
|
|
1952
1985
|
{
|
1953
1986
|
JSON_Generator_State state = {0};
|
1954
1987
|
state_init(&state);
|
1955
|
-
configure_state(&state, opts);
|
1988
|
+
configure_state(&state, Qfalse, opts);
|
1956
1989
|
|
1957
1990
|
char stack_buffer[FBUFFER_STACK_SIZE];
|
1958
1991
|
FBuffer buffer = {
|
@@ -2041,6 +2074,8 @@ void Init_generator(void)
|
|
2041
2074
|
rb_define_method(cState, "generate", cState_generate, -1);
|
2042
2075
|
rb_define_alias(cState, "generate_new", "generate"); // :nodoc:
|
2043
2076
|
|
2077
|
+
rb_define_private_method(cState, "allow_duplicate_key?", cState_allow_duplicate_key_p, 0);
|
2078
|
+
|
2044
2079
|
rb_define_singleton_method(cState, "generate", cState_m_generate, 3);
|
2045
2080
|
|
2046
2081
|
VALUE mGeneratorMethods = rb_define_module_under(mGenerator, "GeneratorMethods");
|
@@ -2068,13 +2103,7 @@ void Init_generator(void)
|
|
2068
2103
|
rb_define_method(mFloat, "to_json", mFloat_to_json, -1);
|
2069
2104
|
|
2070
2105
|
VALUE mString = rb_define_module_under(mGeneratorMethods, "String");
|
2071
|
-
rb_define_singleton_method(mString, "included", mString_included_s, 1);
|
2072
2106
|
rb_define_method(mString, "to_json", mString_to_json, -1);
|
2073
|
-
rb_define_method(mString, "to_json_raw", mString_to_json_raw, -1);
|
2074
|
-
rb_define_method(mString, "to_json_raw_object", mString_to_json_raw_object, 0);
|
2075
|
-
|
2076
|
-
mString_Extend = rb_define_module_under(mString, "Extend");
|
2077
|
-
rb_define_method(mString_Extend, "json_create", mString_Extend_json_create, 1);
|
2078
2107
|
|
2079
2108
|
VALUE mTrueClass = rb_define_module_under(mGeneratorMethods, "TrueClass");
|
2080
2109
|
rb_define_method(mTrueClass, "to_json", mTrueClass_to_json, -1);
|
@@ -2111,6 +2140,7 @@ void Init_generator(void)
|
|
2111
2140
|
sym_escape_slash = ID2SYM(rb_intern("escape_slash"));
|
2112
2141
|
sym_strict = ID2SYM(rb_intern("strict"));
|
2113
2142
|
sym_as_json = ID2SYM(rb_intern("as_json"));
|
2143
|
+
sym_allow_duplicate_key = ID2SYM(rb_intern("allow_duplicate_key"));
|
2114
2144
|
|
2115
2145
|
usascii_encindex = rb_usascii_encindex();
|
2116
2146
|
utf8_encindex = rb_utf8_encindex();
|
@@ -422,10 +422,12 @@ static void emit_parse_warning(const char *message, JSON_ParserState *state)
|
|
422
422
|
long line, column;
|
423
423
|
cursor_position(state, &line, &column);
|
424
424
|
|
425
|
-
|
425
|
+
VALUE warning = rb_sprintf("%s at line %ld column %ld", message, line, column);
|
426
|
+
rb_funcall(mJSON, rb_intern("deprecation_warning"), 1, warning);
|
426
427
|
}
|
427
428
|
|
428
429
|
#define PARSE_ERROR_FRAGMENT_LEN 32
|
430
|
+
|
429
431
|
#ifdef RBIMPL_ATTR_NORETURN
|
430
432
|
RBIMPL_ATTR_NORETURN()
|
431
433
|
#endif
|
@@ -711,11 +713,16 @@ static VALUE json_string_unescape(JSON_ParserState *state, const char *string, c
|
|
711
713
|
}
|
712
714
|
if (pe[0] == '\\' && pe[1] == 'u') {
|
713
715
|
uint32_t sur = unescape_unicode(state, (unsigned char *) pe + 2);
|
716
|
+
|
717
|
+
if ((sur & 0xFC00) != 0xDC00) {
|
718
|
+
raise_parse_error_at("invalid surrogate pair at %s", state, p);
|
719
|
+
}
|
720
|
+
|
714
721
|
ch = (((ch & 0x3F) << 10) | ((((ch >> 6) & 0xF) + 1) << 16)
|
715
722
|
| (sur & 0x3FF));
|
716
723
|
pe += 5;
|
717
724
|
} else {
|
718
|
-
|
725
|
+
raise_parse_error_at("incomplete surrogate pair at %s", state, p);
|
719
726
|
break;
|
720
727
|
}
|
721
728
|
}
|
@@ -830,21 +837,64 @@ static inline VALUE json_decode_array(JSON_ParserState *state, JSON_ParserConfig
|
|
830
837
|
return array;
|
831
838
|
}
|
832
839
|
|
840
|
+
static VALUE json_find_duplicated_key(size_t count, const VALUE *pairs)
|
841
|
+
{
|
842
|
+
VALUE set = rb_hash_new_capa(count / 2);
|
843
|
+
for (size_t index = 0; index < count; index += 2) {
|
844
|
+
size_t before = RHASH_SIZE(set);
|
845
|
+
VALUE key = pairs[index];
|
846
|
+
rb_hash_aset(set, key, Qtrue);
|
847
|
+
if (RHASH_SIZE(set) == before) {
|
848
|
+
if (RB_SYMBOL_P(key)) {
|
849
|
+
return rb_sym2str(key);
|
850
|
+
}
|
851
|
+
return key;
|
852
|
+
}
|
853
|
+
}
|
854
|
+
return Qfalse;
|
855
|
+
}
|
856
|
+
|
857
|
+
static void emit_duplicate_key_warning(JSON_ParserState *state, VALUE duplicate_key)
|
858
|
+
{
|
859
|
+
VALUE message = rb_sprintf(
|
860
|
+
"detected duplicate key %"PRIsVALUE" in JSON object. This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`",
|
861
|
+
rb_inspect(duplicate_key)
|
862
|
+
);
|
863
|
+
|
864
|
+
emit_parse_warning(RSTRING_PTR(message), state);
|
865
|
+
RB_GC_GUARD(message);
|
866
|
+
}
|
867
|
+
|
868
|
+
#ifdef RBIMPL_ATTR_NORETURN
|
869
|
+
RBIMPL_ATTR_NORETURN()
|
870
|
+
#endif
|
871
|
+
static void raise_duplicate_key_error(JSON_ParserState *state, VALUE duplicate_key)
|
872
|
+
{
|
873
|
+
VALUE message = rb_sprintf(
|
874
|
+
"duplicate key %"PRIsVALUE,
|
875
|
+
rb_inspect(duplicate_key)
|
876
|
+
);
|
877
|
+
|
878
|
+
raise_parse_error(RSTRING_PTR(message), state);
|
879
|
+
RB_GC_GUARD(message);
|
880
|
+
}
|
881
|
+
|
833
882
|
static inline VALUE json_decode_object(JSON_ParserState *state, JSON_ParserConfig *config, size_t count)
|
834
883
|
{
|
835
884
|
size_t entries_count = count / 2;
|
836
885
|
VALUE object = rb_hash_new_capa(entries_count);
|
837
|
-
|
886
|
+
const VALUE *pairs = rvalue_stack_peek(state->stack, count);
|
887
|
+
rb_hash_bulk_insert(count, pairs, object);
|
838
888
|
|
839
889
|
if (RB_UNLIKELY(RHASH_SIZE(object) < entries_count)) {
|
840
890
|
switch (config->on_duplicate_key) {
|
841
891
|
case JSON_IGNORE:
|
842
892
|
break;
|
843
893
|
case JSON_DEPRECATED:
|
844
|
-
|
894
|
+
emit_duplicate_key_warning(state, json_find_duplicated_key(count, pairs));
|
845
895
|
break;
|
846
896
|
case JSON_RAISE:
|
847
|
-
|
897
|
+
raise_duplicate_key_error(state, json_find_duplicated_key(count, pairs));
|
848
898
|
break;
|
849
899
|
}
|
850
900
|
}
|
@@ -930,7 +980,7 @@ static inline bool FORCE_INLINE string_scan(JSON_ParserState *state)
|
|
930
980
|
if (RB_UNLIKELY(string_scan_table[(unsigned char)*state->cursor])) {
|
931
981
|
return 1;
|
932
982
|
}
|
933
|
-
|
983
|
+
state->cursor++;
|
934
984
|
}
|
935
985
|
return 0;
|
936
986
|
}
|
@@ -1220,7 +1270,7 @@ static VALUE json_parse_any(JSON_ParserState *state, JSON_ParserConfig *config)
|
|
1220
1270
|
break;
|
1221
1271
|
}
|
1222
1272
|
|
1223
|
-
raise_parse_error("
|
1273
|
+
raise_parse_error("unreachable: %s", state);
|
1224
1274
|
}
|
1225
1275
|
|
1226
1276
|
static void json_ensure_eof(JSON_ParserState *state)
|
@@ -1269,7 +1319,7 @@ static int parser_config_init_i(VALUE key, VALUE val, VALUE data)
|
|
1269
1319
|
else if (key == sym_symbolize_names) { config->symbolize_names = RTEST(val); }
|
1270
1320
|
else if (key == sym_freeze) { config->freeze = RTEST(val); }
|
1271
1321
|
else if (key == sym_on_load) { config->on_load_proc = RTEST(val) ? val : Qfalse; }
|
1272
|
-
else if (key == sym_allow_duplicate_key)
|
1322
|
+
else if (key == sym_allow_duplicate_key) { config->on_duplicate_key = RTEST(val) ? JSON_IGNORE : JSON_RAISE; }
|
1273
1323
|
else if (key == sym_decimal_class) {
|
1274
1324
|
if (RTEST(val)) {
|
1275
1325
|
if (rb_respond_to(val, i_try_convert)) {
|
@@ -0,0 +1,24 @@
|
|
1
|
+
case RbConfig::CONFIG['host_cpu']
|
2
|
+
when /^(arm|aarch64)/
|
3
|
+
# Try to compile a small program using NEON instructions
|
4
|
+
header, type, init, extra = 'arm_neon.h', 'uint8x16_t', 'vdupq_n_u8(32)', nil
|
5
|
+
when /^(x86_64|x64)/
|
6
|
+
header, type, init, extra = 'x86intrin.h', '__m128i', '_mm_set1_epi8(32)', 'if (__builtin_cpu_supports("sse2")) { printf("OK"); }'
|
7
|
+
end
|
8
|
+
if header
|
9
|
+
if have_header(header) && try_compile(<<~SRC, '-Werror=implicit-function-declaration')
|
10
|
+
#{cpp_include(header)}
|
11
|
+
int main(int argc, char **argv) {
|
12
|
+
#{type} test = #{init};
|
13
|
+
#{extra}
|
14
|
+
if (argc > 100000) printf("%p", &test);
|
15
|
+
return 0;
|
16
|
+
}
|
17
|
+
SRC
|
18
|
+
$defs.push("-DJSON_ENABLE_SIMD")
|
19
|
+
else
|
20
|
+
puts "Disable SIMD"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
have_header('cpuid.h')
|