talon_one 6.0.0 → 7.0.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/.github/.example/.bundle/config +2 -0
- data/.github/.example/Gemfile +6 -0
- data/.github/.example/Gemfile.lock +47 -0
- data/.github/.example/example.rb +85 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/json-2.8.2/gem.build_complete +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/json-2.8.2/gem_make.out +24 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/json-2.8.2/json/ext/generator.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/json-2.8.2/json/ext/parser.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/json-2.8.2/mkmf.log +177 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/.github/workflows/ruby.yml +41 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/.gitignore +8 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/.rspec +3 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/CHANGELOG.md +375 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/Gemfile +43 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/Guardfile +10 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/LICENSE +20 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/README.md +118 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/Rakefile +40 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/ethon.gemspec +26 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curl.rb +90 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/classes.rb +65 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/codes.rb +122 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/constants.rb +80 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/form_options.rb +37 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/functions.rb +58 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/infos.rb +151 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/messages.rb +19 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/options.rb +503 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/settings.rb +12 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/callbacks.rb +149 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/debug_info.rb +47 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/features.rb +31 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/form.rb +107 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/header.rb +61 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/actionable.rb +157 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/custom.rb +29 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/delete.rb +25 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/get.rb +24 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/head.rb +24 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/options.rb +24 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/patch.rb +24 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/post.rb +26 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/postable.rb +32 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/put.rb +27 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/putable.rb +25 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http.rb +68 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/informations.rb +116 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/mirror.rb +36 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/operations.rb +64 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/options.rb +50 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/params.rb +29 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/queryable.rb +154 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/response_callbacks.rb +136 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/util.rb +28 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy.rb +315 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/ethon_error.rb +9 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/global_init.rb +13 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/invalid_option.rb +13 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/invalid_value.rb +13 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/multi_add.rb +12 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/multi_fdset.rb +12 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/multi_remove.rb +12 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/multi_timeout.rb +13 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/select.rb +13 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors.rb +17 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/libc.rb +21 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/loggable.rb +59 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/multi/operations.rb +228 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/multi/options.rb +117 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/multi/stack.rb +49 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/multi.rb +126 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/version.rb +6 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon.rb +36 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/benchmarks.rb +104 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/memory_leaks.rb +114 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/perf_spec_helper.rb +37 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/support/memory_test_helpers.rb +76 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/support/os_memory_leak_tracker.rb +48 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/support/ruby_object_leak_tracker.rb +49 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb +38 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/callbacks_spec.rb +81 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/debug_info_spec.rb +54 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/features_spec.rb +24 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/form_spec.rb +104 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/header_spec.rb +79 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/custom_spec.rb +177 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/delete_spec.rb +21 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/get_spec.rb +126 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/head_spec.rb +80 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/options_spec.rb +51 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/patch_spec.rb +51 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/post_spec.rb +317 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/put_spec.rb +168 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http_spec.rb +64 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/informations_spec.rb +126 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/mirror_spec.rb +47 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/operations_spec.rb +271 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/options_spec.rb +193 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/queryable_spec.rb +235 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/response_callbacks_spec.rb +152 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/util_spec.rb +28 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy_spec.rb +203 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/libc_spec.rb +14 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/loggable_spec.rb +22 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/multi/operations_spec.rb +298 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/multi/options_spec.rb +182 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/multi/stack_spec.rb +80 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/multi_spec.rb +152 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/spec_helper.rb +28 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/support/localhost_server.rb +95 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/support/server.rb +115 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/CHANGELOG.md +456 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/COPYING +49 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/Gemfile +21 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/LICENSE +24 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/LICENSE.SPECS +22 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/README.md +137 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/Rakefile +206 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/ffi.gemspec +42 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/2.5/ffi_c.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/2.6/ffi_c.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/2.7/ffi_c.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/3.0/ffi_c.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/3.1/ffi_c.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/3.2/ffi_c.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/3.3/ffi_c.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/abstract_memory.rb +44 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/autopointer.rb +180 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/buffer.rb +4 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/callback.rb +4 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/compat.rb +43 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/data_converter.rb +67 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/dynamic_library.rb +118 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/enum.rb +302 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/errno.rb +43 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/ffi.rb +50 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/function.rb +71 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/io.rb +62 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/library.rb +576 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/library_path.rb +109 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/managedstruct.rb +84 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/memorypointer.rb +1 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/aarch64-linux/types.conf +175 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/aarch64-windows/types.conf +52 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/arm-freebsd/types.conf +152 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/arm-linux/types.conf +132 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-darwin/types.conf +100 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-freebsd/types.conf +152 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-gnu/types.conf +107 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-linux/types.conf +103 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-netbsd/types.conf +126 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-openbsd/types.conf +128 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-solaris/types.conf +122 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/i386-windows/types.conf +52 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/ia64-linux/types.conf +104 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/mips-linux/types.conf +102 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/mips64-linux/types.conf +104 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/mipsel-linux/types.conf +102 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/powerpc-aix/types.conf +180 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/powerpc-linux/types.conf +130 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/riscv64-linux/types.conf +104 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/s390-linux/types.conf +102 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/s390x-linux/types.conf +102 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/sparc-linux/types.conf +102 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/sparc-solaris/types.conf +128 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/sparcv9-linux/types.conf +102 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/sw_64-linux/types.conf +141 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-darwin/types.conf +130 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-linux/types.conf +132 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-openbsd/types.conf +134 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform/x86_64-windows/types.conf +52 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform.rb +187 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/pointer.rb +167 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/struct.rb +317 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/struct_by_reference.rb +72 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/struct_layout.rb +96 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/struct_layout_builder.rb +227 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/const_generator.rb +232 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/generator.rb +105 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/generator_task.rb +32 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/struct_generator.rb +195 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/types_generator.rb +137 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/types.rb +222 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/union.rb +43 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/variadic.rb +80 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/version.rb +3 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi.rb +27 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/rakelib/ffi_gem_helper.rb +65 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/getlogin.rb +8 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/getpid.rb +8 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/gettimeofday.rb +18 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/hello.rb +8 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/hello_ractor.rb +11 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/inotify.rb +60 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/pty.rb +75 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/qsort.rb +20 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/qsort_ractor.rb +28 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/abstract_memory.rbs +165 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/auto_pointer.rbs +27 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/buffer.rbs +18 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/data_converter.rbs +10 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/dynamic_library.rbs +9 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/enum.rbs +38 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/function.rbs +39 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/library.rbs +42 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/native_type.rbs +86 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/pointer.rbs +42 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct.rbs +76 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct_by_reference.rbs +11 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct_by_value.rbs +7 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct_layout.rbs +9 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct_layout_builder.rbs +5 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/type.rbs +39 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi.rbs +26 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/BSDL +22 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/CHANGES.md +559 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/COPYING +56 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/LEGAL +60 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/README.md +195 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/fbuffer/fbuffer.h +184 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/generator/Makefile +270 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/generator/extconf.rb +10 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/generator/generator.c +1663 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/parser/Makefile +270 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/parser/extconf.rb +12 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/parser/parser.c +3238 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/parser/parser.rl +1465 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/json.gemspec +64 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/bigdecimal.rb +58 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/complex.rb +51 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/core.rb +12 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/date.rb +54 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/date_time.rb +67 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/exception.rb +49 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/ostruct.rb +54 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/range.rb +54 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/rational.rb +49 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/regexp.rb +48 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/set.rb +48 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/struct.rb +52 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/symbol.rb +47 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/time.rb +52 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/common.rb +876 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/ext/generator/state.rb +105 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/ext/generator.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/ext/parser.bundle +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/ext.rb +23 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/generic_object.rb +75 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/truffle_ruby/generator.rb +621 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/version.rb +5 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json.rb +587 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.github/workflows/ci.yml +30 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.github/workflows/experimental.yml +33 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.gitignore +8 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.rspec +4 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/CHANGELOG.md +410 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/CONTRIBUTING.md +20 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Gemfile +36 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Guardfile +9 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/LICENSE +22 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/README.md +588 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Rakefile +38 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/UPGRADE.md +55 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/rack/typhoeus/middleware/params_decoder/helper.rb +76 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/rack/typhoeus/middleware/params_decoder.rb +57 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/rack/typhoeus.rb +1 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/adapters/faraday.rb +180 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/cache/dalli.rb +28 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/cache/rails.rb +28 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/cache/redis.rb +35 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/config.rb +85 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/easy_factory.rb +206 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/errors/no_stub.rb +12 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/errors/typhoeus_error.rb +8 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/errors.rb +9 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/expectation.rb +217 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/addable.rb +23 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/before.rb +31 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/block_connection.rb +35 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/cacheable.rb +15 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/memoizable.rb +56 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/queueable.rb +83 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/runnable.rb +19 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/stubbable.rb +28 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra.rb +95 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/pool.rb +70 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/railtie.rb +12 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/actions.rb +125 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/before.rb +30 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/block_connection.rb +52 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/cacheable.rb +38 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/callbacks.rb +151 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/marshal.rb +22 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/memoizable.rb +38 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/operations.rb +40 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/responseable.rb +29 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/streamable.rb +34 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/stubbable.rb +30 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request.rb +223 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response/cacheable.rb +14 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response/header.rb +105 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response/informations.rb +305 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response/status.rb +106 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response.rb +68 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/version.rb +5 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus.rb +143 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/perf/profile.rb +14 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/perf/vs_nethttp.rb +64 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/rack/typhoeus/middleware/params_decoder/helper_spec.rb +156 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/rack/typhoeus/middleware/params_decoder_spec.rb +31 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/spec_helper.rb +29 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/localhost_server.rb +94 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/memory_cache.rb +15 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/server.rb +116 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/adapters/faraday_spec.rb +339 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/cache/dalli_spec.rb +41 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/cache/redis_spec.rb +41 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/config_spec.rb +15 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/easy_factory_spec.rb +143 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/errors/no_stub_spec.rb +13 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/expectation_spec.rb +280 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/addable_spec.rb +22 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/before_spec.rb +98 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/block_connection_spec.rb +18 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/cacheable_spec.rb +88 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/memoizable_spec.rb +53 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/queueable_spec.rb +98 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/runnable_spec.rb +137 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/stubbable_spec.rb +48 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra_spec.rb +22 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/pool_spec.rb +137 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/actions_spec.rb +19 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/before_spec.rb +93 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/block_connection_spec.rb +75 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/cacheable_spec.rb +94 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/callbacks_spec.rb +91 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/marshal_spec.rb +60 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/memoizable_spec.rb +34 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/operations_spec.rb +101 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/responseable_spec.rb +13 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/stubbable_spec.rb +45 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request_spec.rb +256 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/header_spec.rb +147 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/informations_spec.rb +323 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/status_spec.rb +256 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response_spec.rb +100 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus_spec.rb +105 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/typhoeus.gemspec +25 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/specifications/ethon-0.16.0.gemspec +24 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/specifications/ffi-1.17.0-arm64-darwin.gemspec +31 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/specifications/json-2.8.2.gemspec +0 -0
- data/.github/.example/vendor/bundle/ruby/3.3.0/specifications/typhoeus-1.4.1.gemspec +24 -0
- data/.github/dependabot.yml +10 -0
- data/.github/workflows/test.yml +75 -0
- data/README.md +546 -562
- data/docker-compose.yml +47 -0
- data/docs/AccountAnalytics.md +1 -1
- data/docs/Achievement.md +8 -0
- data/docs/AdditionalCampaignProperties.md +1 -1
- data/docs/AnalyticsProduct.md +23 -0
- data/docs/AnalyticsProductSKU.md +21 -0
- data/docs/ApplicationCampaignStats.md +2 -0
- data/docs/ApplicationCustomer.md +8 -8
- data/docs/ApplicationSession.md +2 -2
- data/docs/AudienceCustomer.md +2 -2
- data/docs/BaseLoyaltyProgram.md +3 -1
- data/docs/BulkOperationOnCampaigns.md +3 -1
- data/docs/Campaign.md +3 -1
- data/docs/CampaignTemplate.md +3 -1
- data/docs/CampaignTemplateCouponReservationSettings.md +19 -0
- data/docs/CampaignVersions.md +3 -1
- data/docs/Change.md +1 -1
- data/docs/CouponDeletionFilters.md +1 -1
- data/docs/CreateAchievement.md +9 -1
- data/docs/CustomerProfile.md +2 -2
- data/docs/CustomerProfileAudienceRequestItem.md +1 -1
- data/docs/CustomerSession.md +1 -1
- data/docs/CustomerSessionV2.md +10 -8
- data/docs/FeatureFlag.md +1 -1
- data/docs/GenerateCampaignDescription.md +2 -2
- data/docs/GenerateCampaignTags.md +2 -2
- data/docs/GenerateLoyaltyCard.md +3 -1
- data/docs/InlineResponse20020.md +1 -1
- data/docs/InlineResponse20021.md +4 -2
- data/docs/InlineResponse20022.md +3 -3
- data/docs/InlineResponse20023.md +1 -1
- data/docs/InlineResponse20024.md +1 -3
- data/docs/InlineResponse20025.md +1 -1
- data/docs/InlineResponse20026.md +2 -2
- data/docs/InlineResponse20027.md +2 -2
- data/docs/InlineResponse20028.md +3 -3
- data/docs/InlineResponse20029.md +5 -3
- data/docs/InlineResponse20030.md +1 -3
- data/docs/InlineResponse20031.md +1 -1
- data/docs/InlineResponse20032.md +3 -1
- data/docs/InlineResponse20033.md +3 -5
- data/docs/InlineResponse20034.md +5 -3
- data/docs/InlineResponse20035.md +3 -5
- data/docs/InlineResponse20036.md +1 -1
- data/docs/InlineResponse20037.md +1 -1
- data/docs/InlineResponse20038.md +1 -1
- data/docs/InlineResponse20039.md +1 -1
- data/docs/InlineResponse20040.md +1 -1
- data/docs/InlineResponse20041.md +4 -2
- data/docs/InlineResponse20042.md +2 -4
- data/docs/InlineResponse20043.md +1 -1
- data/docs/InlineResponse20044.md +5 -3
- data/docs/InlineResponse20045.md +1 -3
- data/docs/InlineResponse20046.md +3 -3
- data/docs/IntegrationApi.md +8 -8
- data/docs/IntegrationCustomerSessionResponse.md +1 -1
- data/docs/LedgerInfo.md +2 -2
- data/docs/ListCampaignStoreBudgets.md +23 -0
- data/docs/ListCampaignStoreBudgetsStore.md +21 -0
- data/docs/LoyaltyCard.md +4 -0
- data/docs/LoyaltyCardBatch.md +3 -1
- data/docs/LoyaltyLedger.md +1 -1
- data/docs/LoyaltyMembership.md +1 -1
- data/docs/LoyaltyProgram.md +5 -3
- data/docs/LoyaltyProgramBalance.md +2 -2
- data/docs/LoyaltyProgramEntity.md +5 -1
- data/docs/LoyaltyTier.md +6 -2
- data/docs/ManagementApi.md +114 -188
- data/docs/MessageLogEntry.md +10 -2
- data/docs/NewCampaignStoreBudget.md +21 -0
- data/docs/NewCampaignStoreBudgetStoreLimit.md +19 -0
- data/docs/NewCampaignTemplate.md +2 -0
- data/docs/NewCustomerSessionV2.md +4 -4
- data/docs/NewLoyaltyProgram.md +2 -0
- data/docs/NewLoyaltyTier.md +2 -2
- data/docs/NewPicklist.md +1 -1
- data/docs/NewWebhook.md +1 -1
- data/docs/Picklist.md +1 -1
- data/docs/Product.md +1 -1
- data/docs/ProductSearchMatch.md +21 -0
- data/docs/ProductSkuUnitAnalytics.md +23 -0
- data/docs/ProductUnitAnalytics.md +25 -0
- data/docs/ScimNewUser.md +1 -1
- data/docs/ScimServiceProviderConfigResponse.md +3 -1
- data/docs/ScimServiceProviderConfigResponseSort.md +17 -0
- data/docs/ScimUser.md +1 -1
- data/docs/Store.md +2 -2
- data/docs/StrikethroughDebugResponse.md +19 -0
- data/docs/SummaryCampaignStoreBudget.md +21 -0
- data/docs/TemplateArgDef.md +2 -0
- data/docs/UpdateAchievement.md +9 -1
- data/docs/UpdateCampaignTemplate.md +2 -0
- data/docs/UpdateLoyaltyProgram.md +2 -0
- data/docs/UpdateLoyaltyProgramTier.md +21 -0
- data/docs/UpdatePicklist.md +1 -1
- data/docs/User.md +2 -2
- data/docs/ValueMap.md +23 -0
- data/docs/Webhook.md +1 -1
- data/docs/WebhookLogEntry.md +1 -1
- data/docs/WebhookWithOutgoingIntegrationDetails.md +1 -1
- data/lib/talon_one/api/integration_api.rb +13 -13
- data/lib/talon_one/api/management_api.rb +156 -245
- data/lib/talon_one/models/account.rb +0 -1
- data/lib/talon_one/models/account_additional_cost.rb +0 -1
- data/lib/talon_one/models/achievement.rb +87 -2
- data/lib/talon_one/models/add_loyalty_points_effect_props.rb +11 -0
- data/lib/talon_one/models/additional_campaign_properties.rb +3 -3
- data/lib/talon_one/models/analytics_product.rb +252 -0
- data/lib/talon_one/models/analytics_product_sku.rb +242 -0
- data/lib/talon_one/models/application.rb +0 -1
- data/lib/talon_one/models/application_api_key.rb +0 -1
- data/lib/talon_one/models/application_campaign_analytics.rb +2 -2
- data/lib/talon_one/models/application_campaign_stats.rb +16 -1
- data/lib/talon_one/models/application_cif.rb +0 -1
- data/lib/talon_one/models/application_cif_expression.rb +0 -1
- data/lib/talon_one/models/application_customer.rb +4 -5
- data/lib/talon_one/models/application_event.rb +0 -1
- data/lib/talon_one/models/application_referee.rb +0 -1
- data/lib/talon_one/models/application_session.rb +1 -2
- data/lib/talon_one/models/async_coupon_deletion_job_response.rb +0 -1
- data/lib/talon_one/models/attribute.rb +0 -1
- data/lib/talon_one/models/audience.rb +0 -1
- data/lib/talon_one/models/audience_customer.rb +1 -2
- data/lib/talon_one/models/base_loyalty_program.rb +26 -4
- data/lib/talon_one/models/base_notification.rb +0 -1
- data/lib/talon_one/models/base_notification_webhook.rb +0 -1
- data/lib/talon_one/models/bulk_operation_on_campaigns.rb +16 -6
- data/lib/talon_one/models/campaign.rb +26 -5
- data/lib/talon_one/models/campaign_analytics.rb +0 -1
- data/lib/talon_one/models/campaign_collection.rb +0 -1
- data/lib/talon_one/models/campaign_collection_without_payload.rb +0 -1
- data/lib/talon_one/models/campaign_evaluation_group.rb +0 -1
- data/lib/talon_one/models/campaign_group.rb +0 -1
- data/lib/talon_one/models/campaign_set.rb +0 -1
- data/lib/talon_one/models/campaign_store_budget.rb +0 -1
- data/lib/talon_one/models/campaign_template.rb +10 -2
- data/lib/talon_one/models/campaign_template_coupon_reservation_settings.rb +243 -0
- data/lib/talon_one/models/campaign_versions.rb +45 -1
- data/lib/talon_one/models/card_ledger_transaction_log_entry.rb +11 -0
- data/lib/talon_one/models/card_ledger_transaction_log_entry_integration_api.rb +11 -0
- data/lib/talon_one/models/catalog.rb +0 -1
- data/lib/talon_one/models/catalog_item.rb +0 -1
- data/lib/talon_one/models/change.rb +0 -1
- data/lib/talon_one/models/code_generator_settings.rb +11 -0
- data/lib/talon_one/models/collection.rb +0 -1
- data/lib/talon_one/models/collection_item.rb +0 -1
- data/lib/talon_one/models/collection_without_payload.rb +0 -1
- data/lib/talon_one/models/coupon.rb +0 -1
- data/lib/talon_one/models/coupon_creation_job.rb +0 -1
- data/lib/talon_one/models/coupon_deletion_filters.rb +0 -2
- data/lib/talon_one/models/coupon_deletion_job.rb +0 -1
- data/lib/talon_one/models/create_achievement.rb +90 -4
- data/lib/talon_one/models/custom_effect.rb +0 -1
- data/lib/talon_one/models/customer_profile.rb +1 -2
- data/lib/talon_one/models/customer_profile_audience_request_item.rb +1 -1
- data/lib/talon_one/models/customer_profile_integration_request_v2.rb +1 -1
- data/lib/talon_one/models/customer_session.rb +0 -1
- data/lib/talon_one/models/customer_session_v2.rb +20 -10
- data/lib/talon_one/models/deactivate_user_request.rb +0 -1
- data/lib/talon_one/models/deduct_loyalty_points_effect_props.rb +11 -0
- data/lib/talon_one/models/effect.rb +1 -1
- data/lib/talon_one/models/environment.rb +0 -1
- data/lib/talon_one/models/event.rb +0 -1
- data/lib/talon_one/models/event_type.rb +0 -1
- data/lib/talon_one/models/event_v2.rb +0 -1
- data/lib/talon_one/models/export.rb +0 -1
- data/lib/talon_one/models/features_feed.rb +0 -1
- data/lib/talon_one/models/generate_campaign_description.rb +11 -11
- data/lib/talon_one/models/generate_campaign_tags.rb +11 -11
- data/lib/talon_one/models/generate_loyalty_card.rb +40 -4
- data/lib/talon_one/models/giveaway.rb +0 -1
- data/lib/talon_one/models/import.rb +0 -1
- data/lib/talon_one/models/inline_response20020.rb +1 -1
- data/lib/talon_one/models/inline_response20021.rb +11 -7
- data/lib/talon_one/models/inline_response20022.rb +10 -10
- data/lib/talon_one/models/inline_response20023.rb +1 -1
- data/lib/talon_one/models/inline_response20024.rb +6 -10
- data/lib/talon_one/models/inline_response20025.rb +1 -1
- data/lib/talon_one/models/inline_response20026.rb +1 -6
- data/lib/talon_one/models/inline_response20027.rb +6 -1
- data/lib/talon_one/models/inline_response20028.rb +11 -11
- data/lib/talon_one/models/inline_response20029.rb +11 -7
- data/lib/talon_one/models/inline_response20030.rb +2 -11
- data/lib/talon_one/models/inline_response20031.rb +1 -1
- data/lib/talon_one/models/inline_response20032.rb +11 -2
- data/lib/talon_one/models/inline_response20033.rb +7 -11
- data/lib/talon_one/models/inline_response20034.rb +11 -7
- data/lib/talon_one/models/inline_response20035.rb +7 -11
- data/lib/talon_one/models/inline_response20036.rb +1 -1
- data/lib/talon_one/models/inline_response20037.rb +1 -1
- data/lib/talon_one/models/inline_response20038.rb +1 -1
- data/lib/talon_one/models/inline_response20039.rb +1 -1
- data/lib/talon_one/models/inline_response20040.rb +1 -1
- data/lib/talon_one/models/inline_response20041.rb +11 -7
- data/lib/talon_one/models/inline_response20042.rb +7 -11
- data/lib/talon_one/models/inline_response20043.rb +1 -1
- data/lib/talon_one/models/inline_response20044.rb +11 -7
- data/lib/talon_one/models/inline_response20045.rb +2 -11
- data/lib/talon_one/models/inline_response20046.rb +6 -1
- data/lib/talon_one/models/integration_coupon.rb +0 -1
- data/lib/talon_one/models/integration_customer_session_response.rb +1 -0
- data/lib/talon_one/models/integration_event.rb +0 -1
- data/lib/talon_one/models/integration_event_v2_request.rb +0 -1
- data/lib/talon_one/models/inventory_coupon.rb +0 -1
- data/lib/talon_one/models/inventory_referral.rb +0 -1
- data/lib/talon_one/models/item_attribute.rb +0 -1
- data/lib/talon_one/models/ledger_entry.rb +1 -1
- data/lib/talon_one/models/ledger_info.rb +3 -3
- data/lib/talon_one/models/library_attribute.rb +0 -1
- data/lib/talon_one/models/limit_counter.rb +0 -1
- data/lib/talon_one/models/list_campaign_store_budgets.rb +248 -0
- data/lib/talon_one/models/list_campaign_store_budgets_store.rb +239 -0
- data/lib/talon_one/models/login_params.rb +0 -1
- data/lib/talon_one/models/loyalty_balance_with_tier.rb +1 -1
- data/lib/talon_one/models/loyalty_card.rb +54 -2
- data/lib/talon_one/models/loyalty_card_balances.rb +1 -1
- data/lib/talon_one/models/loyalty_card_batch.rb +13 -5
- data/lib/talon_one/models/loyalty_program.rb +25 -3
- data/lib/talon_one/models/loyalty_program_balance.rb +2 -2
- data/lib/talon_one/models/loyalty_program_entity.rb +24 -4
- data/lib/talon_one/models/loyalty_program_transaction.rb +11 -0
- data/lib/talon_one/models/loyalty_tier.rb +24 -4
- data/lib/talon_one/models/management_key.rb +0 -1
- data/lib/talon_one/models/message_log_entry.rb +67 -7
- data/lib/talon_one/models/model_return.rb +0 -1
- data/lib/talon_one/models/multiple_audiences_item.rb +0 -1
- data/lib/talon_one/models/multiple_customer_profile_integration_request_item.rb +1 -1
- data/lib/talon_one/models/new_account_sign_up.rb +0 -1
- data/lib/talon_one/models/new_additional_cost.rb +0 -1
- data/lib/talon_one/models/new_application_api_key.rb +0 -1
- data/lib/talon_one/models/new_attribute.rb +0 -1
- data/lib/talon_one/models/new_audience.rb +0 -1
- data/lib/talon_one/models/new_base_notification.rb +0 -1
- data/lib/talon_one/models/new_campaign.rb +0 -1
- data/lib/talon_one/models/new_campaign_collection.rb +0 -1
- data/lib/talon_one/models/new_campaign_set.rb +0 -1
- data/lib/talon_one/models/new_campaign_store_budget.rb +283 -0
- data/lib/talon_one/models/new_campaign_store_budget_store_limit.rb +227 -0
- data/lib/talon_one/models/new_campaign_template.rb +10 -1
- data/lib/talon_one/models/new_catalog.rb +0 -1
- data/lib/talon_one/models/new_collection.rb +0 -1
- data/lib/talon_one/models/new_coupon_creation_job.rb +0 -1
- data/lib/talon_one/models/new_coupons.rb +0 -1
- data/lib/talon_one/models/new_coupons_for_multiple_recipients.rb +0 -1
- data/lib/talon_one/models/new_custom_effect.rb +0 -1
- data/lib/talon_one/models/new_customer_session.rb +0 -1
- data/lib/talon_one/models/new_customer_session_v2.rb +3 -3
- data/lib/talon_one/models/new_event.rb +0 -1
- data/lib/talon_one/models/new_event_type.rb +0 -1
- data/lib/talon_one/models/new_loyalty_program.rb +24 -2
- data/lib/talon_one/models/new_loyalty_tier.rb +2 -2
- data/lib/talon_one/models/new_management_key.rb +0 -1
- data/lib/talon_one/models/new_multiple_audiences_item.rb +0 -1
- data/lib/talon_one/models/new_referral.rb +0 -1
- data/lib/talon_one/models/new_referrals_for_multiple_advocates.rb +0 -1
- data/lib/talon_one/models/new_role.rb +0 -1
- data/lib/talon_one/models/new_role_v2.rb +0 -1
- data/lib/talon_one/models/new_saml_connection.rb +1 -1
- data/lib/talon_one/models/new_store.rb +0 -1
- data/lib/talon_one/models/new_user.rb +0 -1
- data/lib/talon_one/models/new_webhook.rb +1 -2
- data/lib/talon_one/models/outgoing_integration_template_with_configuration_details.rb +0 -1
- data/lib/talon_one/models/picklist.rb +0 -1
- data/lib/talon_one/models/product.rb +1 -1
- data/lib/talon_one/models/product_search_match.rb +237 -0
- data/lib/talon_one/models/product_sku_unit_analytics.rb +256 -0
- data/lib/talon_one/models/product_unit_analytics.rb +271 -0
- data/lib/talon_one/models/referral.rb +0 -1
- data/lib/talon_one/models/revision.rb +0 -1
- data/lib/talon_one/models/revision_version.rb +0 -1
- data/lib/talon_one/models/role.rb +0 -1
- data/lib/talon_one/models/role_assign.rb +0 -1
- data/lib/talon_one/models/role_v2.rb +0 -1
- data/lib/talon_one/models/rollback_added_loyalty_points_effect_props.rb +11 -0
- data/lib/talon_one/models/rollback_deducted_loyalty_points_effect_props.rb +11 -0
- data/lib/talon_one/models/ruleset.rb +0 -1
- data/lib/talon_one/models/saml_connection.rb +1 -1
- data/lib/talon_one/models/scim_new_user.rb +5 -0
- data/lib/talon_one/models/scim_service_provider_config_response.rb +13 -4
- data/lib/talon_one/models/scim_service_provider_config_response_sort.rb +208 -0
- data/lib/talon_one/models/scim_user.rb +5 -0
- data/lib/talon_one/models/store.rb +1 -2
- data/lib/talon_one/models/strikethrough_debug_response.rb +221 -0
- data/lib/talon_one/models/summary_campaign_store_budget.rb +280 -0
- data/lib/talon_one/models/talang_attribute.rb +0 -1
- data/lib/talon_one/models/template_arg_def.rb +11 -2
- data/lib/talon_one/models/template_def.rb +0 -1
- data/lib/talon_one/models/template_limit_config.rb +0 -1
- data/lib/talon_one/models/transfer_loyalty_card.rb +11 -0
- data/lib/talon_one/models/update_achievement.rb +90 -4
- data/lib/talon_one/models/update_campaign_evaluation_group.rb +0 -1
- data/lib/talon_one/models/update_campaign_group.rb +0 -1
- data/lib/talon_one/models/update_campaign_template.rb +10 -1
- data/lib/talon_one/models/update_coupon.rb +0 -1
- data/lib/talon_one/models/update_coupon_batch.rb +0 -1
- data/lib/talon_one/models/update_loyalty_program.rb +24 -2
- data/lib/talon_one/models/update_loyalty_program_tier.rb +257 -0
- data/lib/talon_one/models/update_picklist.rb +0 -1
- data/lib/talon_one/models/user.rb +0 -1
- data/lib/talon_one/models/value_map.rb +245 -0
- data/lib/talon_one/models/webhook.rb +1 -2
- data/lib/talon_one/models/webhook_log_entry.rb +1 -1
- data/lib/talon_one/models/webhook_with_outgoing_integration_details.rb +1 -2
- data/lib/talon_one/version.rb +1 -1
- data/lib/talon_one.rb +15 -4
- data/spec/api/integration_api_spec.rb +5 -5
- data/spec/api/management_api_spec.rb +58 -76
- data/spec/models/achievement_spec.rb +32 -0
- data/spec/models/additional_campaign_properties_spec.rb +1 -1
- data/spec/models/analytics_product_sku_spec.rb +53 -0
- data/spec/models/analytics_product_spec.rb +59 -0
- data/spec/models/application_campaign_analytics_spec.rb +1 -1
- data/spec/models/application_campaign_stats_spec.rb +6 -0
- data/spec/models/base_loyalty_program_spec.rb +10 -0
- data/spec/models/bulk_operation_on_campaigns_spec.rb +7 -1
- data/spec/models/campaign_spec.rb +11 -1
- data/spec/models/campaign_template_coupon_reservation_settings_spec.rb +47 -0
- data/spec/models/campaign_template_spec.rb +6 -0
- data/spec/models/campaign_versions_spec.rb +10 -0
- data/spec/models/create_achievement_spec.rb +32 -0
- data/spec/models/customer_session_v2_spec.rb +6 -0
- data/spec/models/generate_campaign_description_spec.rb +1 -1
- data/spec/models/generate_campaign_tags_spec.rb +1 -1
- data/spec/models/generate_loyalty_card_spec.rb +6 -0
- data/spec/models/inline_response20021_spec.rb +6 -0
- data/spec/models/inline_response20022_spec.rb +2 -2
- data/spec/models/inline_response20024_spec.rb +0 -6
- data/spec/models/inline_response20028_spec.rb +1 -1
- data/spec/models/inline_response20029_spec.rb +6 -0
- data/spec/models/inline_response20030_spec.rb +0 -6
- data/spec/models/inline_response20032_spec.rb +6 -0
- data/spec/models/inline_response20033_spec.rb +0 -6
- data/spec/models/inline_response20034_spec.rb +6 -0
- data/spec/models/inline_response20035_spec.rb +0 -6
- data/spec/models/inline_response20041_spec.rb +6 -0
- data/spec/models/inline_response20042_spec.rb +0 -6
- data/spec/models/inline_response20044_spec.rb +6 -0
- data/spec/models/inline_response20045_spec.rb +0 -6
- data/spec/models/limit_config_spec.rb +1 -1
- data/spec/models/list_campaign_store_budgets_spec.rb +59 -0
- data/spec/models/list_campaign_store_budgets_store_spec.rb +53 -0
- data/spec/models/loyalty_card_batch_spec.rb +6 -0
- data/spec/models/loyalty_card_spec.rb +12 -0
- data/spec/models/loyalty_program_entity_spec.rb +12 -0
- data/spec/models/loyalty_program_spec.rb +10 -0
- data/spec/models/loyalty_tier_spec.rb +12 -0
- data/spec/models/message_log_entry_spec.rb +25 -1
- data/spec/models/new_campaign_store_budget_spec.rb +61 -0
- data/spec/models/new_campaign_store_budget_store_limit_spec.rb +47 -0
- data/spec/models/new_campaign_template_spec.rb +6 -0
- data/spec/models/new_loyalty_program_spec.rb +10 -0
- data/spec/models/product_search_match_spec.rb +53 -0
- data/spec/models/product_sku_unit_analytics_spec.rb +59 -0
- data/spec/models/product_unit_analytics_spec.rb +65 -0
- data/spec/models/scim_service_provider_config_response_sort_spec.rb +41 -0
- data/spec/models/scim_service_provider_config_response_spec.rb +6 -0
- data/spec/models/strikethrough_debug_response_spec.rb +47 -0
- data/spec/models/summary_campaign_store_budget_spec.rb +61 -0
- data/spec/models/template_arg_def_spec.rb +6 -0
- data/spec/models/template_limit_config_spec.rb +1 -1
- data/spec/models/update_achievement_spec.rb +32 -0
- data/spec/models/update_campaign_template_spec.rb +6 -0
- data/spec/models/update_loyalty_program_spec.rb +10 -0
- data/spec/models/update_loyalty_program_tier_spec.rb +53 -0
- data/spec/models/value_map_spec.rb +59 -0
- metadata +447 -6
data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/generator/generator.c
ADDED
@@ -0,0 +1,1663 @@
|
|
1
|
+
#include "ruby.h"
|
2
|
+
#include "../fbuffer/fbuffer.h"
|
3
|
+
|
4
|
+
#include <math.h>
|
5
|
+
#include <ctype.h>
|
6
|
+
|
7
|
+
/* ruby api and some helpers */
|
8
|
+
|
9
|
+
typedef struct JSON_Generator_StateStruct {
|
10
|
+
VALUE indent;
|
11
|
+
VALUE space;
|
12
|
+
VALUE space_before;
|
13
|
+
VALUE object_nl;
|
14
|
+
VALUE array_nl;
|
15
|
+
|
16
|
+
long max_nesting;
|
17
|
+
long depth;
|
18
|
+
long buffer_initial_length;
|
19
|
+
|
20
|
+
bool allow_nan;
|
21
|
+
bool ascii_only;
|
22
|
+
bool script_safe;
|
23
|
+
bool strict;
|
24
|
+
} JSON_Generator_State;
|
25
|
+
|
26
|
+
#ifndef RB_UNLIKELY
|
27
|
+
#define RB_UNLIKELY(cond) (cond)
|
28
|
+
#endif
|
29
|
+
|
30
|
+
static VALUE mJSON, cState, mString_Extend, eGeneratorError, eNestingError, Encoding_UTF_8;
|
31
|
+
|
32
|
+
static ID i_to_s, i_to_json, i_new, i_pack, i_unpack, i_create_id, i_extend, i_encode;
|
33
|
+
static ID sym_indent, sym_space, sym_space_before, sym_object_nl, sym_array_nl, sym_max_nesting, sym_allow_nan,
|
34
|
+
sym_ascii_only, sym_depth, sym_buffer_initial_length, sym_script_safe, sym_escape_slash, sym_strict;
|
35
|
+
|
36
|
+
|
37
|
+
#define GET_STATE_TO(self, state) \
|
38
|
+
TypedData_Get_Struct(self, JSON_Generator_State, &JSON_Generator_State_type, state)
|
39
|
+
|
40
|
+
#define GET_STATE(self) \
|
41
|
+
JSON_Generator_State *state; \
|
42
|
+
GET_STATE_TO(self, state)
|
43
|
+
|
44
|
+
struct generate_json_data;
|
45
|
+
|
46
|
+
typedef void (*generator_func)(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
47
|
+
|
48
|
+
struct generate_json_data {
|
49
|
+
FBuffer *buffer;
|
50
|
+
VALUE vstate;
|
51
|
+
JSON_Generator_State *state;
|
52
|
+
VALUE obj;
|
53
|
+
generator_func func;
|
54
|
+
};
|
55
|
+
|
56
|
+
static VALUE cState_from_state_s(VALUE self, VALUE opts);
|
57
|
+
static VALUE cState_partial_generate(VALUE self, VALUE obj, generator_func);
|
58
|
+
static void generate_json(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
59
|
+
static void generate_json_object(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
60
|
+
static void generate_json_array(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
61
|
+
static void generate_json_string(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
62
|
+
static void generate_json_null(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
63
|
+
static void generate_json_false(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
64
|
+
static void generate_json_true(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
65
|
+
#ifdef RUBY_INTEGER_UNIFICATION
|
66
|
+
static void generate_json_integer(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
67
|
+
#endif
|
68
|
+
static void generate_json_fixnum(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
69
|
+
static void generate_json_bignum(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
70
|
+
static void generate_json_float(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj);
|
71
|
+
|
72
|
+
static int usascii_encindex, utf8_encindex, binary_encindex;
|
73
|
+
|
74
|
+
/* Converts in_string to a JSON string (without the wrapping '"'
|
75
|
+
* characters) in FBuffer out_buffer.
|
76
|
+
*
|
77
|
+
* Character are JSON-escaped according to:
|
78
|
+
*
|
79
|
+
* - Always: ASCII control characters (0x00-0x1F), dquote, and
|
80
|
+
* backslash.
|
81
|
+
*
|
82
|
+
* - If out_ascii_only: non-ASCII characters (>0x7F)
|
83
|
+
*
|
84
|
+
* - If out_script_safe: forwardslash, line separator (U+2028), and
|
85
|
+
* paragraph separator (U+2029)
|
86
|
+
*
|
87
|
+
* Everything else (should be UTF-8) is just passed through and
|
88
|
+
* appended to the result.
|
89
|
+
*/
|
90
|
+
static void convert_UTF8_to_JSON(FBuffer *out_buffer, VALUE str, const char escape_table[256], bool out_script_safe)
|
91
|
+
{
|
92
|
+
const char *hexdig = "0123456789abcdef";
|
93
|
+
char scratch[12] = { '\\', 'u', 0, 0, 0, 0, '\\', 'u' };
|
94
|
+
|
95
|
+
const char *ptr = RSTRING_PTR(str);
|
96
|
+
unsigned long len = RSTRING_LEN(str);
|
97
|
+
|
98
|
+
unsigned long beg = 0, pos = 0;
|
99
|
+
|
100
|
+
#define FLUSH_POS(bytes) if (pos > beg) { fbuffer_append(out_buffer, &ptr[beg], pos - beg); } pos += bytes; beg = pos;
|
101
|
+
|
102
|
+
while (pos < len) {
|
103
|
+
unsigned char ch = ptr[pos];
|
104
|
+
unsigned char ch_len = escape_table[ch];
|
105
|
+
/* JSON encoding */
|
106
|
+
|
107
|
+
if (RB_UNLIKELY(ch_len)) {
|
108
|
+
switch (ch_len) {
|
109
|
+
case 1: {
|
110
|
+
FLUSH_POS(1);
|
111
|
+
switch (ch) {
|
112
|
+
case '"': fbuffer_append(out_buffer, "\\\"", 2); break;
|
113
|
+
case '\\': fbuffer_append(out_buffer, "\\\\", 2); break;
|
114
|
+
case '/': fbuffer_append(out_buffer, "\\/", 2); break;
|
115
|
+
case '\b': fbuffer_append(out_buffer, "\\b", 2); break;
|
116
|
+
case '\f': fbuffer_append(out_buffer, "\\f", 2); break;
|
117
|
+
case '\n': fbuffer_append(out_buffer, "\\n", 2); break;
|
118
|
+
case '\r': fbuffer_append(out_buffer, "\\r", 2); break;
|
119
|
+
case '\t': fbuffer_append(out_buffer, "\\t", 2); break;
|
120
|
+
default: {
|
121
|
+
scratch[2] = '0';
|
122
|
+
scratch[3] = '0';
|
123
|
+
scratch[4] = hexdig[(ch >> 4) & 0xf];
|
124
|
+
scratch[5] = hexdig[ch & 0xf];
|
125
|
+
fbuffer_append(out_buffer, scratch, 6);
|
126
|
+
break;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
break;
|
130
|
+
}
|
131
|
+
case 3: {
|
132
|
+
unsigned char b2 = ptr[pos + 1];
|
133
|
+
if (RB_UNLIKELY(out_script_safe && b2 == 0x80)) {
|
134
|
+
unsigned char b3 = ptr[pos + 2];
|
135
|
+
if (b3 == 0xA8) {
|
136
|
+
FLUSH_POS(3);
|
137
|
+
fbuffer_append(out_buffer, "\\u2028", 6);
|
138
|
+
break;
|
139
|
+
} else if (b3 == 0xA9) {
|
140
|
+
FLUSH_POS(3);
|
141
|
+
fbuffer_append(out_buffer, "\\u2029", 6);
|
142
|
+
break;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
// fallthrough
|
146
|
+
}
|
147
|
+
default:
|
148
|
+
pos += ch_len;
|
149
|
+
break;
|
150
|
+
}
|
151
|
+
} else {
|
152
|
+
pos++;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
#undef FLUSH_POS
|
156
|
+
|
157
|
+
if (beg < len) {
|
158
|
+
fbuffer_append(out_buffer, &ptr[beg], len - beg);
|
159
|
+
}
|
160
|
+
|
161
|
+
RB_GC_GUARD(str);
|
162
|
+
}
|
163
|
+
|
164
|
+
static const char escape_table[256] = {
|
165
|
+
// ASCII Control Characters
|
166
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
167
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
168
|
+
// ASCII Characters
|
169
|
+
0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, // '"'
|
170
|
+
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
171
|
+
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
172
|
+
0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, // '\\'
|
173
|
+
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
174
|
+
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
175
|
+
// Continuation byte
|
176
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
177
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
178
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
179
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
180
|
+
// First byte of a 2-byte code point
|
181
|
+
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
182
|
+
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
183
|
+
// First byte of a 4-byte code point
|
184
|
+
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
|
185
|
+
//First byte of a 4+byte code point
|
186
|
+
4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1,
|
187
|
+
};
|
188
|
+
|
189
|
+
static const char script_safe_escape_table[256] = {
|
190
|
+
// ASCII Control Characters
|
191
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
192
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
193
|
+
// ASCII Characters
|
194
|
+
0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1, // '"' and '/'
|
195
|
+
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
196
|
+
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
197
|
+
0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, // '\\'
|
198
|
+
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
199
|
+
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
200
|
+
// Continuation byte
|
201
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
202
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
203
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
204
|
+
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
205
|
+
// First byte of a 2-byte code point
|
206
|
+
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
207
|
+
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
208
|
+
// First byte of a 4-byte code point
|
209
|
+
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
|
210
|
+
//First byte of a 4+byte code point
|
211
|
+
4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1,
|
212
|
+
};
|
213
|
+
|
214
|
+
static void convert_ASCII_to_JSON(FBuffer *out_buffer, VALUE str, const char escape_table[256])
|
215
|
+
{
|
216
|
+
const char *hexdig = "0123456789abcdef";
|
217
|
+
char scratch[12] = { '\\', 'u', 0, 0, 0, 0, '\\', 'u' };
|
218
|
+
|
219
|
+
const char *ptr = RSTRING_PTR(str);
|
220
|
+
unsigned long len = RSTRING_LEN(str);
|
221
|
+
|
222
|
+
unsigned long beg = 0, pos;
|
223
|
+
|
224
|
+
for (pos = 0; pos < len;) {
|
225
|
+
unsigned char ch = ptr[pos];
|
226
|
+
/* JSON encoding */
|
227
|
+
if (escape_table[ch]) {
|
228
|
+
if (pos > beg) {
|
229
|
+
fbuffer_append(out_buffer, &ptr[beg], pos - beg);
|
230
|
+
}
|
231
|
+
|
232
|
+
beg = pos + 1;
|
233
|
+
switch (ch) {
|
234
|
+
case '"': fbuffer_append(out_buffer, "\\\"", 2); break;
|
235
|
+
case '\\': fbuffer_append(out_buffer, "\\\\", 2); break;
|
236
|
+
case '/': fbuffer_append(out_buffer, "\\/", 2); break;
|
237
|
+
case '\b': fbuffer_append(out_buffer, "\\b", 2); break;
|
238
|
+
case '\f': fbuffer_append(out_buffer, "\\f", 2); break;
|
239
|
+
case '\n': fbuffer_append(out_buffer, "\\n", 2); break;
|
240
|
+
case '\r': fbuffer_append(out_buffer, "\\r", 2); break;
|
241
|
+
case '\t': fbuffer_append(out_buffer, "\\t", 2); break;
|
242
|
+
default:
|
243
|
+
scratch[2] = '0';
|
244
|
+
scratch[3] = '0';
|
245
|
+
scratch[4] = hexdig[(ch >> 4) & 0xf];
|
246
|
+
scratch[5] = hexdig[ch & 0xf];
|
247
|
+
fbuffer_append(out_buffer, scratch, 6);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
pos++;
|
252
|
+
}
|
253
|
+
|
254
|
+
if (beg < len) {
|
255
|
+
fbuffer_append(out_buffer, &ptr[beg], len - beg);
|
256
|
+
}
|
257
|
+
|
258
|
+
RB_GC_GUARD(str);
|
259
|
+
}
|
260
|
+
|
261
|
+
static void convert_UTF8_to_ASCII_only_JSON(FBuffer *out_buffer, VALUE str, const char escape_table[256], bool out_script_safe)
|
262
|
+
{
|
263
|
+
const char *hexdig = "0123456789abcdef";
|
264
|
+
char scratch[12] = { '\\', 'u', 0, 0, 0, 0, '\\', 'u' };
|
265
|
+
|
266
|
+
const char *ptr = RSTRING_PTR(str);
|
267
|
+
unsigned long len = RSTRING_LEN(str);
|
268
|
+
|
269
|
+
unsigned long beg = 0, pos = 0;
|
270
|
+
|
271
|
+
#define FLUSH_POS(bytes) if (pos > beg) { fbuffer_append(out_buffer, &ptr[beg], pos - beg); } pos += bytes; beg = pos;
|
272
|
+
|
273
|
+
while (pos < len) {
|
274
|
+
unsigned char ch = ptr[pos];
|
275
|
+
unsigned char ch_len = escape_table[ch];
|
276
|
+
|
277
|
+
if (RB_UNLIKELY(ch_len)) {
|
278
|
+
switch (ch_len) {
|
279
|
+
case 1: {
|
280
|
+
FLUSH_POS(1);
|
281
|
+
switch (ch) {
|
282
|
+
case '"': fbuffer_append(out_buffer, "\\\"", 2); break;
|
283
|
+
case '\\': fbuffer_append(out_buffer, "\\\\", 2); break;
|
284
|
+
case '/': fbuffer_append(out_buffer, "\\/", 2); break;
|
285
|
+
case '\b': fbuffer_append(out_buffer, "\\b", 2); break;
|
286
|
+
case '\f': fbuffer_append(out_buffer, "\\f", 2); break;
|
287
|
+
case '\n': fbuffer_append(out_buffer, "\\n", 2); break;
|
288
|
+
case '\r': fbuffer_append(out_buffer, "\\r", 2); break;
|
289
|
+
case '\t': fbuffer_append(out_buffer, "\\t", 2); break;
|
290
|
+
default: {
|
291
|
+
scratch[2] = '0';
|
292
|
+
scratch[3] = '0';
|
293
|
+
scratch[4] = hexdig[(ch >> 4) & 0xf];
|
294
|
+
scratch[5] = hexdig[ch & 0xf];
|
295
|
+
fbuffer_append(out_buffer, scratch, 6);
|
296
|
+
break;
|
297
|
+
}
|
298
|
+
}
|
299
|
+
break;
|
300
|
+
}
|
301
|
+
default: {
|
302
|
+
uint32_t wchar = 0;
|
303
|
+
switch(ch_len) {
|
304
|
+
case 2:
|
305
|
+
wchar = ptr[pos] & 0x1F;
|
306
|
+
break;
|
307
|
+
case 3:
|
308
|
+
wchar = ptr[pos] & 0x0F;
|
309
|
+
break;
|
310
|
+
case 4:
|
311
|
+
wchar = ptr[pos] & 0x07;
|
312
|
+
break;
|
313
|
+
}
|
314
|
+
|
315
|
+
for (short i = 1; i < ch_len; i++) {
|
316
|
+
wchar = (wchar << 6) | (ptr[pos+i] & 0x3F);
|
317
|
+
}
|
318
|
+
|
319
|
+
FLUSH_POS(ch_len);
|
320
|
+
|
321
|
+
if (wchar <= 0xFFFF) {
|
322
|
+
scratch[2] = hexdig[wchar >> 12];
|
323
|
+
scratch[3] = hexdig[(wchar >> 8) & 0xf];
|
324
|
+
scratch[4] = hexdig[(wchar >> 4) & 0xf];
|
325
|
+
scratch[5] = hexdig[wchar & 0xf];
|
326
|
+
fbuffer_append(out_buffer, scratch, 6);
|
327
|
+
} else {
|
328
|
+
uint16_t hi, lo;
|
329
|
+
wchar -= 0x10000;
|
330
|
+
hi = 0xD800 + (uint16_t)(wchar >> 10);
|
331
|
+
lo = 0xDC00 + (uint16_t)(wchar & 0x3FF);
|
332
|
+
|
333
|
+
scratch[2] = hexdig[hi >> 12];
|
334
|
+
scratch[3] = hexdig[(hi >> 8) & 0xf];
|
335
|
+
scratch[4] = hexdig[(hi >> 4) & 0xf];
|
336
|
+
scratch[5] = hexdig[hi & 0xf];
|
337
|
+
|
338
|
+
scratch[8] = hexdig[lo >> 12];
|
339
|
+
scratch[9] = hexdig[(lo >> 8) & 0xf];
|
340
|
+
scratch[10] = hexdig[(lo >> 4) & 0xf];
|
341
|
+
scratch[11] = hexdig[lo & 0xf];
|
342
|
+
|
343
|
+
fbuffer_append(out_buffer, scratch, 12);
|
344
|
+
}
|
345
|
+
|
346
|
+
break;
|
347
|
+
}
|
348
|
+
}
|
349
|
+
} else {
|
350
|
+
pos++;
|
351
|
+
}
|
352
|
+
}
|
353
|
+
#undef FLUSH_POS
|
354
|
+
|
355
|
+
if (beg < len) {
|
356
|
+
fbuffer_append(out_buffer, &ptr[beg], len - beg);
|
357
|
+
}
|
358
|
+
|
359
|
+
RB_GC_GUARD(str);
|
360
|
+
}
|
361
|
+
|
362
|
+
/*
|
363
|
+
* Document-module: JSON::Ext::Generator
|
364
|
+
*
|
365
|
+
* This is the JSON generator implemented as a C extension. It can be
|
366
|
+
* configured to be used by setting
|
367
|
+
*
|
368
|
+
* JSON.generator = JSON::Ext::Generator
|
369
|
+
*
|
370
|
+
* with the method generator= in JSON.
|
371
|
+
*
|
372
|
+
*/
|
373
|
+
|
374
|
+
/* Explanation of the following: that's the only way to not pollute
|
375
|
+
* standard library's docs with GeneratorMethods::<ClassName> which
|
376
|
+
* are uninformative and take a large place in a list of classes
|
377
|
+
*/
|
378
|
+
|
379
|
+
/*
|
380
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods
|
381
|
+
* :nodoc:
|
382
|
+
*/
|
383
|
+
|
384
|
+
/*
|
385
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::Array
|
386
|
+
* :nodoc:
|
387
|
+
*/
|
388
|
+
|
389
|
+
/*
|
390
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::Bignum
|
391
|
+
* :nodoc:
|
392
|
+
*/
|
393
|
+
|
394
|
+
/*
|
395
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::FalseClass
|
396
|
+
* :nodoc:
|
397
|
+
*/
|
398
|
+
|
399
|
+
/*
|
400
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::Fixnum
|
401
|
+
* :nodoc:
|
402
|
+
*/
|
403
|
+
|
404
|
+
/*
|
405
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::Float
|
406
|
+
* :nodoc:
|
407
|
+
*/
|
408
|
+
|
409
|
+
/*
|
410
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::Hash
|
411
|
+
* :nodoc:
|
412
|
+
*/
|
413
|
+
|
414
|
+
/*
|
415
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::Integer
|
416
|
+
* :nodoc:
|
417
|
+
*/
|
418
|
+
|
419
|
+
/*
|
420
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::NilClass
|
421
|
+
* :nodoc:
|
422
|
+
*/
|
423
|
+
|
424
|
+
/*
|
425
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::Object
|
426
|
+
* :nodoc:
|
427
|
+
*/
|
428
|
+
|
429
|
+
/*
|
430
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::String
|
431
|
+
* :nodoc:
|
432
|
+
*/
|
433
|
+
|
434
|
+
/*
|
435
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::String::Extend
|
436
|
+
* :nodoc:
|
437
|
+
*/
|
438
|
+
|
439
|
+
/*
|
440
|
+
* Document-module: JSON::Ext::Generator::GeneratorMethods::TrueClass
|
441
|
+
* :nodoc:
|
442
|
+
*/
|
443
|
+
|
444
|
+
/*
|
445
|
+
* call-seq: to_json(state = nil)
|
446
|
+
*
|
447
|
+
* Returns a JSON string containing a JSON object, that is generated from
|
448
|
+
* this Hash instance.
|
449
|
+
* _state_ is a JSON::State object, that can also be used to configure the
|
450
|
+
* produced JSON string output further.
|
451
|
+
*/
|
452
|
+
static VALUE mHash_to_json(int argc, VALUE *argv, VALUE self)
|
453
|
+
{
|
454
|
+
rb_check_arity(argc, 0, 1);
|
455
|
+
VALUE Vstate = cState_from_state_s(cState, argc == 1 ? argv[0] : Qnil);
|
456
|
+
return cState_partial_generate(Vstate, self, generate_json_object);
|
457
|
+
}
|
458
|
+
|
459
|
+
/*
|
460
|
+
* call-seq: to_json(state = nil)
|
461
|
+
*
|
462
|
+
* Returns a JSON string containing a JSON array, that is generated from
|
463
|
+
* this Array instance.
|
464
|
+
* _state_ is a JSON::State object, that can also be used to configure the
|
465
|
+
* produced JSON string output further.
|
466
|
+
*/
|
467
|
+
static VALUE mArray_to_json(int argc, VALUE *argv, VALUE self) {
|
468
|
+
rb_check_arity(argc, 0, 1);
|
469
|
+
VALUE Vstate = cState_from_state_s(cState, argc == 1 ? argv[0] : Qnil);
|
470
|
+
return cState_partial_generate(Vstate, self, generate_json_array);
|
471
|
+
}
|
472
|
+
|
473
|
+
#ifdef RUBY_INTEGER_UNIFICATION
|
474
|
+
/*
|
475
|
+
* call-seq: to_json(*)
|
476
|
+
*
|
477
|
+
* Returns a JSON string representation for this Integer number.
|
478
|
+
*/
|
479
|
+
static VALUE mInteger_to_json(int argc, VALUE *argv, VALUE self)
|
480
|
+
{
|
481
|
+
rb_check_arity(argc, 0, 1);
|
482
|
+
VALUE Vstate = cState_from_state_s(cState, argc == 1 ? argv[0] : Qnil);
|
483
|
+
return cState_partial_generate(Vstate, self, generate_json_integer);
|
484
|
+
}
|
485
|
+
|
486
|
+
#else
|
487
|
+
/*
|
488
|
+
* call-seq: to_json(*)
|
489
|
+
*
|
490
|
+
* Returns a JSON string representation for this Integer number.
|
491
|
+
*/
|
492
|
+
static VALUE mFixnum_to_json(int argc, VALUE *argv, VALUE self)
|
493
|
+
{
|
494
|
+
rb_check_arity(argc, 0, 1);
|
495
|
+
VALUE Vstate = cState_from_state_s(cState, argc == 1 ? argv[0] : Qnil);
|
496
|
+
return cState_partial_generate(Vstate, self, generate_json_fixnum);
|
497
|
+
}
|
498
|
+
|
499
|
+
/*
|
500
|
+
* call-seq: to_json(*)
|
501
|
+
*
|
502
|
+
* Returns a JSON string representation for this Integer number.
|
503
|
+
*/
|
504
|
+
static VALUE mBignum_to_json(int argc, VALUE *argv, VALUE self)
|
505
|
+
{
|
506
|
+
rb_check_arity(argc, 0, 1);
|
507
|
+
VALUE Vstate = cState_from_state_s(cState, argc == 1 ? argv[0] : Qnil);
|
508
|
+
return cState_partial_generate(Vstate, self, generate_json_bignum);
|
509
|
+
}
|
510
|
+
#endif
|
511
|
+
|
512
|
+
/*
|
513
|
+
* call-seq: to_json(*)
|
514
|
+
*
|
515
|
+
* Returns a JSON string representation for this Float number.
|
516
|
+
*/
|
517
|
+
static VALUE mFloat_to_json(int argc, VALUE *argv, VALUE self)
|
518
|
+
{
|
519
|
+
rb_check_arity(argc, 0, 1);
|
520
|
+
VALUE Vstate = cState_from_state_s(cState, argc == 1 ? argv[0] : Qnil);
|
521
|
+
return cState_partial_generate(Vstate, self, generate_json_float);
|
522
|
+
}
|
523
|
+
|
524
|
+
/*
|
525
|
+
* call-seq: String.included(modul)
|
526
|
+
*
|
527
|
+
* Extends _modul_ with the String::Extend module.
|
528
|
+
*/
|
529
|
+
static VALUE mString_included_s(VALUE self, VALUE modul) {
|
530
|
+
VALUE result = rb_funcall(modul, i_extend, 1, mString_Extend);
|
531
|
+
rb_call_super(1, &modul);
|
532
|
+
return result;
|
533
|
+
}
|
534
|
+
|
535
|
+
/*
|
536
|
+
* call-seq: to_json(*)
|
537
|
+
*
|
538
|
+
* This string should be encoded with UTF-8 A call to this method
|
539
|
+
* returns a JSON string encoded with UTF16 big endian characters as
|
540
|
+
* \u????.
|
541
|
+
*/
|
542
|
+
static VALUE mString_to_json(int argc, VALUE *argv, VALUE self)
|
543
|
+
{
|
544
|
+
rb_check_arity(argc, 0, 1);
|
545
|
+
VALUE Vstate = cState_from_state_s(cState, argc == 1 ? argv[0] : Qnil);
|
546
|
+
return cState_partial_generate(Vstate, self, generate_json_string);
|
547
|
+
}
|
548
|
+
|
549
|
+
/*
|
550
|
+
* call-seq: to_json_raw_object()
|
551
|
+
*
|
552
|
+
* This method creates a raw object hash, that can be nested into
|
553
|
+
* other data structures and will be generated as a raw string. This
|
554
|
+
* method should be used, if you want to convert raw strings to JSON
|
555
|
+
* instead of UTF-8 strings, e. g. binary data.
|
556
|
+
*/
|
557
|
+
static VALUE mString_to_json_raw_object(VALUE self)
|
558
|
+
{
|
559
|
+
VALUE ary;
|
560
|
+
VALUE result = rb_hash_new();
|
561
|
+
rb_hash_aset(result, rb_funcall(mJSON, i_create_id, 0), rb_class_name(rb_obj_class(self)));
|
562
|
+
ary = rb_funcall(self, i_unpack, 1, rb_str_new2("C*"));
|
563
|
+
rb_hash_aset(result, rb_utf8_str_new_lit("raw"), ary);
|
564
|
+
return result;
|
565
|
+
}
|
566
|
+
|
567
|
+
/*
|
568
|
+
* call-seq: to_json_raw(*args)
|
569
|
+
*
|
570
|
+
* This method creates a JSON text from the result of a call to
|
571
|
+
* to_json_raw_object of this String.
|
572
|
+
*/
|
573
|
+
static VALUE mString_to_json_raw(int argc, VALUE *argv, VALUE self)
|
574
|
+
{
|
575
|
+
VALUE obj = mString_to_json_raw_object(self);
|
576
|
+
Check_Type(obj, T_HASH);
|
577
|
+
return mHash_to_json(argc, argv, obj);
|
578
|
+
}
|
579
|
+
|
580
|
+
/*
|
581
|
+
* call-seq: json_create(o)
|
582
|
+
*
|
583
|
+
* Raw Strings are JSON Objects (the raw bytes are stored in an array for the
|
584
|
+
* key "raw"). The Ruby String can be created by this module method.
|
585
|
+
*/
|
586
|
+
static VALUE mString_Extend_json_create(VALUE self, VALUE o)
|
587
|
+
{
|
588
|
+
VALUE ary;
|
589
|
+
Check_Type(o, T_HASH);
|
590
|
+
ary = rb_hash_aref(o, rb_str_new2("raw"));
|
591
|
+
return rb_funcall(ary, i_pack, 1, rb_str_new2("C*"));
|
592
|
+
}
|
593
|
+
|
594
|
+
/*
|
595
|
+
* call-seq: to_json(*)
|
596
|
+
*
|
597
|
+
* Returns a JSON string for true: 'true'.
|
598
|
+
*/
|
599
|
+
static VALUE mTrueClass_to_json(int argc, VALUE *argv, VALUE self)
|
600
|
+
{
|
601
|
+
rb_check_arity(argc, 0, 1);
|
602
|
+
return rb_utf8_str_new("true", 4);
|
603
|
+
}
|
604
|
+
|
605
|
+
/*
|
606
|
+
* call-seq: to_json(*)
|
607
|
+
*
|
608
|
+
* Returns a JSON string for false: 'false'.
|
609
|
+
*/
|
610
|
+
static VALUE mFalseClass_to_json(int argc, VALUE *argv, VALUE self)
|
611
|
+
{
|
612
|
+
rb_check_arity(argc, 0, 1);
|
613
|
+
return rb_utf8_str_new("false", 5);
|
614
|
+
}
|
615
|
+
|
616
|
+
/*
|
617
|
+
* call-seq: to_json(*)
|
618
|
+
*
|
619
|
+
* Returns a JSON string for nil: 'null'.
|
620
|
+
*/
|
621
|
+
static VALUE mNilClass_to_json(int argc, VALUE *argv, VALUE self)
|
622
|
+
{
|
623
|
+
rb_check_arity(argc, 0, 1);
|
624
|
+
return rb_utf8_str_new("null", 4);
|
625
|
+
}
|
626
|
+
|
627
|
+
/*
|
628
|
+
* call-seq: to_json(*)
|
629
|
+
*
|
630
|
+
* Converts this object to a string (calling #to_s), converts
|
631
|
+
* it to a JSON string, and returns the result. This is a fallback, if no
|
632
|
+
* special method #to_json was defined for some object.
|
633
|
+
*/
|
634
|
+
static VALUE mObject_to_json(int argc, VALUE *argv, VALUE self)
|
635
|
+
{
|
636
|
+
VALUE state;
|
637
|
+
VALUE string = rb_funcall(self, i_to_s, 0);
|
638
|
+
rb_scan_args(argc, argv, "01", &state);
|
639
|
+
Check_Type(string, T_STRING);
|
640
|
+
state = cState_from_state_s(cState, state);
|
641
|
+
return cState_partial_generate(state, string, generate_json_string);
|
642
|
+
}
|
643
|
+
|
644
|
+
static void State_mark(void *ptr)
|
645
|
+
{
|
646
|
+
JSON_Generator_State *state = ptr;
|
647
|
+
rb_gc_mark_movable(state->indent);
|
648
|
+
rb_gc_mark_movable(state->space);
|
649
|
+
rb_gc_mark_movable(state->space_before);
|
650
|
+
rb_gc_mark_movable(state->object_nl);
|
651
|
+
rb_gc_mark_movable(state->array_nl);
|
652
|
+
}
|
653
|
+
|
654
|
+
static void State_compact(void *ptr)
|
655
|
+
{
|
656
|
+
JSON_Generator_State *state = ptr;
|
657
|
+
state->indent = rb_gc_location(state->indent);
|
658
|
+
state->space = rb_gc_location(state->space);
|
659
|
+
state->space_before = rb_gc_location(state->space_before);
|
660
|
+
state->object_nl = rb_gc_location(state->object_nl);
|
661
|
+
state->array_nl = rb_gc_location(state->array_nl);
|
662
|
+
}
|
663
|
+
|
664
|
+
static void State_free(void *ptr)
|
665
|
+
{
|
666
|
+
JSON_Generator_State *state = ptr;
|
667
|
+
ruby_xfree(state);
|
668
|
+
}
|
669
|
+
|
670
|
+
static size_t State_memsize(const void *ptr)
|
671
|
+
{
|
672
|
+
return sizeof(JSON_Generator_State);
|
673
|
+
}
|
674
|
+
|
675
|
+
#ifndef HAVE_RB_EXT_RACTOR_SAFE
|
676
|
+
# undef RUBY_TYPED_FROZEN_SHAREABLE
|
677
|
+
# define RUBY_TYPED_FROZEN_SHAREABLE 0
|
678
|
+
#endif
|
679
|
+
|
680
|
+
static const rb_data_type_t JSON_Generator_State_type = {
|
681
|
+
"JSON/Generator/State",
|
682
|
+
{
|
683
|
+
.dmark = State_mark,
|
684
|
+
.dfree = State_free,
|
685
|
+
.dsize = State_memsize,
|
686
|
+
.dcompact = State_compact,
|
687
|
+
},
|
688
|
+
0, 0,
|
689
|
+
RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_FROZEN_SHAREABLE,
|
690
|
+
};
|
691
|
+
|
692
|
+
static void state_init(JSON_Generator_State *state)
|
693
|
+
{
|
694
|
+
state->max_nesting = 100;
|
695
|
+
state->buffer_initial_length = FBUFFER_INITIAL_LENGTH_DEFAULT;
|
696
|
+
}
|
697
|
+
|
698
|
+
static VALUE cState_s_allocate(VALUE klass)
|
699
|
+
{
|
700
|
+
JSON_Generator_State *state;
|
701
|
+
VALUE obj = TypedData_Make_Struct(klass, JSON_Generator_State, &JSON_Generator_State_type, state);
|
702
|
+
state_init(state);
|
703
|
+
return obj;
|
704
|
+
}
|
705
|
+
|
706
|
+
static void vstate_spill(struct generate_json_data *data)
|
707
|
+
{
|
708
|
+
VALUE vstate = cState_s_allocate(cState);
|
709
|
+
GET_STATE(vstate);
|
710
|
+
MEMCPY(state, data->state, JSON_Generator_State, 1);
|
711
|
+
data->state = state;
|
712
|
+
data->vstate = vstate;
|
713
|
+
RB_OBJ_WRITTEN(vstate, Qundef, state->indent);
|
714
|
+
RB_OBJ_WRITTEN(vstate, Qundef, state->space);
|
715
|
+
RB_OBJ_WRITTEN(vstate, Qundef, state->space_before);
|
716
|
+
RB_OBJ_WRITTEN(vstate, Qundef, state->object_nl);
|
717
|
+
RB_OBJ_WRITTEN(vstate, Qundef, state->array_nl);
|
718
|
+
}
|
719
|
+
|
720
|
+
static inline VALUE vstate_get(struct generate_json_data *data)
|
721
|
+
{
|
722
|
+
if (RB_UNLIKELY(!data->vstate)) {
|
723
|
+
vstate_spill(data);
|
724
|
+
}
|
725
|
+
return data->vstate;
|
726
|
+
}
|
727
|
+
|
728
|
+
struct hash_foreach_arg {
|
729
|
+
struct generate_json_data *data;
|
730
|
+
int iter;
|
731
|
+
};
|
732
|
+
|
733
|
+
static int
|
734
|
+
json_object_i(VALUE key, VALUE val, VALUE _arg)
|
735
|
+
{
|
736
|
+
struct hash_foreach_arg *arg = (struct hash_foreach_arg *)_arg;
|
737
|
+
struct generate_json_data *data = arg->data;
|
738
|
+
|
739
|
+
FBuffer *buffer = data->buffer;
|
740
|
+
JSON_Generator_State *state = data->state;
|
741
|
+
|
742
|
+
long depth = state->depth;
|
743
|
+
int j;
|
744
|
+
|
745
|
+
if (arg->iter > 0) fbuffer_append_char(buffer, ',');
|
746
|
+
if (RB_UNLIKELY(state->object_nl)) {
|
747
|
+
fbuffer_append_str(buffer, state->object_nl);
|
748
|
+
}
|
749
|
+
if (RB_UNLIKELY(state->indent)) {
|
750
|
+
for (j = 0; j < depth; j++) {
|
751
|
+
fbuffer_append_str(buffer, state->indent);
|
752
|
+
}
|
753
|
+
}
|
754
|
+
|
755
|
+
VALUE key_to_s;
|
756
|
+
switch(rb_type(key)) {
|
757
|
+
case T_STRING:
|
758
|
+
if (RB_LIKELY(RBASIC_CLASS(key) == rb_cString)) {
|
759
|
+
key_to_s = key;
|
760
|
+
} else {
|
761
|
+
key_to_s = rb_funcall(key, i_to_s, 0);
|
762
|
+
}
|
763
|
+
break;
|
764
|
+
case T_SYMBOL:
|
765
|
+
key_to_s = rb_sym2str(key);
|
766
|
+
break;
|
767
|
+
default:
|
768
|
+
key_to_s = rb_convert_type(key, T_STRING, "String", "to_s");
|
769
|
+
break;
|
770
|
+
}
|
771
|
+
|
772
|
+
if (RB_LIKELY(RBASIC_CLASS(key_to_s) == rb_cString)) {
|
773
|
+
generate_json_string(buffer, data, state, key_to_s);
|
774
|
+
} else {
|
775
|
+
generate_json(buffer, data, state, key_to_s);
|
776
|
+
}
|
777
|
+
if (RB_UNLIKELY(state->space_before)) fbuffer_append_str(buffer, state->space_before);
|
778
|
+
fbuffer_append_char(buffer, ':');
|
779
|
+
if (RB_UNLIKELY(state->space)) fbuffer_append_str(buffer, state->space);
|
780
|
+
generate_json(buffer, data, state, val);
|
781
|
+
|
782
|
+
arg->iter++;
|
783
|
+
return ST_CONTINUE;
|
784
|
+
}
|
785
|
+
|
786
|
+
static void generate_json_object(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
787
|
+
{
|
788
|
+
long max_nesting = state->max_nesting;
|
789
|
+
long depth = ++state->depth;
|
790
|
+
int j;
|
791
|
+
|
792
|
+
if (max_nesting != 0 && depth > max_nesting) {
|
793
|
+
rb_raise(eNestingError, "nesting of %ld is too deep", --state->depth);
|
794
|
+
}
|
795
|
+
|
796
|
+
if (RHASH_SIZE(obj) == 0) {
|
797
|
+
fbuffer_append(buffer, "{}", 2);
|
798
|
+
--state->depth;
|
799
|
+
return;
|
800
|
+
}
|
801
|
+
|
802
|
+
fbuffer_append_char(buffer, '{');
|
803
|
+
|
804
|
+
struct hash_foreach_arg arg = {
|
805
|
+
.data = data,
|
806
|
+
.iter = 0,
|
807
|
+
};
|
808
|
+
rb_hash_foreach(obj, json_object_i, (VALUE)&arg);
|
809
|
+
|
810
|
+
depth = --state->depth;
|
811
|
+
if (RB_UNLIKELY(state->object_nl)) {
|
812
|
+
fbuffer_append_str(buffer, state->object_nl);
|
813
|
+
if (RB_UNLIKELY(state->indent)) {
|
814
|
+
for (j = 0; j < depth; j++) {
|
815
|
+
fbuffer_append_str(buffer, state->indent);
|
816
|
+
}
|
817
|
+
}
|
818
|
+
}
|
819
|
+
fbuffer_append_char(buffer, '}');
|
820
|
+
}
|
821
|
+
|
822
|
+
static void generate_json_array(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
823
|
+
{
|
824
|
+
long max_nesting = state->max_nesting;
|
825
|
+
long depth = ++state->depth;
|
826
|
+
int i, j;
|
827
|
+
if (max_nesting != 0 && depth > max_nesting) {
|
828
|
+
rb_raise(eNestingError, "nesting of %ld is too deep", --state->depth);
|
829
|
+
}
|
830
|
+
|
831
|
+
if (RARRAY_LEN(obj) == 0) {
|
832
|
+
fbuffer_append(buffer, "[]", 2);
|
833
|
+
--state->depth;
|
834
|
+
return;
|
835
|
+
}
|
836
|
+
|
837
|
+
fbuffer_append_char(buffer, '[');
|
838
|
+
if (RB_UNLIKELY(state->array_nl)) fbuffer_append_str(buffer, state->array_nl);
|
839
|
+
for(i = 0; i < RARRAY_LEN(obj); i++) {
|
840
|
+
if (i > 0) {
|
841
|
+
fbuffer_append_char(buffer, ',');
|
842
|
+
if (RB_UNLIKELY(state->array_nl)) fbuffer_append_str(buffer, state->array_nl);
|
843
|
+
}
|
844
|
+
if (RB_UNLIKELY(state->indent)) {
|
845
|
+
for (j = 0; j < depth; j++) {
|
846
|
+
fbuffer_append_str(buffer, state->indent);
|
847
|
+
}
|
848
|
+
}
|
849
|
+
generate_json(buffer, data, state, RARRAY_AREF(obj, i));
|
850
|
+
}
|
851
|
+
state->depth = --depth;
|
852
|
+
if (RB_UNLIKELY(state->array_nl)) {
|
853
|
+
fbuffer_append_str(buffer, state->array_nl);
|
854
|
+
if (RB_UNLIKELY(state->indent)) {
|
855
|
+
for (j = 0; j < depth; j++) {
|
856
|
+
fbuffer_append_str(buffer, state->indent);
|
857
|
+
}
|
858
|
+
}
|
859
|
+
}
|
860
|
+
fbuffer_append_char(buffer, ']');
|
861
|
+
}
|
862
|
+
|
863
|
+
static inline int enc_utf8_compatible_p(int enc_idx)
|
864
|
+
{
|
865
|
+
if (enc_idx == usascii_encindex) return 1;
|
866
|
+
if (enc_idx == utf8_encindex) return 1;
|
867
|
+
return 0;
|
868
|
+
}
|
869
|
+
|
870
|
+
static inline VALUE ensure_valid_encoding(VALUE str)
|
871
|
+
{
|
872
|
+
int encindex = RB_ENCODING_GET(str);
|
873
|
+
VALUE utf8_string;
|
874
|
+
if (RB_UNLIKELY(!enc_utf8_compatible_p(encindex))) {
|
875
|
+
if (encindex == binary_encindex) {
|
876
|
+
utf8_string = rb_enc_associate_index(rb_str_dup(str), utf8_encindex);
|
877
|
+
switch (rb_enc_str_coderange(utf8_string)) {
|
878
|
+
case ENC_CODERANGE_7BIT:
|
879
|
+
return utf8_string;
|
880
|
+
case ENC_CODERANGE_VALID:
|
881
|
+
// For historical reason, we silently reinterpret binary strings as UTF-8 if it would work.
|
882
|
+
// TODO: Raise in 3.0.0
|
883
|
+
rb_warn("JSON.generate: UTF-8 string passed as BINARY, this will raise an encoding error in json 3.0");
|
884
|
+
return utf8_string;
|
885
|
+
break;
|
886
|
+
}
|
887
|
+
}
|
888
|
+
|
889
|
+
str = rb_funcall(str, i_encode, 1, Encoding_UTF_8);
|
890
|
+
}
|
891
|
+
return str;
|
892
|
+
}
|
893
|
+
|
894
|
+
static void generate_json_string(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
895
|
+
{
|
896
|
+
obj = ensure_valid_encoding(obj);
|
897
|
+
|
898
|
+
fbuffer_append_char(buffer, '"');
|
899
|
+
|
900
|
+
switch(rb_enc_str_coderange(obj)) {
|
901
|
+
case ENC_CODERANGE_7BIT:
|
902
|
+
convert_ASCII_to_JSON(buffer, obj, state->script_safe ? script_safe_escape_table : escape_table);
|
903
|
+
break;
|
904
|
+
case ENC_CODERANGE_VALID:
|
905
|
+
if (RB_UNLIKELY(state->ascii_only)) {
|
906
|
+
convert_UTF8_to_ASCII_only_JSON(buffer, obj, state->script_safe ? script_safe_escape_table : escape_table, state->script_safe);
|
907
|
+
} else {
|
908
|
+
convert_UTF8_to_JSON(buffer, obj, state->script_safe ? script_safe_escape_table : escape_table, state->script_safe);
|
909
|
+
}
|
910
|
+
break;
|
911
|
+
default:
|
912
|
+
rb_raise(rb_path2class("JSON::GeneratorError"), "source sequence is illegal/malformed utf-8");
|
913
|
+
break;
|
914
|
+
}
|
915
|
+
fbuffer_append_char(buffer, '"');
|
916
|
+
}
|
917
|
+
|
918
|
+
static void generate_json_null(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
919
|
+
{
|
920
|
+
fbuffer_append(buffer, "null", 4);
|
921
|
+
}
|
922
|
+
|
923
|
+
static void generate_json_false(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
924
|
+
{
|
925
|
+
fbuffer_append(buffer, "false", 5);
|
926
|
+
}
|
927
|
+
|
928
|
+
static void generate_json_true(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
929
|
+
{
|
930
|
+
fbuffer_append(buffer, "true", 4);
|
931
|
+
}
|
932
|
+
|
933
|
+
static void generate_json_fixnum(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
934
|
+
{
|
935
|
+
fbuffer_append_long(buffer, FIX2LONG(obj));
|
936
|
+
}
|
937
|
+
|
938
|
+
static void generate_json_bignum(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
939
|
+
{
|
940
|
+
VALUE tmp = rb_funcall(obj, i_to_s, 0);
|
941
|
+
fbuffer_append_str(buffer, tmp);
|
942
|
+
}
|
943
|
+
|
944
|
+
#ifdef RUBY_INTEGER_UNIFICATION
|
945
|
+
static void generate_json_integer(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
946
|
+
{
|
947
|
+
if (FIXNUM_P(obj))
|
948
|
+
generate_json_fixnum(buffer, data, state, obj);
|
949
|
+
else
|
950
|
+
generate_json_bignum(buffer, data, state, obj);
|
951
|
+
}
|
952
|
+
#endif
|
953
|
+
|
954
|
+
static void generate_json_float(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
955
|
+
{
|
956
|
+
double value = RFLOAT_VALUE(obj);
|
957
|
+
char allow_nan = state->allow_nan;
|
958
|
+
VALUE tmp = rb_funcall(obj, i_to_s, 0);
|
959
|
+
if (!allow_nan) {
|
960
|
+
if (isinf(value)) {
|
961
|
+
rb_raise(eGeneratorError, "%"PRIsVALUE" not allowed in JSON", tmp);
|
962
|
+
} else if (isnan(value)) {
|
963
|
+
rb_raise(eGeneratorError, "%"PRIsVALUE" not allowed in JSON", tmp);
|
964
|
+
}
|
965
|
+
}
|
966
|
+
fbuffer_append_str(buffer, tmp);
|
967
|
+
}
|
968
|
+
|
969
|
+
static void generate_json(FBuffer *buffer, struct generate_json_data *data, JSON_Generator_State *state, VALUE obj)
|
970
|
+
{
|
971
|
+
VALUE tmp;
|
972
|
+
if (obj == Qnil) {
|
973
|
+
generate_json_null(buffer, data, state, obj);
|
974
|
+
} else if (obj == Qfalse) {
|
975
|
+
generate_json_false(buffer, data, state, obj);
|
976
|
+
} else if (obj == Qtrue) {
|
977
|
+
generate_json_true(buffer, data, state, obj);
|
978
|
+
} else if (RB_SPECIAL_CONST_P(obj)) {
|
979
|
+
if (RB_FIXNUM_P(obj)) {
|
980
|
+
generate_json_fixnum(buffer, data, state, obj);
|
981
|
+
} else if (RB_FLONUM_P(obj)) {
|
982
|
+
generate_json_float(buffer, data, state, obj);
|
983
|
+
} else {
|
984
|
+
goto general;
|
985
|
+
}
|
986
|
+
} else {
|
987
|
+
VALUE klass = RBASIC_CLASS(obj);
|
988
|
+
switch (RB_BUILTIN_TYPE(obj)) {
|
989
|
+
case T_BIGNUM:
|
990
|
+
generate_json_bignum(buffer, data, state, obj);
|
991
|
+
break;
|
992
|
+
case T_HASH:
|
993
|
+
if (klass != rb_cHash) goto general;
|
994
|
+
generate_json_object(buffer, data, state, obj);
|
995
|
+
break;
|
996
|
+
case T_ARRAY:
|
997
|
+
if (klass != rb_cArray) goto general;
|
998
|
+
generate_json_array(buffer, data, state, obj);
|
999
|
+
break;
|
1000
|
+
case T_STRING:
|
1001
|
+
if (klass != rb_cString) goto general;
|
1002
|
+
generate_json_string(buffer, data, state, obj);
|
1003
|
+
break;
|
1004
|
+
case T_FLOAT:
|
1005
|
+
if (klass != rb_cFloat) goto general;
|
1006
|
+
generate_json_float(buffer, data, state, obj);
|
1007
|
+
break;
|
1008
|
+
default:
|
1009
|
+
general:
|
1010
|
+
if (state->strict) {
|
1011
|
+
rb_raise(eGeneratorError, "%"PRIsVALUE" not allowed in JSON", CLASS_OF(obj));
|
1012
|
+
} else if (rb_respond_to(obj, i_to_json)) {
|
1013
|
+
tmp = rb_funcall(obj, i_to_json, 1, vstate_get(data));
|
1014
|
+
Check_Type(tmp, T_STRING);
|
1015
|
+
fbuffer_append_str(buffer, tmp);
|
1016
|
+
} else {
|
1017
|
+
tmp = rb_funcall(obj, i_to_s, 0);
|
1018
|
+
Check_Type(tmp, T_STRING);
|
1019
|
+
generate_json_string(buffer, data, state, tmp);
|
1020
|
+
}
|
1021
|
+
}
|
1022
|
+
}
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
static VALUE generate_json_try(VALUE d)
|
1026
|
+
{
|
1027
|
+
struct generate_json_data *data = (struct generate_json_data *)d;
|
1028
|
+
|
1029
|
+
data->func(data->buffer, data, data->state, data->obj);
|
1030
|
+
|
1031
|
+
return Qnil;
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
static VALUE generate_json_rescue(VALUE d, VALUE exc)
|
1035
|
+
{
|
1036
|
+
struct generate_json_data *data = (struct generate_json_data *)d;
|
1037
|
+
fbuffer_free(data->buffer);
|
1038
|
+
|
1039
|
+
if (RBASIC_CLASS(exc) == rb_path2class("Encoding::UndefinedConversionError")) {
|
1040
|
+
exc = rb_exc_new_str(eGeneratorError, rb_funcall(exc, rb_intern("message"), 0));
|
1041
|
+
}
|
1042
|
+
|
1043
|
+
rb_exc_raise(exc);
|
1044
|
+
|
1045
|
+
return Qundef;
|
1046
|
+
}
|
1047
|
+
|
1048
|
+
static VALUE cState_partial_generate(VALUE self, VALUE obj, generator_func func)
|
1049
|
+
{
|
1050
|
+
GET_STATE(self);
|
1051
|
+
|
1052
|
+
char stack_buffer[FBUFFER_STACK_SIZE];
|
1053
|
+
FBuffer buffer = {0};
|
1054
|
+
fbuffer_stack_init(&buffer, state->buffer_initial_length, stack_buffer, FBUFFER_STACK_SIZE);
|
1055
|
+
|
1056
|
+
struct generate_json_data data = {
|
1057
|
+
.buffer = &buffer,
|
1058
|
+
.vstate = self,
|
1059
|
+
.state = state,
|
1060
|
+
.obj = obj,
|
1061
|
+
.func = func
|
1062
|
+
};
|
1063
|
+
rb_rescue(generate_json_try, (VALUE)&data, generate_json_rescue, (VALUE)&data);
|
1064
|
+
|
1065
|
+
return fbuffer_to_s(&buffer);
|
1066
|
+
}
|
1067
|
+
|
1068
|
+
/*
|
1069
|
+
* call-seq: generate(obj)
|
1070
|
+
*
|
1071
|
+
* Generates a valid JSON document from object +obj+ and returns the
|
1072
|
+
* result. If no valid JSON document can be created this method raises a
|
1073
|
+
* GeneratorError exception.
|
1074
|
+
*/
|
1075
|
+
static VALUE cState_generate(VALUE self, VALUE obj)
|
1076
|
+
{
|
1077
|
+
VALUE result = cState_partial_generate(self, obj, generate_json);
|
1078
|
+
GET_STATE(self);
|
1079
|
+
(void)state;
|
1080
|
+
return result;
|
1081
|
+
}
|
1082
|
+
|
1083
|
+
static VALUE cState_initialize(int argc, VALUE *argv, VALUE self)
|
1084
|
+
{
|
1085
|
+
rb_warn("The json gem extension was loaded with the stdlib ruby code. You should upgrade rubygems with `gem update --system`");
|
1086
|
+
return self;
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
/*
|
1090
|
+
* call-seq: initialize_copy(orig)
|
1091
|
+
*
|
1092
|
+
* Initializes this object from orig if it can be duplicated/cloned and returns
|
1093
|
+
* it.
|
1094
|
+
*/
|
1095
|
+
static VALUE cState_init_copy(VALUE obj, VALUE orig)
|
1096
|
+
{
|
1097
|
+
JSON_Generator_State *objState, *origState;
|
1098
|
+
|
1099
|
+
if (obj == orig) return obj;
|
1100
|
+
GET_STATE_TO(obj, objState);
|
1101
|
+
GET_STATE_TO(orig, origState);
|
1102
|
+
if (!objState) rb_raise(rb_eArgError, "unallocated JSON::State");
|
1103
|
+
|
1104
|
+
MEMCPY(objState, origState, JSON_Generator_State, 1);
|
1105
|
+
objState->indent = origState->indent;
|
1106
|
+
objState->space = origState->space;
|
1107
|
+
objState->space_before = origState->space_before;
|
1108
|
+
objState->object_nl = origState->object_nl;
|
1109
|
+
objState->array_nl = origState->array_nl;
|
1110
|
+
return obj;
|
1111
|
+
}
|
1112
|
+
|
1113
|
+
/*
|
1114
|
+
* call-seq: from_state(opts)
|
1115
|
+
*
|
1116
|
+
* Creates a State object from _opts_, which ought to be Hash to create a
|
1117
|
+
* new State instance configured by _opts_, something else to create an
|
1118
|
+
* unconfigured instance. If _opts_ is a State object, it is just returned.
|
1119
|
+
*/
|
1120
|
+
static VALUE cState_from_state_s(VALUE self, VALUE opts)
|
1121
|
+
{
|
1122
|
+
if (rb_obj_is_kind_of(opts, self)) {
|
1123
|
+
return opts;
|
1124
|
+
} else if (rb_obj_is_kind_of(opts, rb_cHash)) {
|
1125
|
+
return rb_funcall(self, i_new, 1, opts);
|
1126
|
+
} else {
|
1127
|
+
return rb_class_new_instance(0, NULL, cState);
|
1128
|
+
}
|
1129
|
+
}
|
1130
|
+
|
1131
|
+
/*
|
1132
|
+
* call-seq: indent()
|
1133
|
+
*
|
1134
|
+
* Returns the string that is used to indent levels in the JSON text.
|
1135
|
+
*/
|
1136
|
+
static VALUE cState_indent(VALUE self)
|
1137
|
+
{
|
1138
|
+
GET_STATE(self);
|
1139
|
+
return state->indent ? state->indent : rb_str_freeze(rb_utf8_str_new("", 0));
|
1140
|
+
}
|
1141
|
+
|
1142
|
+
static VALUE string_config(VALUE config)
|
1143
|
+
{
|
1144
|
+
if (RTEST(config)) {
|
1145
|
+
Check_Type(config, T_STRING);
|
1146
|
+
if (RSTRING_LEN(config)) {
|
1147
|
+
return rb_str_new_frozen(config);
|
1148
|
+
}
|
1149
|
+
}
|
1150
|
+
return Qfalse;
|
1151
|
+
}
|
1152
|
+
|
1153
|
+
/*
|
1154
|
+
* call-seq: indent=(indent)
|
1155
|
+
*
|
1156
|
+
* Sets the string that is used to indent levels in the JSON text.
|
1157
|
+
*/
|
1158
|
+
static VALUE cState_indent_set(VALUE self, VALUE indent)
|
1159
|
+
{
|
1160
|
+
GET_STATE(self);
|
1161
|
+
RB_OBJ_WRITE(self, &state->indent, string_config(indent));
|
1162
|
+
return Qnil;
|
1163
|
+
}
|
1164
|
+
|
1165
|
+
/*
|
1166
|
+
* call-seq: space()
|
1167
|
+
*
|
1168
|
+
* Returns the string that is used to insert a space between the tokens in a JSON
|
1169
|
+
* string.
|
1170
|
+
*/
|
1171
|
+
static VALUE cState_space(VALUE self)
|
1172
|
+
{
|
1173
|
+
GET_STATE(self);
|
1174
|
+
return state->space ? state->space : rb_str_freeze(rb_utf8_str_new("", 0));
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
/*
|
1178
|
+
* call-seq: space=(space)
|
1179
|
+
*
|
1180
|
+
* Sets _space_ to the string that is used to insert a space between the tokens in a JSON
|
1181
|
+
* string.
|
1182
|
+
*/
|
1183
|
+
static VALUE cState_space_set(VALUE self, VALUE space)
|
1184
|
+
{
|
1185
|
+
GET_STATE(self);
|
1186
|
+
RB_OBJ_WRITE(self, &state->space, string_config(space));
|
1187
|
+
return Qnil;
|
1188
|
+
}
|
1189
|
+
|
1190
|
+
/*
|
1191
|
+
* call-seq: space_before()
|
1192
|
+
*
|
1193
|
+
* Returns the string that is used to insert a space before the ':' in JSON objects.
|
1194
|
+
*/
|
1195
|
+
static VALUE cState_space_before(VALUE self)
|
1196
|
+
{
|
1197
|
+
GET_STATE(self);
|
1198
|
+
return state->space_before ? state->space_before : rb_str_freeze(rb_utf8_str_new("", 0));
|
1199
|
+
}
|
1200
|
+
|
1201
|
+
/*
|
1202
|
+
* call-seq: space_before=(space_before)
|
1203
|
+
*
|
1204
|
+
* Sets the string that is used to insert a space before the ':' in JSON objects.
|
1205
|
+
*/
|
1206
|
+
static VALUE cState_space_before_set(VALUE self, VALUE space_before)
|
1207
|
+
{
|
1208
|
+
GET_STATE(self);
|
1209
|
+
RB_OBJ_WRITE(self, &state->space_before, string_config(space_before));
|
1210
|
+
return Qnil;
|
1211
|
+
}
|
1212
|
+
|
1213
|
+
/*
|
1214
|
+
* call-seq: object_nl()
|
1215
|
+
*
|
1216
|
+
* This string is put at the end of a line that holds a JSON object (or
|
1217
|
+
* Hash).
|
1218
|
+
*/
|
1219
|
+
static VALUE cState_object_nl(VALUE self)
|
1220
|
+
{
|
1221
|
+
GET_STATE(self);
|
1222
|
+
return state->object_nl ? state->object_nl : rb_str_freeze(rb_utf8_str_new("", 0));
|
1223
|
+
}
|
1224
|
+
|
1225
|
+
/*
|
1226
|
+
* call-seq: object_nl=(object_nl)
|
1227
|
+
*
|
1228
|
+
* This string is put at the end of a line that holds a JSON object (or
|
1229
|
+
* Hash).
|
1230
|
+
*/
|
1231
|
+
static VALUE cState_object_nl_set(VALUE self, VALUE object_nl)
|
1232
|
+
{
|
1233
|
+
GET_STATE(self);
|
1234
|
+
RB_OBJ_WRITE(self, &state->object_nl, string_config(object_nl));
|
1235
|
+
return Qnil;
|
1236
|
+
}
|
1237
|
+
|
1238
|
+
/*
|
1239
|
+
* call-seq: array_nl()
|
1240
|
+
*
|
1241
|
+
* This string is put at the end of a line that holds a JSON array.
|
1242
|
+
*/
|
1243
|
+
static VALUE cState_array_nl(VALUE self)
|
1244
|
+
{
|
1245
|
+
GET_STATE(self);
|
1246
|
+
return state->array_nl ? state->array_nl : rb_str_freeze(rb_utf8_str_new("", 0));
|
1247
|
+
}
|
1248
|
+
|
1249
|
+
/*
|
1250
|
+
* call-seq: array_nl=(array_nl)
|
1251
|
+
*
|
1252
|
+
* This string is put at the end of a line that holds a JSON array.
|
1253
|
+
*/
|
1254
|
+
static VALUE cState_array_nl_set(VALUE self, VALUE array_nl)
|
1255
|
+
{
|
1256
|
+
GET_STATE(self);
|
1257
|
+
RB_OBJ_WRITE(self, &state->array_nl, string_config(array_nl));
|
1258
|
+
return Qnil;
|
1259
|
+
}
|
1260
|
+
|
1261
|
+
|
1262
|
+
/*
|
1263
|
+
* call-seq: check_circular?
|
1264
|
+
*
|
1265
|
+
* Returns true, if circular data structures should be checked,
|
1266
|
+
* otherwise returns false.
|
1267
|
+
*/
|
1268
|
+
static VALUE cState_check_circular_p(VALUE self)
|
1269
|
+
{
|
1270
|
+
GET_STATE(self);
|
1271
|
+
return state->max_nesting ? Qtrue : Qfalse;
|
1272
|
+
}
|
1273
|
+
|
1274
|
+
/*
|
1275
|
+
* call-seq: max_nesting
|
1276
|
+
*
|
1277
|
+
* This integer returns the maximum level of data structure nesting in
|
1278
|
+
* the generated JSON, max_nesting = 0 if no maximum is checked.
|
1279
|
+
*/
|
1280
|
+
static VALUE cState_max_nesting(VALUE self)
|
1281
|
+
{
|
1282
|
+
GET_STATE(self);
|
1283
|
+
return LONG2FIX(state->max_nesting);
|
1284
|
+
}
|
1285
|
+
|
1286
|
+
static long long_config(VALUE num)
|
1287
|
+
{
|
1288
|
+
return RTEST(num) ? FIX2LONG(num) : 0;
|
1289
|
+
}
|
1290
|
+
|
1291
|
+
/*
|
1292
|
+
* call-seq: max_nesting=(depth)
|
1293
|
+
*
|
1294
|
+
* This sets the maximum level of data structure nesting in the generated JSON
|
1295
|
+
* to the integer depth, max_nesting = 0 if no maximum should be checked.
|
1296
|
+
*/
|
1297
|
+
static VALUE cState_max_nesting_set(VALUE self, VALUE depth)
|
1298
|
+
{
|
1299
|
+
GET_STATE(self);
|
1300
|
+
state->max_nesting = long_config(depth);
|
1301
|
+
return Qnil;
|
1302
|
+
}
|
1303
|
+
|
1304
|
+
/*
|
1305
|
+
* call-seq: script_safe
|
1306
|
+
*
|
1307
|
+
* If this boolean is true, the forward slashes will be escaped in
|
1308
|
+
* the json output.
|
1309
|
+
*/
|
1310
|
+
static VALUE cState_script_safe(VALUE self)
|
1311
|
+
{
|
1312
|
+
GET_STATE(self);
|
1313
|
+
return state->script_safe ? Qtrue : Qfalse;
|
1314
|
+
}
|
1315
|
+
|
1316
|
+
/*
|
1317
|
+
* call-seq: script_safe=(enable)
|
1318
|
+
*
|
1319
|
+
* This sets whether or not the forward slashes will be escaped in
|
1320
|
+
* the json output.
|
1321
|
+
*/
|
1322
|
+
static VALUE cState_script_safe_set(VALUE self, VALUE enable)
|
1323
|
+
{
|
1324
|
+
GET_STATE(self);
|
1325
|
+
state->script_safe = RTEST(enable);
|
1326
|
+
return Qnil;
|
1327
|
+
}
|
1328
|
+
|
1329
|
+
/*
|
1330
|
+
* call-seq: strict
|
1331
|
+
*
|
1332
|
+
* If this boolean is false, types unsupported by the JSON format will
|
1333
|
+
* be serialized as strings.
|
1334
|
+
* If this boolean is true, types unsupported by the JSON format will
|
1335
|
+
* raise a JSON::GeneratorError.
|
1336
|
+
*/
|
1337
|
+
static VALUE cState_strict(VALUE self)
|
1338
|
+
{
|
1339
|
+
GET_STATE(self);
|
1340
|
+
return state->strict ? Qtrue : Qfalse;
|
1341
|
+
}
|
1342
|
+
|
1343
|
+
/*
|
1344
|
+
* call-seq: strict=(enable)
|
1345
|
+
*
|
1346
|
+
* This sets whether or not to serialize types unsupported by the
|
1347
|
+
* JSON format as strings.
|
1348
|
+
* If this boolean is false, types unsupported by the JSON format will
|
1349
|
+
* be serialized as strings.
|
1350
|
+
* If this boolean is true, types unsupported by the JSON format will
|
1351
|
+
* raise a JSON::GeneratorError.
|
1352
|
+
*/
|
1353
|
+
static VALUE cState_strict_set(VALUE self, VALUE enable)
|
1354
|
+
{
|
1355
|
+
GET_STATE(self);
|
1356
|
+
state->strict = RTEST(enable);
|
1357
|
+
return Qnil;
|
1358
|
+
}
|
1359
|
+
|
1360
|
+
/*
|
1361
|
+
* call-seq: allow_nan?
|
1362
|
+
*
|
1363
|
+
* Returns true, if NaN, Infinity, and -Infinity should be generated, otherwise
|
1364
|
+
* returns false.
|
1365
|
+
*/
|
1366
|
+
static VALUE cState_allow_nan_p(VALUE self)
|
1367
|
+
{
|
1368
|
+
GET_STATE(self);
|
1369
|
+
return state->allow_nan ? Qtrue : Qfalse;
|
1370
|
+
}
|
1371
|
+
|
1372
|
+
/*
|
1373
|
+
* call-seq: allow_nan=(enable)
|
1374
|
+
*
|
1375
|
+
* This sets whether or not to serialize NaN, Infinity, and -Infinity
|
1376
|
+
*/
|
1377
|
+
static VALUE cState_allow_nan_set(VALUE self, VALUE enable)
|
1378
|
+
{
|
1379
|
+
GET_STATE(self);
|
1380
|
+
state->allow_nan = RTEST(enable);
|
1381
|
+
return Qnil;
|
1382
|
+
}
|
1383
|
+
|
1384
|
+
/*
|
1385
|
+
* call-seq: ascii_only?
|
1386
|
+
*
|
1387
|
+
* Returns true, if only ASCII characters should be generated. Otherwise
|
1388
|
+
* returns false.
|
1389
|
+
*/
|
1390
|
+
static VALUE cState_ascii_only_p(VALUE self)
|
1391
|
+
{
|
1392
|
+
GET_STATE(self);
|
1393
|
+
return state->ascii_only ? Qtrue : Qfalse;
|
1394
|
+
}
|
1395
|
+
|
1396
|
+
/*
|
1397
|
+
* call-seq: ascii_only=(enable)
|
1398
|
+
*
|
1399
|
+
* This sets whether only ASCII characters should be generated.
|
1400
|
+
*/
|
1401
|
+
static VALUE cState_ascii_only_set(VALUE self, VALUE enable)
|
1402
|
+
{
|
1403
|
+
GET_STATE(self);
|
1404
|
+
state->ascii_only = RTEST(enable);
|
1405
|
+
return Qnil;
|
1406
|
+
}
|
1407
|
+
|
1408
|
+
/*
|
1409
|
+
* call-seq: depth
|
1410
|
+
*
|
1411
|
+
* This integer returns the current depth of data structure nesting.
|
1412
|
+
*/
|
1413
|
+
static VALUE cState_depth(VALUE self)
|
1414
|
+
{
|
1415
|
+
GET_STATE(self);
|
1416
|
+
return LONG2FIX(state->depth);
|
1417
|
+
}
|
1418
|
+
|
1419
|
+
/*
|
1420
|
+
* call-seq: depth=(depth)
|
1421
|
+
*
|
1422
|
+
* This sets the maximum level of data structure nesting in the generated JSON
|
1423
|
+
* to the integer depth, max_nesting = 0 if no maximum should be checked.
|
1424
|
+
*/
|
1425
|
+
static VALUE cState_depth_set(VALUE self, VALUE depth)
|
1426
|
+
{
|
1427
|
+
GET_STATE(self);
|
1428
|
+
state->depth = long_config(depth);
|
1429
|
+
return Qnil;
|
1430
|
+
}
|
1431
|
+
|
1432
|
+
/*
|
1433
|
+
* call-seq: buffer_initial_length
|
1434
|
+
*
|
1435
|
+
* This integer returns the current initial length of the buffer.
|
1436
|
+
*/
|
1437
|
+
static VALUE cState_buffer_initial_length(VALUE self)
|
1438
|
+
{
|
1439
|
+
GET_STATE(self);
|
1440
|
+
return LONG2FIX(state->buffer_initial_length);
|
1441
|
+
}
|
1442
|
+
|
1443
|
+
static void buffer_initial_length_set(JSON_Generator_State *state, VALUE buffer_initial_length)
|
1444
|
+
{
|
1445
|
+
Check_Type(buffer_initial_length, T_FIXNUM);
|
1446
|
+
long initial_length = FIX2LONG(buffer_initial_length);
|
1447
|
+
if (initial_length > 0) {
|
1448
|
+
state->buffer_initial_length = initial_length;
|
1449
|
+
}
|
1450
|
+
}
|
1451
|
+
|
1452
|
+
/*
|
1453
|
+
* call-seq: buffer_initial_length=(length)
|
1454
|
+
*
|
1455
|
+
* This sets the initial length of the buffer to +length+, if +length+ > 0,
|
1456
|
+
* otherwise its value isn't changed.
|
1457
|
+
*/
|
1458
|
+
static VALUE cState_buffer_initial_length_set(VALUE self, VALUE buffer_initial_length)
|
1459
|
+
{
|
1460
|
+
GET_STATE(self);
|
1461
|
+
buffer_initial_length_set(state, buffer_initial_length);
|
1462
|
+
return Qnil;
|
1463
|
+
}
|
1464
|
+
|
1465
|
+
static int configure_state_i(VALUE key, VALUE val, VALUE _arg)
|
1466
|
+
{
|
1467
|
+
JSON_Generator_State *state = (JSON_Generator_State *)_arg;
|
1468
|
+
|
1469
|
+
if (key == sym_indent) { state->indent = string_config(val); }
|
1470
|
+
else if (key == sym_space) { state->space = string_config(val); }
|
1471
|
+
else if (key == sym_space_before) { state->space_before = string_config(val); }
|
1472
|
+
else if (key == sym_object_nl) { state->object_nl = string_config(val); }
|
1473
|
+
else if (key == sym_array_nl) { state->array_nl = string_config(val); }
|
1474
|
+
else if (key == sym_max_nesting) { state->max_nesting = long_config(val); }
|
1475
|
+
else if (key == sym_allow_nan) { state->allow_nan = RTEST(val); }
|
1476
|
+
else if (key == sym_ascii_only) { state->ascii_only = RTEST(val); }
|
1477
|
+
else if (key == sym_depth) { state->depth = long_config(val); }
|
1478
|
+
else if (key == sym_buffer_initial_length) { buffer_initial_length_set(state, val); }
|
1479
|
+
else if (key == sym_script_safe) { state->script_safe = RTEST(val); }
|
1480
|
+
else if (key == sym_escape_slash) { state->script_safe = RTEST(val); }
|
1481
|
+
else if (key == sym_strict) { state->strict = RTEST(val); }
|
1482
|
+
return ST_CONTINUE;
|
1483
|
+
}
|
1484
|
+
|
1485
|
+
static void configure_state(JSON_Generator_State *state, VALUE config)
|
1486
|
+
{
|
1487
|
+
if (!RTEST(config)) return;
|
1488
|
+
|
1489
|
+
Check_Type(config, T_HASH);
|
1490
|
+
|
1491
|
+
if (!RHASH_SIZE(config)) return;
|
1492
|
+
|
1493
|
+
// We assume in most cases few keys are set so it's faster to go over
|
1494
|
+
// the provided keys than to check all possible keys.
|
1495
|
+
rb_hash_foreach(config, configure_state_i, (VALUE)state);
|
1496
|
+
}
|
1497
|
+
|
1498
|
+
static VALUE cState_configure(VALUE self, VALUE opts)
|
1499
|
+
{
|
1500
|
+
GET_STATE(self);
|
1501
|
+
configure_state(state, opts);
|
1502
|
+
return self;
|
1503
|
+
}
|
1504
|
+
|
1505
|
+
static VALUE cState_m_generate(VALUE klass, VALUE obj, VALUE opts)
|
1506
|
+
{
|
1507
|
+
JSON_Generator_State state = {0};
|
1508
|
+
state_init(&state);
|
1509
|
+
configure_state(&state, opts);
|
1510
|
+
|
1511
|
+
char stack_buffer[FBUFFER_STACK_SIZE];
|
1512
|
+
FBuffer buffer = {0};
|
1513
|
+
fbuffer_stack_init(&buffer, state.buffer_initial_length, stack_buffer, FBUFFER_STACK_SIZE);
|
1514
|
+
|
1515
|
+
struct generate_json_data data = {
|
1516
|
+
.buffer = &buffer,
|
1517
|
+
.vstate = Qfalse,
|
1518
|
+
.state = &state,
|
1519
|
+
.obj = obj,
|
1520
|
+
.func = generate_json,
|
1521
|
+
};
|
1522
|
+
rb_rescue(generate_json_try, (VALUE)&data, generate_json_rescue, (VALUE)&data);
|
1523
|
+
|
1524
|
+
return fbuffer_to_s(&buffer);
|
1525
|
+
}
|
1526
|
+
|
1527
|
+
/*
|
1528
|
+
*
|
1529
|
+
*/
|
1530
|
+
void Init_generator(void)
|
1531
|
+
{
|
1532
|
+
#ifdef HAVE_RB_EXT_RACTOR_SAFE
|
1533
|
+
rb_ext_ractor_safe(true);
|
1534
|
+
#endif
|
1535
|
+
|
1536
|
+
#undef rb_intern
|
1537
|
+
rb_require("json/common");
|
1538
|
+
|
1539
|
+
mJSON = rb_define_module("JSON");
|
1540
|
+
VALUE mExt = rb_define_module_under(mJSON, "Ext");
|
1541
|
+
VALUE mGenerator = rb_define_module_under(mExt, "Generator");
|
1542
|
+
|
1543
|
+
eGeneratorError = rb_path2class("JSON::GeneratorError");
|
1544
|
+
eNestingError = rb_path2class("JSON::NestingError");
|
1545
|
+
rb_gc_register_mark_object(eGeneratorError);
|
1546
|
+
rb_gc_register_mark_object(eNestingError);
|
1547
|
+
|
1548
|
+
cState = rb_define_class_under(mGenerator, "State", rb_cObject);
|
1549
|
+
rb_define_alloc_func(cState, cState_s_allocate);
|
1550
|
+
rb_define_singleton_method(cState, "from_state", cState_from_state_s, 1);
|
1551
|
+
rb_define_method(cState, "initialize", cState_initialize, -1);
|
1552
|
+
rb_define_alias(cState, "initialize", "initialize"); // avoid method redefinition warnings
|
1553
|
+
rb_define_private_method(cState, "_configure", cState_configure, 1);
|
1554
|
+
|
1555
|
+
rb_define_method(cState, "initialize_copy", cState_init_copy, 1);
|
1556
|
+
rb_define_method(cState, "indent", cState_indent, 0);
|
1557
|
+
rb_define_method(cState, "indent=", cState_indent_set, 1);
|
1558
|
+
rb_define_method(cState, "space", cState_space, 0);
|
1559
|
+
rb_define_method(cState, "space=", cState_space_set, 1);
|
1560
|
+
rb_define_method(cState, "space_before", cState_space_before, 0);
|
1561
|
+
rb_define_method(cState, "space_before=", cState_space_before_set, 1);
|
1562
|
+
rb_define_method(cState, "object_nl", cState_object_nl, 0);
|
1563
|
+
rb_define_method(cState, "object_nl=", cState_object_nl_set, 1);
|
1564
|
+
rb_define_method(cState, "array_nl", cState_array_nl, 0);
|
1565
|
+
rb_define_method(cState, "array_nl=", cState_array_nl_set, 1);
|
1566
|
+
rb_define_method(cState, "max_nesting", cState_max_nesting, 0);
|
1567
|
+
rb_define_method(cState, "max_nesting=", cState_max_nesting_set, 1);
|
1568
|
+
rb_define_method(cState, "script_safe", cState_script_safe, 0);
|
1569
|
+
rb_define_method(cState, "script_safe?", cState_script_safe, 0);
|
1570
|
+
rb_define_method(cState, "script_safe=", cState_script_safe_set, 1);
|
1571
|
+
rb_define_alias(cState, "escape_slash", "script_safe");
|
1572
|
+
rb_define_alias(cState, "escape_slash?", "script_safe?");
|
1573
|
+
rb_define_alias(cState, "escape_slash=", "script_safe=");
|
1574
|
+
rb_define_method(cState, "strict", cState_strict, 0);
|
1575
|
+
rb_define_method(cState, "strict?", cState_strict, 0);
|
1576
|
+
rb_define_method(cState, "strict=", cState_strict_set, 1);
|
1577
|
+
rb_define_method(cState, "check_circular?", cState_check_circular_p, 0);
|
1578
|
+
rb_define_method(cState, "allow_nan?", cState_allow_nan_p, 0);
|
1579
|
+
rb_define_method(cState, "allow_nan=", cState_allow_nan_set, 1);
|
1580
|
+
rb_define_method(cState, "ascii_only?", cState_ascii_only_p, 0);
|
1581
|
+
rb_define_method(cState, "ascii_only=", cState_ascii_only_set, 1);
|
1582
|
+
rb_define_method(cState, "depth", cState_depth, 0);
|
1583
|
+
rb_define_method(cState, "depth=", cState_depth_set, 1);
|
1584
|
+
rb_define_method(cState, "buffer_initial_length", cState_buffer_initial_length, 0);
|
1585
|
+
rb_define_method(cState, "buffer_initial_length=", cState_buffer_initial_length_set, 1);
|
1586
|
+
rb_define_method(cState, "generate", cState_generate, 1);
|
1587
|
+
|
1588
|
+
rb_define_singleton_method(cState, "generate", cState_m_generate, 2);
|
1589
|
+
|
1590
|
+
VALUE mGeneratorMethods = rb_define_module_under(mGenerator, "GeneratorMethods");
|
1591
|
+
|
1592
|
+
VALUE mObject = rb_define_module_under(mGeneratorMethods, "Object");
|
1593
|
+
rb_define_method(mObject, "to_json", mObject_to_json, -1);
|
1594
|
+
|
1595
|
+
VALUE mHash = rb_define_module_under(mGeneratorMethods, "Hash");
|
1596
|
+
rb_define_method(mHash, "to_json", mHash_to_json, -1);
|
1597
|
+
|
1598
|
+
VALUE mArray = rb_define_module_under(mGeneratorMethods, "Array");
|
1599
|
+
rb_define_method(mArray, "to_json", mArray_to_json, -1);
|
1600
|
+
|
1601
|
+
#ifdef RUBY_INTEGER_UNIFICATION
|
1602
|
+
VALUE mInteger = rb_define_module_under(mGeneratorMethods, "Integer");
|
1603
|
+
rb_define_method(mInteger, "to_json", mInteger_to_json, -1);
|
1604
|
+
#else
|
1605
|
+
VALUE mFixnum = rb_define_module_under(mGeneratorMethods, "Fixnum");
|
1606
|
+
rb_define_method(mFixnum, "to_json", mFixnum_to_json, -1);
|
1607
|
+
|
1608
|
+
VALUE mBignum = rb_define_module_under(mGeneratorMethods, "Bignum");
|
1609
|
+
rb_define_method(mBignum, "to_json", mBignum_to_json, -1);
|
1610
|
+
#endif
|
1611
|
+
VALUE mFloat = rb_define_module_under(mGeneratorMethods, "Float");
|
1612
|
+
rb_define_method(mFloat, "to_json", mFloat_to_json, -1);
|
1613
|
+
|
1614
|
+
VALUE mString = rb_define_module_under(mGeneratorMethods, "String");
|
1615
|
+
rb_define_singleton_method(mString, "included", mString_included_s, 1);
|
1616
|
+
rb_define_method(mString, "to_json", mString_to_json, -1);
|
1617
|
+
rb_define_method(mString, "to_json_raw", mString_to_json_raw, -1);
|
1618
|
+
rb_define_method(mString, "to_json_raw_object", mString_to_json_raw_object, 0);
|
1619
|
+
|
1620
|
+
mString_Extend = rb_define_module_under(mString, "Extend");
|
1621
|
+
rb_define_method(mString_Extend, "json_create", mString_Extend_json_create, 1);
|
1622
|
+
|
1623
|
+
VALUE mTrueClass = rb_define_module_under(mGeneratorMethods, "TrueClass");
|
1624
|
+
rb_define_method(mTrueClass, "to_json", mTrueClass_to_json, -1);
|
1625
|
+
|
1626
|
+
VALUE mFalseClass = rb_define_module_under(mGeneratorMethods, "FalseClass");
|
1627
|
+
rb_define_method(mFalseClass, "to_json", mFalseClass_to_json, -1);
|
1628
|
+
|
1629
|
+
VALUE mNilClass = rb_define_module_under(mGeneratorMethods, "NilClass");
|
1630
|
+
rb_define_method(mNilClass, "to_json", mNilClass_to_json, -1);
|
1631
|
+
|
1632
|
+
rb_global_variable(&Encoding_UTF_8);
|
1633
|
+
Encoding_UTF_8 = rb_const_get(rb_path2class("Encoding"), rb_intern("UTF_8"));
|
1634
|
+
|
1635
|
+
i_to_s = rb_intern("to_s");
|
1636
|
+
i_to_json = rb_intern("to_json");
|
1637
|
+
i_new = rb_intern("new");
|
1638
|
+
i_pack = rb_intern("pack");
|
1639
|
+
i_unpack = rb_intern("unpack");
|
1640
|
+
i_create_id = rb_intern("create_id");
|
1641
|
+
i_extend = rb_intern("extend");
|
1642
|
+
i_encode = rb_intern("encode");
|
1643
|
+
|
1644
|
+
sym_indent = ID2SYM(rb_intern("indent"));
|
1645
|
+
sym_space = ID2SYM(rb_intern("space"));
|
1646
|
+
sym_space_before = ID2SYM(rb_intern("space_before"));
|
1647
|
+
sym_object_nl = ID2SYM(rb_intern("object_nl"));
|
1648
|
+
sym_array_nl = ID2SYM(rb_intern("array_nl"));
|
1649
|
+
sym_max_nesting = ID2SYM(rb_intern("max_nesting"));
|
1650
|
+
sym_allow_nan = ID2SYM(rb_intern("allow_nan"));
|
1651
|
+
sym_ascii_only = ID2SYM(rb_intern("ascii_only"));
|
1652
|
+
sym_depth = ID2SYM(rb_intern("depth"));
|
1653
|
+
sym_buffer_initial_length = ID2SYM(rb_intern("buffer_initial_length"));
|
1654
|
+
sym_script_safe = ID2SYM(rb_intern("script_safe"));
|
1655
|
+
sym_escape_slash = ID2SYM(rb_intern("escape_slash"));
|
1656
|
+
sym_strict = ID2SYM(rb_intern("strict"));
|
1657
|
+
|
1658
|
+
usascii_encindex = rb_usascii_encindex();
|
1659
|
+
utf8_encindex = rb_utf8_encindex();
|
1660
|
+
binary_encindex = rb_ascii8bit_encindex();
|
1661
|
+
|
1662
|
+
rb_require("json/ext/generator/state");
|
1663
|
+
}
|