talon_one 6.0.0 → 8.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.
Files changed (913) hide show
  1. checksums.yaml +4 -4
  2. data/.github/.example/.bundle/config +2 -0
  3. data/.github/.example/Gemfile +6 -0
  4. data/.github/.example/Gemfile.lock +47 -0
  5. data/.github/.example/example.rb +85 -0
  6. 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
  7. 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
  8. 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
  9. 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
  10. data/.github/.example/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-24/3.3.0/json-2.8.2/mkmf.log +177 -0
  11. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/.github/workflows/ruby.yml +41 -0
  12. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/.gitignore +8 -0
  13. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/.rspec +3 -0
  14. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/CHANGELOG.md +375 -0
  15. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/Gemfile +43 -0
  16. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/Guardfile +10 -0
  17. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/LICENSE +20 -0
  18. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/README.md +118 -0
  19. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/Rakefile +40 -0
  20. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/ethon.gemspec +26 -0
  21. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curl.rb +90 -0
  22. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/classes.rb +65 -0
  23. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/codes.rb +122 -0
  24. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/constants.rb +80 -0
  25. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/form_options.rb +37 -0
  26. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/functions.rb +58 -0
  27. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/infos.rb +151 -0
  28. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/messages.rb +19 -0
  29. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/options.rb +503 -0
  30. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/curls/settings.rb +12 -0
  31. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/callbacks.rb +149 -0
  32. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/debug_info.rb +47 -0
  33. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/features.rb +31 -0
  34. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/form.rb +107 -0
  35. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/header.rb +61 -0
  36. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/actionable.rb +157 -0
  37. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/custom.rb +29 -0
  38. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/delete.rb +25 -0
  39. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/get.rb +24 -0
  40. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/head.rb +24 -0
  41. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/options.rb +24 -0
  42. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/patch.rb +24 -0
  43. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/post.rb +26 -0
  44. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/postable.rb +32 -0
  45. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/put.rb +27 -0
  46. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http/putable.rb +25 -0
  47. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/http.rb +68 -0
  48. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/informations.rb +116 -0
  49. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/mirror.rb +36 -0
  50. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/operations.rb +64 -0
  51. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/options.rb +50 -0
  52. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/params.rb +29 -0
  53. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/queryable.rb +154 -0
  54. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/response_callbacks.rb +136 -0
  55. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy/util.rb +28 -0
  56. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/easy.rb +315 -0
  57. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/ethon_error.rb +9 -0
  58. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/global_init.rb +13 -0
  59. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/invalid_option.rb +13 -0
  60. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/invalid_value.rb +13 -0
  61. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/multi_add.rb +12 -0
  62. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/multi_fdset.rb +12 -0
  63. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/multi_remove.rb +12 -0
  64. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/multi_timeout.rb +13 -0
  65. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors/select.rb +13 -0
  66. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/errors.rb +17 -0
  67. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/libc.rb +21 -0
  68. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/loggable.rb +59 -0
  69. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/multi/operations.rb +228 -0
  70. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/multi/options.rb +117 -0
  71. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/multi/stack.rb +49 -0
  72. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/multi.rb +126 -0
  73. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon/version.rb +6 -0
  74. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/lib/ethon.rb +36 -0
  75. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/benchmarks.rb +104 -0
  76. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/memory_leaks.rb +114 -0
  77. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/perf_spec_helper.rb +37 -0
  78. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/support/memory_test_helpers.rb +76 -0
  79. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/support/os_memory_leak_tracker.rb +48 -0
  80. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/profile/support/ruby_object_leak_tracker.rb +49 -0
  81. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/curl_spec.rb +38 -0
  82. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/callbacks_spec.rb +81 -0
  83. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/debug_info_spec.rb +54 -0
  84. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/features_spec.rb +24 -0
  85. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/form_spec.rb +104 -0
  86. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/header_spec.rb +79 -0
  87. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/custom_spec.rb +177 -0
  88. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/delete_spec.rb +21 -0
  89. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/get_spec.rb +126 -0
  90. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/head_spec.rb +80 -0
  91. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/options_spec.rb +51 -0
  92. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/patch_spec.rb +51 -0
  93. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/post_spec.rb +317 -0
  94. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http/put_spec.rb +168 -0
  95. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/http_spec.rb +64 -0
  96. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/informations_spec.rb +126 -0
  97. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/mirror_spec.rb +47 -0
  98. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/operations_spec.rb +271 -0
  99. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/options_spec.rb +193 -0
  100. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/queryable_spec.rb +235 -0
  101. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/response_callbacks_spec.rb +152 -0
  102. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy/util_spec.rb +28 -0
  103. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/easy_spec.rb +203 -0
  104. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/libc_spec.rb +14 -0
  105. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/loggable_spec.rb +22 -0
  106. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/multi/operations_spec.rb +298 -0
  107. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/multi/options_spec.rb +182 -0
  108. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/multi/stack_spec.rb +80 -0
  109. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/ethon/multi_spec.rb +152 -0
  110. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/spec_helper.rb +28 -0
  111. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/support/localhost_server.rb +95 -0
  112. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ethon-0.16.0/spec/support/server.rb +115 -0
  113. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/CHANGELOG.md +456 -0
  114. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/COPYING +49 -0
  115. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/Gemfile +21 -0
  116. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/LICENSE +24 -0
  117. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/LICENSE.SPECS +22 -0
  118. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/README.md +137 -0
  119. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/Rakefile +206 -0
  120. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/ffi.gemspec +42 -0
  121. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/2.5/ffi_c.bundle +0 -0
  122. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/2.6/ffi_c.bundle +0 -0
  123. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/2.7/ffi_c.bundle +0 -0
  124. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/3.0/ffi_c.bundle +0 -0
  125. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/3.1/ffi_c.bundle +0 -0
  126. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/3.2/ffi_c.bundle +0 -0
  127. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/3.3/ffi_c.bundle +0 -0
  128. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/abstract_memory.rb +44 -0
  129. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/autopointer.rb +180 -0
  130. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/buffer.rb +4 -0
  131. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/callback.rb +4 -0
  132. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/compat.rb +43 -0
  133. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/data_converter.rb +67 -0
  134. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/dynamic_library.rb +118 -0
  135. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/enum.rb +302 -0
  136. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/errno.rb +43 -0
  137. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/ffi.rb +50 -0
  138. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/function.rb +71 -0
  139. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/io.rb +62 -0
  140. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/library.rb +576 -0
  141. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/library_path.rb +109 -0
  142. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/managedstruct.rb +84 -0
  143. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/memorypointer.rb +1 -0
  144. 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
  145. 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
  146. 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
  147. 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
  148. 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
  149. 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
  150. 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
  151. 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
  152. 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
  153. 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
  154. 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
  155. 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
  156. 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
  157. 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
  158. 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
  159. 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
  160. 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
  161. 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
  162. 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
  163. 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
  164. 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
  165. 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
  166. 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
  167. 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
  168. 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
  169. 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
  170. 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
  171. 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
  172. 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
  173. 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
  174. 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
  175. 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
  176. 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
  177. 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
  178. 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
  179. 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
  180. 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
  181. 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
  182. 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
  183. 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
  184. 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
  185. 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
  186. 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
  187. 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
  188. 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
  189. 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
  190. 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
  191. 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
  192. 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
  193. 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
  194. 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
  195. 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
  196. 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
  197. 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
  198. 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
  199. 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
  200. 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
  201. 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
  202. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/platform.rb +187 -0
  203. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/pointer.rb +167 -0
  204. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/struct.rb +317 -0
  205. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/struct_by_reference.rb +72 -0
  206. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/struct_layout.rb +96 -0
  207. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/struct_layout_builder.rb +227 -0
  208. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/const_generator.rb +232 -0
  209. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/generator.rb +105 -0
  210. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/generator_task.rb +32 -0
  211. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/struct_generator.rb +195 -0
  212. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/tools/types_generator.rb +137 -0
  213. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/types.rb +222 -0
  214. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/union.rb +43 -0
  215. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/variadic.rb +80 -0
  216. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi/version.rb +3 -0
  217. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/lib/ffi.rb +27 -0
  218. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/rakelib/ffi_gem_helper.rb +65 -0
  219. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/getlogin.rb +8 -0
  220. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/getpid.rb +8 -0
  221. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/gettimeofday.rb +18 -0
  222. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/hello.rb +8 -0
  223. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/hello_ractor.rb +11 -0
  224. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/inotify.rb +60 -0
  225. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/pty.rb +75 -0
  226. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/qsort.rb +20 -0
  227. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/samples/qsort_ractor.rb +28 -0
  228. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/abstract_memory.rbs +165 -0
  229. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/auto_pointer.rbs +27 -0
  230. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/buffer.rbs +18 -0
  231. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/data_converter.rbs +10 -0
  232. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/dynamic_library.rbs +9 -0
  233. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/enum.rbs +38 -0
  234. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/function.rbs +39 -0
  235. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/library.rbs +42 -0
  236. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/native_type.rbs +86 -0
  237. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/pointer.rbs +42 -0
  238. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct.rbs +76 -0
  239. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct_by_reference.rbs +11 -0
  240. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct_by_value.rbs +7 -0
  241. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct_layout.rbs +9 -0
  242. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/struct_layout_builder.rbs +5 -0
  243. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi/type.rbs +39 -0
  244. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0-arm64-darwin/sig/ffi.rbs +26 -0
  245. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/BSDL +22 -0
  246. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/CHANGES.md +559 -0
  247. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/COPYING +56 -0
  248. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/LEGAL +60 -0
  249. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/README.md +195 -0
  250. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/fbuffer/fbuffer.h +184 -0
  251. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/generator/Makefile +270 -0
  252. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/generator/extconf.rb +10 -0
  253. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/generator/generator.c +1663 -0
  254. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/parser/Makefile +270 -0
  255. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/parser/extconf.rb +12 -0
  256. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/parser/parser.c +3238 -0
  257. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/ext/json/ext/parser/parser.rl +1465 -0
  258. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/json.gemspec +64 -0
  259. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/bigdecimal.rb +58 -0
  260. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/complex.rb +51 -0
  261. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/core.rb +12 -0
  262. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/date.rb +54 -0
  263. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/date_time.rb +67 -0
  264. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/exception.rb +49 -0
  265. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/ostruct.rb +54 -0
  266. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/range.rb +54 -0
  267. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/rational.rb +49 -0
  268. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/regexp.rb +48 -0
  269. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/set.rb +48 -0
  270. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/struct.rb +52 -0
  271. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/symbol.rb +47 -0
  272. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/add/time.rb +52 -0
  273. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/common.rb +876 -0
  274. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/ext/generator/state.rb +105 -0
  275. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/ext/generator.bundle +0 -0
  276. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/ext/parser.bundle +0 -0
  277. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/ext.rb +23 -0
  278. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/generic_object.rb +75 -0
  279. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/truffle_ruby/generator.rb +621 -0
  280. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json/version.rb +5 -0
  281. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/json-2.8.2/lib/json.rb +587 -0
  282. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.github/workflows/ci.yml +30 -0
  283. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.github/workflows/experimental.yml +33 -0
  284. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.gitignore +8 -0
  285. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.rspec +4 -0
  286. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/CHANGELOG.md +410 -0
  287. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/CONTRIBUTING.md +20 -0
  288. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Gemfile +36 -0
  289. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Guardfile +9 -0
  290. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/LICENSE +22 -0
  291. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/README.md +588 -0
  292. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Rakefile +38 -0
  293. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/UPGRADE.md +55 -0
  294. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/rack/typhoeus/middleware/params_decoder/helper.rb +76 -0
  295. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/rack/typhoeus/middleware/params_decoder.rb +57 -0
  296. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/rack/typhoeus.rb +1 -0
  297. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/adapters/faraday.rb +180 -0
  298. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/cache/dalli.rb +28 -0
  299. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/cache/rails.rb +28 -0
  300. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/cache/redis.rb +35 -0
  301. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/config.rb +85 -0
  302. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/easy_factory.rb +206 -0
  303. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/errors/no_stub.rb +12 -0
  304. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/errors/typhoeus_error.rb +8 -0
  305. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/errors.rb +9 -0
  306. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/expectation.rb +217 -0
  307. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/addable.rb +23 -0
  308. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/before.rb +31 -0
  309. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/block_connection.rb +35 -0
  310. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/cacheable.rb +15 -0
  311. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/memoizable.rb +56 -0
  312. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/queueable.rb +83 -0
  313. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/runnable.rb +19 -0
  314. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra/stubbable.rb +28 -0
  315. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/hydra.rb +95 -0
  316. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/pool.rb +70 -0
  317. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/railtie.rb +12 -0
  318. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/actions.rb +125 -0
  319. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/before.rb +30 -0
  320. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/block_connection.rb +52 -0
  321. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/cacheable.rb +38 -0
  322. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/callbacks.rb +151 -0
  323. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/marshal.rb +22 -0
  324. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/memoizable.rb +38 -0
  325. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/operations.rb +40 -0
  326. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/responseable.rb +29 -0
  327. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/streamable.rb +34 -0
  328. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request/stubbable.rb +30 -0
  329. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/request.rb +223 -0
  330. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response/cacheable.rb +14 -0
  331. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response/header.rb +105 -0
  332. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response/informations.rb +305 -0
  333. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response/status.rb +106 -0
  334. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/response.rb +68 -0
  335. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus/version.rb +5 -0
  336. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/lib/typhoeus.rb +143 -0
  337. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/perf/profile.rb +14 -0
  338. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/perf/vs_nethttp.rb +64 -0
  339. 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
  340. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/rack/typhoeus/middleware/params_decoder_spec.rb +31 -0
  341. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/spec_helper.rb +29 -0
  342. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/localhost_server.rb +94 -0
  343. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/memory_cache.rb +15 -0
  344. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/server.rb +116 -0
  345. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/adapters/faraday_spec.rb +339 -0
  346. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/cache/dalli_spec.rb +41 -0
  347. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/cache/redis_spec.rb +41 -0
  348. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/config_spec.rb +15 -0
  349. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/easy_factory_spec.rb +143 -0
  350. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/errors/no_stub_spec.rb +13 -0
  351. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/expectation_spec.rb +280 -0
  352. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/addable_spec.rb +22 -0
  353. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/before_spec.rb +98 -0
  354. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/block_connection_spec.rb +18 -0
  355. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/cacheable_spec.rb +88 -0
  356. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/memoizable_spec.rb +53 -0
  357. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/queueable_spec.rb +98 -0
  358. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/runnable_spec.rb +137 -0
  359. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/stubbable_spec.rb +48 -0
  360. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra_spec.rb +22 -0
  361. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/pool_spec.rb +137 -0
  362. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/actions_spec.rb +19 -0
  363. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/before_spec.rb +93 -0
  364. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/block_connection_spec.rb +75 -0
  365. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/cacheable_spec.rb +94 -0
  366. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/callbacks_spec.rb +91 -0
  367. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/marshal_spec.rb +60 -0
  368. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/memoizable_spec.rb +34 -0
  369. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/operations_spec.rb +101 -0
  370. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/responseable_spec.rb +13 -0
  371. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/stubbable_spec.rb +45 -0
  372. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request_spec.rb +256 -0
  373. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/header_spec.rb +147 -0
  374. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/informations_spec.rb +323 -0
  375. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/status_spec.rb +256 -0
  376. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response_spec.rb +100 -0
  377. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus_spec.rb +105 -0
  378. data/.github/.example/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/typhoeus.gemspec +25 -0
  379. data/.github/.example/vendor/bundle/ruby/3.3.0/specifications/ethon-0.16.0.gemspec +24 -0
  380. data/.github/.example/vendor/bundle/ruby/3.3.0/specifications/ffi-1.17.0-arm64-darwin.gemspec +31 -0
  381. data/.github/.example/vendor/bundle/ruby/3.3.0/specifications/json-2.8.2.gemspec +0 -0
  382. data/.github/.example/vendor/bundle/ruby/3.3.0/specifications/typhoeus-1.4.1.gemspec +24 -0
  383. data/.github/dependabot.yml +10 -0
  384. data/.github/workflows/test.yml +75 -0
  385. data/README.md +563 -562
  386. data/docker-compose.yml +47 -0
  387. data/docs/AccountAnalytics.md +1 -1
  388. data/docs/Achievement.md +14 -4
  389. data/docs/AchievementAdditionalProperties.md +5 -3
  390. data/docs/AchievementProgress.md +3 -15
  391. data/docs/AddFreeItemEffectProps.md +3 -1
  392. data/docs/AdditionalCampaignProperties.md +5 -3
  393. data/docs/AnalyticsProduct.md +23 -0
  394. data/docs/AnalyticsProductSKU.md +21 -0
  395. data/docs/ApplicationCIF.md +1 -1
  396. data/docs/ApplicationCIFExpression.md +1 -1
  397. data/docs/ApplicationCampaignStats.md +2 -0
  398. data/docs/ApplicationCustomer.md +8 -8
  399. data/docs/ApplicationEntity.md +1 -1
  400. data/docs/ApplicationEvent.md +1 -1
  401. data/docs/ApplicationReferee.md +1 -1
  402. data/docs/ApplicationSession.md +4 -4
  403. data/docs/Audience.md +1 -1
  404. data/docs/AudienceCustomer.md +2 -2
  405. data/docs/BaseLoyaltyProgram.md +3 -1
  406. data/docs/Binding.md +1 -1
  407. data/docs/BulkOperationOnCampaigns.md +3 -1
  408. data/docs/Campaign.md +7 -3
  409. data/docs/CampaignEvaluationGroup.md +1 -1
  410. data/docs/CampaignNotificationPolicy.md +3 -1
  411. data/docs/CampaignSet.md +1 -1
  412. data/docs/CampaignStoreBudget.md +1 -1
  413. data/docs/CampaignTemplate.md +3 -1
  414. data/docs/CampaignTemplateCouponReservationSettings.md +19 -0
  415. data/docs/CampaignVersions.md +3 -1
  416. data/docs/CardExpiringPointsNotificationPolicy.md +3 -1
  417. data/docs/CatalogsStrikethroughNotificationPolicy.md +3 -1
  418. data/docs/Change.md +1 -1
  419. data/docs/CouponCreationJob.md +1 -1
  420. data/docs/CouponDeletionFilters.md +1 -1
  421. data/docs/CouponDeletionJob.md +1 -1
  422. data/docs/CouponsNotificationPolicy.md +5 -1
  423. data/docs/CreateAchievement.md +10 -2
  424. data/docs/CustomerInventory.md +1 -1
  425. data/docs/CustomerProfile.md +2 -2
  426. data/docs/CustomerProfileAudienceRequestItem.md +1 -1
  427. data/docs/CustomerSession.md +2 -2
  428. data/docs/CustomerSessionV2.md +8 -8
  429. data/docs/Environment.md +1 -1
  430. data/docs/Event.md +1 -1
  431. data/docs/ExpiringCouponsNotificationPolicy.md +3 -1
  432. data/docs/ExpiringPointsNotificationPolicy.md +3 -1
  433. data/docs/FeatureFlag.md +1 -1
  434. data/docs/GenerateCampaignDescription.md +2 -2
  435. data/docs/GenerateCampaignTags.md +2 -2
  436. data/docs/GenerateLoyaltyCard.md +3 -1
  437. data/docs/InlineResponse2001.md +3 -3
  438. data/docs/InlineResponse20010.md +3 -3
  439. data/docs/InlineResponse20011.md +3 -3
  440. data/docs/InlineResponse20012.md +1 -1
  441. data/docs/InlineResponse20013.md +1 -1
  442. data/docs/InlineResponse20014.md +1 -1
  443. data/docs/InlineResponse20015.md +3 -3
  444. data/docs/InlineResponse20016.md +3 -3
  445. data/docs/InlineResponse20017.md +3 -5
  446. data/docs/InlineResponse20018.md +2 -2
  447. data/docs/InlineResponse20019.md +3 -3
  448. data/docs/InlineResponse2002.md +3 -3
  449. data/docs/InlineResponse20020.md +5 -3
  450. data/docs/InlineResponse20021.md +3 -3
  451. data/docs/InlineResponse20022.md +3 -5
  452. data/docs/InlineResponse20023.md +3 -5
  453. data/docs/InlineResponse20024.md +4 -4
  454. data/docs/InlineResponse20025.md +4 -2
  455. data/docs/InlineResponse20026.md +4 -2
  456. data/docs/InlineResponse20027.md +2 -2
  457. data/docs/InlineResponse20028.md +1 -1
  458. data/docs/InlineResponse20029.md +3 -3
  459. data/docs/InlineResponse2003.md +1 -1
  460. data/docs/InlineResponse20030.md +2 -4
  461. data/docs/InlineResponse20031.md +3 -3
  462. data/docs/InlineResponse20032.md +3 -1
  463. data/docs/InlineResponse20033.md +1 -3
  464. data/docs/InlineResponse20034.md +3 -3
  465. data/docs/InlineResponse20035.md +1 -1
  466. data/docs/InlineResponse20036.md +1 -1
  467. data/docs/InlineResponse20037.md +5 -3
  468. data/docs/InlineResponse20038.md +1 -1
  469. data/docs/InlineResponse20039.md +1 -1
  470. data/docs/InlineResponse2004.md +1 -1
  471. data/docs/InlineResponse20040.md +1 -1
  472. data/docs/InlineResponse20041.md +1 -1
  473. data/docs/InlineResponse20042.md +2 -4
  474. data/docs/InlineResponse20043.md +1 -1
  475. data/docs/InlineResponse20044.md +4 -2
  476. data/docs/InlineResponse20045.md +3 -5
  477. data/docs/InlineResponse20046.md +3 -3
  478. data/docs/InlineResponse20047.md +5 -3
  479. data/docs/InlineResponse2005.md +3 -3
  480. data/docs/InlineResponse2006.md +3 -3
  481. data/docs/InlineResponse2007.md +1 -1
  482. data/docs/InlineResponse2008.md +1 -1
  483. data/docs/InlineResponse2009.md +3 -3
  484. data/docs/IntegrationApi.md +164 -26
  485. data/docs/IntegrationCustomerSessionResponse.md +1 -1
  486. data/docs/LedgerInfo.md +6 -2
  487. data/docs/LimitCounter.md +1 -1
  488. data/docs/ListCampaignStoreBudgets.md +23 -0
  489. data/docs/ListCampaignStoreBudgetsStore.md +21 -0
  490. data/docs/LoyaltyBalance.md +3 -1
  491. data/docs/LoyaltyBalanceWithTier.md +2 -0
  492. data/docs/LoyaltyBalances.md +1 -1
  493. data/docs/LoyaltyBalancesWithTiers.md +1 -1
  494. data/docs/LoyaltyCard.md +4 -0
  495. data/docs/LoyaltyCardBalances.md +1 -1
  496. data/docs/LoyaltyCardBatch.md +3 -1
  497. data/docs/LoyaltyLedger.md +1 -1
  498. data/docs/LoyaltyLedgerEntry.md +3 -1
  499. data/docs/LoyaltyMembership.md +1 -1
  500. data/docs/LoyaltyProgram.md +5 -3
  501. data/docs/LoyaltyProgramBalance.md +7 -3
  502. data/docs/LoyaltyProgramEntity.md +5 -1
  503. data/docs/LoyaltySubLedger.md +2 -0
  504. data/docs/LoyaltyTier.md +6 -2
  505. data/docs/ManagementApi.md +244 -250
  506. data/docs/ManagementKey.md +3 -1
  507. data/docs/MessageLogEntry.md +10 -2
  508. data/docs/ModelReturn.md +1 -1
  509. data/docs/NewAudience.md +1 -1
  510. data/docs/NewCampaignSet.md +1 -1
  511. data/docs/NewCampaignStoreBudget.md +21 -0
  512. data/docs/NewCampaignStoreBudgetStoreLimit.md +19 -0
  513. data/docs/NewCampaignTemplate.md +2 -0
  514. data/docs/NewCustomerSessionV2.md +4 -4
  515. data/docs/NewLoyaltyProgram.md +2 -0
  516. data/docs/NewLoyaltyTier.md +2 -2
  517. data/docs/NewManagementKey.md +2 -0
  518. data/docs/NewPicklist.md +1 -1
  519. data/docs/NewWebhook.md +1 -1
  520. data/docs/PendingPointsNotificationPolicy.md +3 -1
  521. data/docs/Picklist.md +1 -1
  522. data/docs/Product.md +1 -1
  523. data/docs/ProductSearchMatch.md +21 -0
  524. data/docs/ProductSkuUnitAnalytics.md +23 -0
  525. data/docs/ProductUnitAnalytics.md +19 -0
  526. data/docs/ScimNewUser.md +1 -1
  527. data/docs/ScimServiceProviderConfigResponse.md +3 -1
  528. data/docs/ScimServiceProviderConfigResponseSort.md +17 -0
  529. data/docs/ScimUser.md +1 -1
  530. data/docs/Store.md +3 -3
  531. data/docs/StrikethroughDebugResponse.md +19 -0
  532. data/docs/StrikethroughEffect.md +5 -1
  533. data/docs/StrikethroughLabelingNotification.md +4 -2
  534. data/docs/SummaryCampaignStoreBudget.md +23 -0
  535. data/docs/TemplateArgDef.md +2 -0
  536. data/docs/TemplateDef.md +1 -1
  537. data/docs/TierDowngradeNotificationPolicy.md +3 -1
  538. data/docs/TierUpgradeNotificationPolicy.md +3 -1
  539. data/docs/TierWillDowngradeNotificationPolicy.md +2 -0
  540. data/docs/UpdateAchievement.md +11 -3
  541. data/docs/UpdateCampaignTemplate.md +2 -0
  542. data/docs/UpdateLoyaltyProgram.md +2 -0
  543. data/docs/UpdateLoyaltyProgramTier.md +21 -0
  544. data/docs/UpdatePicklist.md +1 -1
  545. data/docs/User.md +2 -2
  546. data/docs/ValueMap.md +23 -0
  547. data/docs/Webhook.md +1 -1
  548. data/docs/WebhookLogEntry.md +1 -1
  549. data/docs/WebhookWithOutgoingIntegrationDetails.md +1 -1
  550. data/lib/talon_one/api/integration_api.rb +233 -42
  551. data/lib/talon_one/api/management_api.rb +323 -333
  552. data/lib/talon_one/models/account.rb +0 -1
  553. data/lib/talon_one/models/account_additional_cost.rb +0 -1
  554. data/lib/talon_one/models/achievement.rb +113 -16
  555. data/lib/talon_one/models/achievement_additional_properties.rb +49 -10
  556. data/lib/talon_one/models/achievement_progress.rb +4 -137
  557. data/lib/talon_one/models/add_free_item_effect_props.rb +14 -4
  558. data/lib/talon_one/models/add_loyalty_points_effect_props.rb +11 -0
  559. data/lib/talon_one/models/additional_campaign_properties.rb +19 -12
  560. data/lib/talon_one/models/analytics_product.rb +251 -0
  561. data/lib/talon_one/models/analytics_product_sku.rb +242 -0
  562. data/lib/talon_one/models/application.rb +0 -1
  563. data/lib/talon_one/models/application_api_key.rb +2 -3
  564. data/lib/talon_one/models/application_campaign_analytics.rb +2 -2
  565. data/lib/talon_one/models/application_campaign_stats.rb +16 -1
  566. data/lib/talon_one/models/application_cif.rb +1 -2
  567. data/lib/talon_one/models/application_cif_expression.rb +1 -2
  568. data/lib/talon_one/models/application_customer.rb +4 -5
  569. data/lib/talon_one/models/application_entity.rb +1 -1
  570. data/lib/talon_one/models/application_event.rb +1 -2
  571. data/lib/talon_one/models/application_referee.rb +1 -2
  572. data/lib/talon_one/models/application_session.rb +3 -4
  573. data/lib/talon_one/models/async_coupon_deletion_job_response.rb +0 -1
  574. data/lib/talon_one/models/attribute.rb +0 -1
  575. data/lib/talon_one/models/audience.rb +1 -2
  576. data/lib/talon_one/models/audience_customer.rb +1 -2
  577. data/lib/talon_one/models/base_loyalty_program.rb +26 -4
  578. data/lib/talon_one/models/base_notification.rb +0 -1
  579. data/lib/talon_one/models/base_notification_webhook.rb +0 -1
  580. data/lib/talon_one/models/bulk_operation_on_campaigns.rb +16 -6
  581. data/lib/talon_one/models/campaign.rb +39 -11
  582. data/lib/talon_one/models/campaign_analytics.rb +0 -1
  583. data/lib/talon_one/models/campaign_collection.rb +0 -1
  584. data/lib/talon_one/models/campaign_collection_without_payload.rb +0 -1
  585. data/lib/talon_one/models/campaign_evaluation_group.rb +1 -2
  586. data/lib/talon_one/models/campaign_group.rb +0 -1
  587. data/lib/talon_one/models/campaign_notification_policy.rb +14 -4
  588. data/lib/talon_one/models/campaign_set.rb +1 -2
  589. data/lib/talon_one/models/campaign_store_budget.rb +1 -2
  590. data/lib/talon_one/models/campaign_template.rb +10 -2
  591. data/lib/talon_one/models/campaign_template_coupon_reservation_settings.rb +243 -0
  592. data/lib/talon_one/models/campaign_versions.rb +45 -1
  593. data/lib/talon_one/models/card_expiring_points_notification_policy.rb +14 -4
  594. data/lib/talon_one/models/card_ledger_transaction_log_entry.rb +11 -0
  595. data/lib/talon_one/models/card_ledger_transaction_log_entry_integration_api.rb +11 -0
  596. data/lib/talon_one/models/catalog.rb +0 -1
  597. data/lib/talon_one/models/catalog_item.rb +0 -1
  598. data/lib/talon_one/models/catalogs_strikethrough_notification_policy.rb +38 -4
  599. data/lib/talon_one/models/change.rb +0 -1
  600. data/lib/talon_one/models/code_generator_settings.rb +11 -0
  601. data/lib/talon_one/models/collection.rb +0 -1
  602. data/lib/talon_one/models/collection_item.rb +0 -1
  603. data/lib/talon_one/models/collection_without_payload.rb +0 -1
  604. data/lib/talon_one/models/coupon.rb +0 -1
  605. data/lib/talon_one/models/coupon_creation_job.rb +1 -2
  606. data/lib/talon_one/models/coupon_deletion_filters.rb +0 -2
  607. data/lib/talon_one/models/coupon_deletion_job.rb +1 -2
  608. data/lib/talon_one/models/coupons_notification_policy.rb +24 -4
  609. data/lib/talon_one/models/create_achievement.rb +90 -9
  610. data/lib/talon_one/models/create_application_api_key.rb +2 -2
  611. data/lib/talon_one/models/custom_effect.rb +0 -1
  612. data/lib/talon_one/models/customer_inventory.rb +1 -1
  613. data/lib/talon_one/models/customer_profile.rb +1 -2
  614. data/lib/talon_one/models/customer_profile_audience_request_item.rb +1 -1
  615. data/lib/talon_one/models/customer_profile_integration_request_v2.rb +1 -1
  616. data/lib/talon_one/models/customer_session.rb +1 -2
  617. data/lib/talon_one/models/customer_session_v2.rb +7 -7
  618. data/lib/talon_one/models/deactivate_user_request.rb +0 -1
  619. data/lib/talon_one/models/deduct_loyalty_points_effect_props.rb +11 -0
  620. data/lib/talon_one/models/effect.rb +1 -1
  621. data/lib/talon_one/models/environment.rb +1 -2
  622. data/lib/talon_one/models/event.rb +1 -2
  623. data/lib/talon_one/models/event_type.rb +0 -1
  624. data/lib/talon_one/models/event_v2.rb +0 -1
  625. data/lib/talon_one/models/expiring_coupons_notification_policy.rb +14 -4
  626. data/lib/talon_one/models/expiring_points_notification_policy.rb +14 -4
  627. data/lib/talon_one/models/export.rb +0 -1
  628. data/lib/talon_one/models/features_feed.rb +0 -1
  629. data/lib/talon_one/models/generate_campaign_description.rb +11 -11
  630. data/lib/talon_one/models/generate_campaign_tags.rb +11 -11
  631. data/lib/talon_one/models/generate_loyalty_card.rb +40 -4
  632. data/lib/talon_one/models/giveaway.rb +0 -1
  633. data/lib/talon_one/models/import.rb +0 -1
  634. data/lib/talon_one/models/inline_response2001.rb +11 -11
  635. data/lib/talon_one/models/inline_response20010.rb +11 -11
  636. data/lib/talon_one/models/inline_response20011.rb +11 -11
  637. data/lib/talon_one/models/inline_response20012.rb +1 -1
  638. data/lib/talon_one/models/inline_response20013.rb +1 -1
  639. data/lib/talon_one/models/inline_response20014.rb +1 -1
  640. data/lib/talon_one/models/inline_response20015.rb +11 -11
  641. data/lib/talon_one/models/inline_response20016.rb +11 -13
  642. data/lib/talon_one/models/inline_response20017.rb +7 -11
  643. data/lib/talon_one/models/inline_response20018.rb +1 -1
  644. data/lib/talon_one/models/inline_response20019.rb +3 -1
  645. data/lib/talon_one/models/inline_response2002.rb +11 -11
  646. data/lib/talon_one/models/inline_response20020.rb +11 -7
  647. data/lib/talon_one/models/inline_response20021.rb +11 -11
  648. data/lib/talon_one/models/inline_response20022.rb +7 -11
  649. data/lib/talon_one/models/inline_response20023.rb +7 -11
  650. data/lib/talon_one/models/inline_response20024.rb +11 -11
  651. data/lib/talon_one/models/inline_response20025.rb +11 -7
  652. data/lib/talon_one/models/inline_response20026.rb +11 -7
  653. data/lib/talon_one/models/inline_response20027.rb +6 -1
  654. data/lib/talon_one/models/inline_response20028.rb +1 -1
  655. data/lib/talon_one/models/inline_response20029.rb +8 -13
  656. data/lib/talon_one/models/inline_response2003.rb +1 -1
  657. data/lib/talon_one/models/inline_response20030.rb +7 -11
  658. data/lib/talon_one/models/inline_response20031.rb +13 -8
  659. data/lib/talon_one/models/inline_response20032.rb +11 -2
  660. data/lib/talon_one/models/inline_response20033.rb +2 -11
  661. data/lib/talon_one/models/inline_response20034.rb +8 -13
  662. data/lib/talon_one/models/inline_response20035.rb +1 -1
  663. data/lib/talon_one/models/inline_response20036.rb +1 -1
  664. data/lib/talon_one/models/inline_response20037.rb +11 -7
  665. data/lib/talon_one/models/inline_response20038.rb +1 -1
  666. data/lib/talon_one/models/inline_response20039.rb +1 -1
  667. data/lib/talon_one/models/inline_response2004.rb +1 -1
  668. data/lib/talon_one/models/inline_response20040.rb +1 -1
  669. data/lib/talon_one/models/inline_response20041.rb +1 -1
  670. data/lib/talon_one/models/inline_response20042.rb +7 -11
  671. data/lib/talon_one/models/inline_response20043.rb +1 -1
  672. data/lib/talon_one/models/inline_response20044.rb +11 -7
  673. data/lib/talon_one/models/inline_response20045.rb +7 -11
  674. data/lib/talon_one/models/inline_response20046.rb +13 -8
  675. data/lib/talon_one/models/inline_response20047.rb +11 -7
  676. data/lib/talon_one/models/inline_response2005.rb +11 -11
  677. data/lib/talon_one/models/inline_response2006.rb +11 -11
  678. data/lib/talon_one/models/inline_response2007.rb +1 -1
  679. data/lib/talon_one/models/inline_response2008.rb +1 -1
  680. data/lib/talon_one/models/inline_response2009.rb +11 -11
  681. data/lib/talon_one/models/integration_coupon.rb +0 -1
  682. data/lib/talon_one/models/integration_customer_session_response.rb +1 -0
  683. data/lib/talon_one/models/integration_event.rb +0 -1
  684. data/lib/talon_one/models/integration_event_v2_request.rb +0 -1
  685. data/lib/talon_one/models/inventory_coupon.rb +0 -1
  686. data/lib/talon_one/models/inventory_referral.rb +0 -1
  687. data/lib/talon_one/models/item_attribute.rb +0 -1
  688. data/lib/talon_one/models/ledger_entry.rb +1 -1
  689. data/lib/talon_one/models/ledger_info.rb +34 -4
  690. data/lib/talon_one/models/library_attribute.rb +0 -1
  691. data/lib/talon_one/models/limit_counter.rb +1 -2
  692. data/lib/talon_one/models/list_campaign_store_budgets.rb +248 -0
  693. data/lib/talon_one/models/list_campaign_store_budgets_store.rb +239 -0
  694. data/lib/talon_one/models/login_params.rb +0 -1
  695. data/lib/talon_one/models/loyalty_balance.rb +14 -4
  696. data/lib/talon_one/models/loyalty_balance_with_tier.rb +12 -2
  697. data/lib/talon_one/models/loyalty_card.rb +54 -2
  698. data/lib/talon_one/models/loyalty_card_balances.rb +1 -1
  699. data/lib/talon_one/models/loyalty_card_batch.rb +13 -5
  700. data/lib/talon_one/models/loyalty_ledger_entry.rb +13 -4
  701. data/lib/talon_one/models/loyalty_program.rb +25 -3
  702. data/lib/talon_one/models/loyalty_program_balance.rb +36 -6
  703. data/lib/talon_one/models/loyalty_program_entity.rb +24 -4
  704. data/lib/talon_one/models/loyalty_program_transaction.rb +11 -0
  705. data/lib/talon_one/models/loyalty_sub_ledger.rb +16 -1
  706. data/lib/talon_one/models/loyalty_tier.rb +24 -4
  707. data/lib/talon_one/models/management_key.rb +14 -5
  708. data/lib/talon_one/models/message_log_entry.rb +67 -7
  709. data/lib/talon_one/models/model_return.rb +1 -2
  710. data/lib/talon_one/models/multiple_audiences_item.rb +0 -1
  711. data/lib/talon_one/models/multiple_customer_profile_integration_request_item.rb +1 -1
  712. data/lib/talon_one/models/new_account_sign_up.rb +0 -1
  713. data/lib/talon_one/models/new_additional_cost.rb +0 -1
  714. data/lib/talon_one/models/new_application_api_key.rb +2 -3
  715. data/lib/talon_one/models/new_attribute.rb +0 -1
  716. data/lib/talon_one/models/new_audience.rb +1 -2
  717. data/lib/talon_one/models/new_base_notification.rb +0 -1
  718. data/lib/talon_one/models/new_campaign.rb +0 -1
  719. data/lib/talon_one/models/new_campaign_collection.rb +0 -1
  720. data/lib/talon_one/models/new_campaign_set.rb +1 -2
  721. data/lib/talon_one/models/new_campaign_store_budget.rb +283 -0
  722. data/lib/talon_one/models/new_campaign_store_budget_store_limit.rb +227 -0
  723. data/lib/talon_one/models/new_campaign_template.rb +10 -1
  724. data/lib/talon_one/models/new_catalog.rb +0 -1
  725. data/lib/talon_one/models/new_collection.rb +0 -1
  726. data/lib/talon_one/models/new_coupon_creation_job.rb +0 -1
  727. data/lib/talon_one/models/new_coupons.rb +0 -1
  728. data/lib/talon_one/models/new_coupons_for_multiple_recipients.rb +0 -1
  729. data/lib/talon_one/models/new_custom_effect.rb +0 -1
  730. data/lib/talon_one/models/new_customer_session.rb +0 -1
  731. data/lib/talon_one/models/new_customer_session_v2.rb +3 -3
  732. data/lib/talon_one/models/new_event.rb +0 -1
  733. data/lib/talon_one/models/new_event_type.rb +0 -1
  734. data/lib/talon_one/models/new_loyalty_program.rb +24 -2
  735. data/lib/talon_one/models/new_loyalty_tier.rb +2 -2
  736. data/lib/talon_one/models/new_management_key.rb +11 -2
  737. data/lib/talon_one/models/new_multiple_audiences_item.rb +0 -1
  738. data/lib/talon_one/models/new_referral.rb +0 -1
  739. data/lib/talon_one/models/new_referrals_for_multiple_advocates.rb +0 -1
  740. data/lib/talon_one/models/new_role.rb +0 -1
  741. data/lib/talon_one/models/new_role_v2.rb +0 -1
  742. data/lib/talon_one/models/new_saml_connection.rb +1 -1
  743. data/lib/talon_one/models/new_store.rb +0 -1
  744. data/lib/talon_one/models/new_user.rb +0 -1
  745. data/lib/talon_one/models/new_webhook.rb +1 -2
  746. data/lib/talon_one/models/outgoing_integration_template_with_configuration_details.rb +0 -1
  747. data/lib/talon_one/models/pending_points_notification_policy.rb +14 -4
  748. data/lib/talon_one/models/picklist.rb +0 -1
  749. data/lib/talon_one/models/product.rb +1 -20
  750. data/lib/talon_one/models/product_search_match.rb +232 -0
  751. data/lib/talon_one/models/product_sku_unit_analytics.rb +256 -0
  752. data/lib/talon_one/models/product_unit_analytics.rb +227 -0
  753. data/lib/talon_one/models/referral.rb +0 -1
  754. data/lib/talon_one/models/revision.rb +0 -1
  755. data/lib/talon_one/models/revision_version.rb +0 -1
  756. data/lib/talon_one/models/role.rb +0 -1
  757. data/lib/talon_one/models/role_assign.rb +0 -1
  758. data/lib/talon_one/models/role_v2.rb +0 -1
  759. data/lib/talon_one/models/rollback_added_loyalty_points_effect_props.rb +11 -0
  760. data/lib/talon_one/models/rollback_deducted_loyalty_points_effect_props.rb +11 -0
  761. data/lib/talon_one/models/ruleset.rb +0 -1
  762. data/lib/talon_one/models/saml_connection.rb +1 -1
  763. data/lib/talon_one/models/scim_new_user.rb +5 -0
  764. data/lib/talon_one/models/scim_service_provider_config_response.rb +13 -4
  765. data/lib/talon_one/models/scim_service_provider_config_response_sort.rb +208 -0
  766. data/lib/talon_one/models/scim_user.rb +5 -0
  767. data/lib/talon_one/models/store.rb +2 -3
  768. data/lib/talon_one/models/strikethrough_debug_response.rb +221 -0
  769. data/lib/talon_one/models/strikethrough_effect.rb +24 -4
  770. data/lib/talon_one/models/strikethrough_labeling_notification.rb +46 -2
  771. data/lib/talon_one/models/summary_campaign_store_budget.rb +294 -0
  772. data/lib/talon_one/models/talang_attribute.rb +0 -1
  773. data/lib/talon_one/models/template_arg_def.rb +11 -2
  774. data/lib/talon_one/models/template_def.rb +1 -2
  775. data/lib/talon_one/models/template_limit_config.rb +0 -1
  776. data/lib/talon_one/models/tier_downgrade_notification_policy.rb +14 -4
  777. data/lib/talon_one/models/tier_upgrade_notification_policy.rb +14 -4
  778. data/lib/talon_one/models/tier_will_downgrade_notification_policy.rb +11 -1
  779. data/lib/talon_one/models/transfer_loyalty_card.rb +11 -0
  780. data/lib/talon_one/models/update_achievement.rb +92 -6
  781. data/lib/talon_one/models/update_campaign_evaluation_group.rb +0 -1
  782. data/lib/talon_one/models/update_campaign_group.rb +0 -1
  783. data/lib/talon_one/models/update_campaign_template.rb +10 -1
  784. data/lib/talon_one/models/update_coupon.rb +0 -1
  785. data/lib/talon_one/models/update_coupon_batch.rb +0 -1
  786. data/lib/talon_one/models/update_loyalty_program.rb +24 -2
  787. data/lib/talon_one/models/update_loyalty_program_tier.rb +257 -0
  788. data/lib/talon_one/models/update_picklist.rb +0 -1
  789. data/lib/talon_one/models/user.rb +0 -1
  790. data/lib/talon_one/models/value_map.rb +245 -0
  791. data/lib/talon_one/models/webhook.rb +1 -2
  792. data/lib/talon_one/models/webhook_log_entry.rb +1 -1
  793. data/lib/talon_one/models/webhook_with_outgoing_integration_details.rb +1 -2
  794. data/lib/talon_one/version.rb +1 -1
  795. data/lib/talon_one.rb +30 -5
  796. data/spec/api/integration_api_spec.rb +50 -14
  797. data/spec/api/management_api_spec.rb +106 -109
  798. data/spec/models/achievement_additional_properties_spec.rb +10 -0
  799. data/spec/models/achievement_base_spec.rb +103 -0
  800. data/spec/models/achievement_progress_spec.rb +1 -37
  801. data/spec/models/achievement_progress_with_definition_spec.rb +137 -0
  802. data/spec/models/achievement_spec.rb +42 -0
  803. data/spec/models/achievement_status_entry_spec.rb +137 -0
  804. data/spec/models/add_free_item_effect_props_spec.rb +6 -0
  805. data/spec/models/additional_campaign_properties_spec.rb +7 -1
  806. data/spec/models/analytics_product_sku_spec.rb +53 -0
  807. data/spec/models/analytics_product_spec.rb +59 -0
  808. data/spec/models/analytics_sku_spec.rb +59 -0
  809. data/spec/models/application_api_key_spec.rb +1 -1
  810. data/spec/models/application_campaign_analytics_spec.rb +1 -1
  811. data/spec/models/application_campaign_stats_spec.rb +6 -0
  812. data/spec/models/application_cif_references_spec.rb +47 -0
  813. data/spec/models/base_loyalty_program_spec.rb +10 -0
  814. data/spec/models/bulk_operation_on_campaigns_spec.rb +7 -1
  815. data/spec/models/campaign_detail_spec.rb +47 -0
  816. data/spec/models/campaign_notification_policy_spec.rb +6 -0
  817. data/spec/models/campaign_spec.rb +17 -1
  818. data/spec/models/campaign_store_budget_limit_config_spec.rb +73 -0
  819. data/spec/models/campaign_template_coupon_reservation_settings_spec.rb +47 -0
  820. data/spec/models/campaign_template_spec.rb +6 -0
  821. data/spec/models/campaign_versions_spec.rb +10 -0
  822. data/spec/models/card_expiring_points_notification_policy_spec.rb +6 -0
  823. data/spec/models/catalogs_strikethrough_notification_policy_spec.rb +6 -0
  824. data/spec/models/coupons_notification_policy_spec.rb +12 -0
  825. data/spec/models/create_achievement_spec.rb +32 -0
  826. data/spec/models/create_application_api_key_spec.rb +1 -1
  827. data/spec/models/expiring_coupons_notification_policy_spec.rb +6 -0
  828. data/spec/models/expiring_points_notification_policy_spec.rb +6 -0
  829. data/spec/models/generate_campaign_description_spec.rb +1 -1
  830. data/spec/models/generate_campaign_tags_spec.rb +1 -1
  831. data/spec/models/generate_loyalty_card_spec.rb +6 -0
  832. data/spec/models/hidden_conditions_effects_spec.rb +59 -0
  833. data/spec/models/inline_response20010_spec.rb +1 -1
  834. data/spec/models/inline_response20011_spec.rb +1 -1
  835. data/spec/models/inline_response20015_spec.rb +1 -1
  836. data/spec/models/inline_response20016_spec.rb +1 -1
  837. data/spec/models/inline_response20017_spec.rb +0 -6
  838. data/spec/models/inline_response2001_spec.rb +1 -1
  839. data/spec/models/inline_response20020_spec.rb +6 -0
  840. data/spec/models/inline_response20021_spec.rb +1 -1
  841. data/spec/models/inline_response20022_spec.rb +0 -6
  842. data/spec/models/inline_response20023_spec.rb +0 -6
  843. data/spec/models/inline_response20024_spec.rb +2 -2
  844. data/spec/models/inline_response20025_spec.rb +6 -0
  845. data/spec/models/inline_response20026_spec.rb +6 -0
  846. data/spec/models/inline_response20029_spec.rb +1 -1
  847. data/spec/models/inline_response2002_spec.rb +1 -1
  848. data/spec/models/inline_response20030_spec.rb +0 -6
  849. data/spec/models/inline_response20031_spec.rb +1 -1
  850. data/spec/models/inline_response20032_spec.rb +6 -0
  851. data/spec/models/inline_response20033_spec.rb +0 -6
  852. data/spec/models/inline_response20034_spec.rb +1 -1
  853. data/spec/models/inline_response20037_spec.rb +6 -0
  854. data/spec/models/inline_response20042_spec.rb +0 -6
  855. data/spec/models/inline_response20044_spec.rb +6 -0
  856. data/spec/models/inline_response20045_spec.rb +0 -6
  857. data/spec/models/inline_response20046_spec.rb +1 -1
  858. data/spec/models/inline_response20047_spec.rb +6 -0
  859. data/spec/models/inline_response20048_spec.rb +47 -0
  860. data/spec/models/inline_response20049_spec.rb +47 -0
  861. data/spec/models/inline_response2005_spec.rb +1 -1
  862. data/spec/models/inline_response2006_spec.rb +1 -1
  863. data/spec/models/inline_response2009_spec.rb +1 -1
  864. data/spec/models/ledger_info_spec.rb +12 -0
  865. data/spec/models/limit_config_spec.rb +1 -1
  866. data/spec/models/list_campaign_store_budgets_spec.rb +59 -0
  867. data/spec/models/list_campaign_store_budgets_store_spec.rb +53 -0
  868. data/spec/models/loyalty_balance_spec.rb +6 -0
  869. data/spec/models/loyalty_balance_with_tier_spec.rb +6 -0
  870. data/spec/models/loyalty_card_batch_spec.rb +6 -0
  871. data/spec/models/loyalty_card_spec.rb +12 -0
  872. data/spec/models/loyalty_ledger_entry_flags_spec.rb +41 -0
  873. data/spec/models/loyalty_ledger_entry_spec.rb +6 -0
  874. data/spec/models/loyalty_program_balance_spec.rb +12 -0
  875. data/spec/models/loyalty_program_entity_spec.rb +12 -0
  876. data/spec/models/loyalty_program_spec.rb +10 -0
  877. data/spec/models/loyalty_sub_ledger_spec.rb +6 -0
  878. data/spec/models/loyalty_tier_spec.rb +12 -0
  879. data/spec/models/management_key_spec.rb +6 -0
  880. data/spec/models/message_log_entry_spec.rb +25 -1
  881. data/spec/models/message_test_spec.rb +47 -0
  882. data/spec/models/new_application_api_key_spec.rb +1 -1
  883. data/spec/models/new_campaign_store_budget_spec.rb +61 -0
  884. data/spec/models/new_campaign_store_budget_store_limit_spec.rb +47 -0
  885. data/spec/models/new_campaign_template_spec.rb +6 -0
  886. data/spec/models/new_loyalty_program_spec.rb +10 -0
  887. data/spec/models/new_management_key_spec.rb +6 -0
  888. data/spec/models/new_message_test_spec.rb +79 -0
  889. data/spec/models/pending_points_notification_policy_spec.rb +6 -0
  890. data/spec/models/product_search_match_spec.rb +53 -0
  891. data/spec/models/product_sku_unit_analytics_spec.rb +59 -0
  892. data/spec/models/product_unit_analytics_data_point_spec.rb +65 -0
  893. data/spec/models/product_unit_analytics_spec.rb +47 -0
  894. data/spec/models/product_unit_analytics_totals_spec.rb +41 -0
  895. data/spec/models/scim_service_provider_config_response_sort_spec.rb +41 -0
  896. data/spec/models/scim_service_provider_config_response_spec.rb +6 -0
  897. data/spec/models/sku_unit_analytics_data_point_spec.rb +59 -0
  898. data/spec/models/sku_unit_analytics_spec.rb +47 -0
  899. data/spec/models/strikethrough_debug_response_spec.rb +47 -0
  900. data/spec/models/strikethrough_effect_spec.rb +12 -0
  901. data/spec/models/strikethrough_labeling_notification_spec.rb +10 -0
  902. data/spec/models/summary_campaign_store_budget_spec.rb +67 -0
  903. data/spec/models/template_arg_def_spec.rb +6 -0
  904. data/spec/models/template_limit_config_spec.rb +1 -1
  905. data/spec/models/tier_downgrade_notification_policy_spec.rb +6 -0
  906. data/spec/models/tier_upgrade_notification_policy_spec.rb +6 -0
  907. data/spec/models/tier_will_downgrade_notification_policy_spec.rb +6 -0
  908. data/spec/models/update_achievement_spec.rb +32 -0
  909. data/spec/models/update_campaign_template_spec.rb +6 -0
  910. data/spec/models/update_loyalty_program_spec.rb +10 -0
  911. data/spec/models/update_loyalty_program_tier_spec.rb +53 -0
  912. data/spec/models/value_map_spec.rb +59 -0
  913. metadata +481 -6
@@ -0,0 +1,1465 @@
1
+ #include "ruby.h"
2
+ #include "../fbuffer/fbuffer.h"
3
+
4
+ static VALUE mJSON, mExt, cParser, eNestingError, Encoding_UTF_8;
5
+ static VALUE CNaN, CInfinity, CMinusInfinity;
6
+
7
+ static ID i_json_creatable_p, i_json_create, i_create_id,
8
+ i_chr, i_deep_const_get, i_match, i_aset, i_aref,
9
+ i_leftshift, i_new, i_try_convert, i_uminus, i_encode;
10
+
11
+ static VALUE sym_max_nesting, sym_allow_nan, sym_allow_trailing_comma, sym_symbolize_names, sym_freeze,
12
+ sym_create_additions, sym_create_id, sym_object_class, sym_array_class,
13
+ sym_decimal_class, sym_match_string;
14
+
15
+ static int binary_encindex;
16
+ static int utf8_encindex;
17
+
18
+ #ifdef HAVE_RB_CATEGORY_WARN
19
+ # define json_deprecated(message) rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, message)
20
+ #else
21
+ # define json_deprecated(message) rb_warn(message)
22
+ #endif
23
+
24
+ static const char deprecated_create_additions_warning[] =
25
+ "JSON.load implicit support for `create_additions: true` is deprecated "
26
+ "and will be removed in 3.0, use JSON.unsafe_load or explicitly "
27
+ "pass `create_additions: true`";
28
+
29
+ #ifndef HAVE_RB_GC_MARK_LOCATIONS
30
+ // For TruffleRuby
31
+ void rb_gc_mark_locations(const VALUE *start, const VALUE *end)
32
+ {
33
+ VALUE *value = start;
34
+
35
+ while (value < end) {
36
+ rb_gc_mark(*value);
37
+ value++;
38
+ }
39
+ }
40
+ #endif
41
+
42
+ #ifndef HAVE_RB_HASH_BULK_INSERT
43
+ // For TruffleRuby
44
+ void rb_hash_bulk_insert(long count, const VALUE *pairs, VALUE hash)
45
+ {
46
+ long index = 0;
47
+ while (index < count) {
48
+ VALUE name = pairs[index++];
49
+ VALUE value = pairs[index++];
50
+ rb_hash_aset(hash, name, value);
51
+ }
52
+ RB_GC_GUARD(hash);
53
+ }
54
+ #endif
55
+
56
+ /* name cache */
57
+
58
+ #include <string.h>
59
+ #include <ctype.h>
60
+
61
+ // Object names are likely to be repeated, and are frozen.
62
+ // As such we can re-use them if we keep a cache of the ones we've seen so far,
63
+ // and save much more expensive lookups into the global fstring table.
64
+ // This cache implementation is deliberately simple, as we're optimizing for compactness,
65
+ // to be able to fit safely on the stack.
66
+ // As such, binary search into a sorted array gives a good tradeoff between compactness and
67
+ // performance.
68
+ #define JSON_RVALUE_CACHE_CAPA 63
69
+ typedef struct rvalue_cache_struct {
70
+ int length;
71
+ VALUE entries[JSON_RVALUE_CACHE_CAPA];
72
+ } rvalue_cache;
73
+
74
+ static rb_encoding *enc_utf8;
75
+
76
+ #define JSON_RVALUE_CACHE_MAX_ENTRY_LENGTH 55
77
+
78
+ static inline VALUE build_interned_string(const char *str, const long length)
79
+ {
80
+ # ifdef HAVE_RB_ENC_INTERNED_STR
81
+ return rb_enc_interned_str(str, length, enc_utf8);
82
+ # else
83
+ VALUE rstring = rb_utf8_str_new(str, length);
84
+ return rb_funcall(rb_str_freeze(rstring), i_uminus, 0);
85
+ # endif
86
+ }
87
+
88
+ static inline VALUE build_symbol(const char *str, const long length)
89
+ {
90
+ return rb_str_intern(build_interned_string(str, length));
91
+ }
92
+
93
+ static void rvalue_cache_insert_at(rvalue_cache *cache, int index, VALUE rstring)
94
+ {
95
+ MEMMOVE(&cache->entries[index + 1], &cache->entries[index], VALUE, cache->length - index);
96
+ cache->length++;
97
+ cache->entries[index] = rstring;
98
+ }
99
+
100
+ static inline int rstring_cache_cmp(const char *str, const long length, VALUE rstring)
101
+ {
102
+ long rstring_length = RSTRING_LEN(rstring);
103
+ if (length == rstring_length) {
104
+ return memcmp(str, RSTRING_PTR(rstring), length);
105
+ } else {
106
+ return (int)(length - rstring_length);
107
+ }
108
+ }
109
+
110
+ static VALUE rstring_cache_fetch(rvalue_cache *cache, const char *str, const long length)
111
+ {
112
+ if (RB_UNLIKELY(length > JSON_RVALUE_CACHE_MAX_ENTRY_LENGTH)) {
113
+ // Common names aren't likely to be very long. So we just don't
114
+ // cache names above an arbitrary threshold.
115
+ return Qfalse;
116
+ }
117
+
118
+ if (RB_UNLIKELY(!isalpha(str[0]))) {
119
+ // Simple heuristic, if the first character isn't a letter,
120
+ // we're much less likely to see this string again.
121
+ // We mostly want to cache strings that are likely to be repeated.
122
+ return Qfalse;
123
+ }
124
+
125
+ int low = 0;
126
+ int high = cache->length - 1;
127
+ int mid = 0;
128
+ int last_cmp = 0;
129
+
130
+ while (low <= high) {
131
+ mid = (high + low) >> 1;
132
+ VALUE entry = cache->entries[mid];
133
+ last_cmp = rstring_cache_cmp(str, length, entry);
134
+
135
+ if (last_cmp == 0) {
136
+ return entry;
137
+ } else if (last_cmp > 0) {
138
+ low = mid + 1;
139
+ } else {
140
+ high = mid - 1;
141
+ }
142
+ }
143
+
144
+ if (RB_UNLIKELY(memchr(str, '\\', length))) {
145
+ // We assume the overwhelming majority of names don't need to be escaped.
146
+ // But if they do, we have to fallback to the slow path.
147
+ return Qfalse;
148
+ }
149
+
150
+ VALUE rstring = build_interned_string(str, length);
151
+
152
+ if (cache->length < JSON_RVALUE_CACHE_CAPA) {
153
+ if (last_cmp > 0) {
154
+ mid += 1;
155
+ }
156
+
157
+ rvalue_cache_insert_at(cache, mid, rstring);
158
+ }
159
+ return rstring;
160
+ }
161
+
162
+ static VALUE rsymbol_cache_fetch(rvalue_cache *cache, const char *str, const long length)
163
+ {
164
+ if (RB_UNLIKELY(length > JSON_RVALUE_CACHE_MAX_ENTRY_LENGTH)) {
165
+ // Common names aren't likely to be very long. So we just don't
166
+ // cache names above an arbitrary threshold.
167
+ return Qfalse;
168
+ }
169
+
170
+ if (RB_UNLIKELY(!isalpha(str[0]))) {
171
+ // Simple heuristic, if the first character isn't a letter,
172
+ // we're much less likely to see this string again.
173
+ // We mostly want to cache strings that are likely to be repeated.
174
+ return Qfalse;
175
+ }
176
+
177
+ int low = 0;
178
+ int high = cache->length - 1;
179
+ int mid = 0;
180
+ int last_cmp = 0;
181
+
182
+ while (low <= high) {
183
+ mid = (high + low) >> 1;
184
+ VALUE entry = cache->entries[mid];
185
+ last_cmp = rstring_cache_cmp(str, length, rb_sym2str(entry));
186
+
187
+ if (last_cmp == 0) {
188
+ return entry;
189
+ } else if (last_cmp > 0) {
190
+ low = mid + 1;
191
+ } else {
192
+ high = mid - 1;
193
+ }
194
+ }
195
+
196
+ if (RB_UNLIKELY(memchr(str, '\\', length))) {
197
+ // We assume the overwhelming majority of names don't need to be escaped.
198
+ // But if they do, we have to fallback to the slow path.
199
+ return Qfalse;
200
+ }
201
+
202
+ VALUE rsymbol = build_symbol(str, length);
203
+
204
+ if (cache->length < JSON_RVALUE_CACHE_CAPA) {
205
+ if (last_cmp > 0) {
206
+ mid += 1;
207
+ }
208
+
209
+ rvalue_cache_insert_at(cache, mid, rsymbol);
210
+ }
211
+ return rsymbol;
212
+ }
213
+
214
+ /* rvalue stack */
215
+
216
+ #define RVALUE_STACK_INITIAL_CAPA 128
217
+
218
+ enum rvalue_stack_type {
219
+ RVALUE_STACK_HEAP_ALLOCATED = 0,
220
+ RVALUE_STACK_STACK_ALLOCATED = 1,
221
+ };
222
+
223
+ typedef struct rvalue_stack_struct {
224
+ enum rvalue_stack_type type;
225
+ long capa;
226
+ long head;
227
+ VALUE *ptr;
228
+ } rvalue_stack;
229
+
230
+ static rvalue_stack *rvalue_stack_spill(rvalue_stack *old_stack, VALUE *handle, rvalue_stack **stack_ref);
231
+
232
+ static rvalue_stack *rvalue_stack_grow(rvalue_stack *stack, VALUE *handle, rvalue_stack **stack_ref)
233
+ {
234
+ long required = stack->capa * 2;
235
+
236
+ if (stack->type == RVALUE_STACK_STACK_ALLOCATED) {
237
+ stack = rvalue_stack_spill(stack, handle, stack_ref);
238
+ } else {
239
+ REALLOC_N(stack->ptr, VALUE, required);
240
+ stack->capa = required;
241
+ }
242
+ return stack;
243
+ }
244
+
245
+ static void rvalue_stack_push(rvalue_stack *stack, VALUE value, VALUE *handle, rvalue_stack **stack_ref)
246
+ {
247
+ if (RB_UNLIKELY(stack->head >= stack->capa)) {
248
+ stack = rvalue_stack_grow(stack, handle, stack_ref);
249
+ }
250
+ stack->ptr[stack->head] = value;
251
+ stack->head++;
252
+ }
253
+
254
+ static inline VALUE *rvalue_stack_peek(rvalue_stack *stack, long count)
255
+ {
256
+ return stack->ptr + (stack->head - count);
257
+ }
258
+
259
+ static inline void rvalue_stack_pop(rvalue_stack *stack, long count)
260
+ {
261
+ stack->head -= count;
262
+ }
263
+
264
+ static void rvalue_stack_mark(void *ptr)
265
+ {
266
+ rvalue_stack *stack = (rvalue_stack *)ptr;
267
+ rb_gc_mark_locations(stack->ptr, stack->ptr + stack->head);
268
+ }
269
+
270
+ static void rvalue_stack_free(void *ptr)
271
+ {
272
+ rvalue_stack *stack = (rvalue_stack *)ptr;
273
+ if (stack) {
274
+ ruby_xfree(stack->ptr);
275
+ ruby_xfree(stack);
276
+ }
277
+ }
278
+
279
+ static size_t rvalue_stack_memsize(const void *ptr)
280
+ {
281
+ const rvalue_stack *stack = (const rvalue_stack *)ptr;
282
+ return sizeof(rvalue_stack) + sizeof(VALUE) * stack->capa;
283
+ }
284
+
285
+ static const rb_data_type_t JSON_Parser_rvalue_stack_type = {
286
+ "JSON::Ext::Parser/rvalue_stack",
287
+ {
288
+ .dmark = rvalue_stack_mark,
289
+ .dfree = rvalue_stack_free,
290
+ .dsize = rvalue_stack_memsize,
291
+ },
292
+ 0, 0,
293
+ RUBY_TYPED_FREE_IMMEDIATELY,
294
+ };
295
+
296
+ static rvalue_stack *rvalue_stack_spill(rvalue_stack *old_stack, VALUE *handle, rvalue_stack **stack_ref)
297
+ {
298
+ rvalue_stack *stack;
299
+ *handle = TypedData_Make_Struct(0, rvalue_stack, &JSON_Parser_rvalue_stack_type, stack);
300
+ *stack_ref = stack;
301
+ MEMCPY(stack, old_stack, rvalue_stack, 1);
302
+
303
+ stack->capa = old_stack->capa << 1;
304
+ stack->ptr = ALLOC_N(VALUE, stack->capa);
305
+ stack->type = RVALUE_STACK_HEAP_ALLOCATED;
306
+ MEMCPY(stack->ptr, old_stack->ptr, VALUE, old_stack->head);
307
+ return stack;
308
+ }
309
+
310
+ static void rvalue_stack_eagerly_release(VALUE handle)
311
+ {
312
+ rvalue_stack *stack;
313
+ TypedData_Get_Struct(handle, rvalue_stack, &JSON_Parser_rvalue_stack_type, stack);
314
+ RTYPEDDATA_DATA(handle) = NULL;
315
+ rvalue_stack_free(stack);
316
+ }
317
+
318
+ /* unicode */
319
+
320
+ static const signed char digit_values[256] = {
321
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
322
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
323
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
324
+ -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1,
325
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
326
+ 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
327
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
328
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
329
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
330
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
331
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
332
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
333
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
334
+ -1, -1, -1, -1, -1, -1, -1
335
+ };
336
+
337
+ static uint32_t unescape_unicode(const unsigned char *p)
338
+ {
339
+ const uint32_t replacement_char = 0xFFFD;
340
+
341
+ signed char b;
342
+ uint32_t result = 0;
343
+ b = digit_values[p[0]];
344
+ if (b < 0) return replacement_char;
345
+ result = (result << 4) | (unsigned char)b;
346
+ b = digit_values[p[1]];
347
+ if (b < 0) return replacement_char;
348
+ result = (result << 4) | (unsigned char)b;
349
+ b = digit_values[p[2]];
350
+ if (b < 0) return replacement_char;
351
+ result = (result << 4) | (unsigned char)b;
352
+ b = digit_values[p[3]];
353
+ if (b < 0) return replacement_char;
354
+ result = (result << 4) | (unsigned char)b;
355
+ return result;
356
+ }
357
+
358
+ static int convert_UTF32_to_UTF8(char *buf, uint32_t ch)
359
+ {
360
+ int len = 1;
361
+ if (ch <= 0x7F) {
362
+ buf[0] = (char) ch;
363
+ } else if (ch <= 0x07FF) {
364
+ buf[0] = (char) ((ch >> 6) | 0xC0);
365
+ buf[1] = (char) ((ch & 0x3F) | 0x80);
366
+ len++;
367
+ } else if (ch <= 0xFFFF) {
368
+ buf[0] = (char) ((ch >> 12) | 0xE0);
369
+ buf[1] = (char) (((ch >> 6) & 0x3F) | 0x80);
370
+ buf[2] = (char) ((ch & 0x3F) | 0x80);
371
+ len += 2;
372
+ } else if (ch <= 0x1fffff) {
373
+ buf[0] =(char) ((ch >> 18) | 0xF0);
374
+ buf[1] =(char) (((ch >> 12) & 0x3F) | 0x80);
375
+ buf[2] =(char) (((ch >> 6) & 0x3F) | 0x80);
376
+ buf[3] =(char) ((ch & 0x3F) | 0x80);
377
+ len += 3;
378
+ } else {
379
+ buf[0] = '?';
380
+ }
381
+ return len;
382
+ }
383
+
384
+ typedef struct JSON_ParserStruct {
385
+ VALUE Vsource;
386
+ char *source;
387
+ long len;
388
+ char *memo;
389
+ VALUE create_id;
390
+ VALUE object_class;
391
+ VALUE array_class;
392
+ VALUE decimal_class;
393
+ VALUE match_string;
394
+ FBuffer fbuffer;
395
+ int in_array;
396
+ int max_nesting;
397
+ bool allow_nan;
398
+ bool allow_trailing_comma;
399
+ bool parsing_name;
400
+ bool symbolize_names;
401
+ bool freeze;
402
+ bool create_additions;
403
+ bool deprecated_create_additions;
404
+ rvalue_cache name_cache;
405
+ rvalue_stack *stack;
406
+ VALUE stack_handle;
407
+ } JSON_Parser;
408
+
409
+ #define GET_PARSER \
410
+ GET_PARSER_INIT; \
411
+ if (!json->Vsource) rb_raise(rb_eTypeError, "uninitialized instance")
412
+
413
+ #define GET_PARSER_INIT \
414
+ JSON_Parser *json; \
415
+ TypedData_Get_Struct(self, JSON_Parser, &JSON_Parser_type, json)
416
+
417
+ #define MinusInfinity "-Infinity"
418
+ #define EVIL 0x666
419
+
420
+ static const rb_data_type_t JSON_Parser_type;
421
+ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *result);
422
+ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting);
423
+ static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting);
424
+ static char *JSON_parse_number(JSON_Parser *json, char *p, char *pe, VALUE *result);
425
+ static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting);
426
+
427
+
428
+ #define PARSE_ERROR_FRAGMENT_LEN 32
429
+ #ifdef RBIMPL_ATTR_NORETURN
430
+ RBIMPL_ATTR_NORETURN()
431
+ #endif
432
+ static void raise_parse_error(const char *format, const char *start)
433
+ {
434
+ char buffer[PARSE_ERROR_FRAGMENT_LEN + 1];
435
+
436
+ size_t len = strnlen(start, PARSE_ERROR_FRAGMENT_LEN);
437
+ const char *ptr = start;
438
+
439
+ if (len == PARSE_ERROR_FRAGMENT_LEN) {
440
+ MEMCPY(buffer, start, char, PARSE_ERROR_FRAGMENT_LEN);
441
+ buffer[PARSE_ERROR_FRAGMENT_LEN] = '\0';
442
+ ptr = buffer;
443
+ }
444
+
445
+ rb_enc_raise(enc_utf8, rb_path2class("JSON::ParserError"), format, ptr);
446
+ }
447
+
448
+
449
+ %%{
450
+ machine JSON_common;
451
+
452
+ cr = '\n';
453
+ cr_neg = [^\n];
454
+ ws = [ \t\r\n];
455
+ c_comment = '/*' ( any* - (any* '*/' any* ) ) '*/';
456
+ cpp_comment = '//' cr_neg* cr;
457
+ comment = c_comment | cpp_comment;
458
+ ignore = ws | comment;
459
+ name_separator = ':';
460
+ value_separator = ',';
461
+ Vnull = 'null';
462
+ Vfalse = 'false';
463
+ Vtrue = 'true';
464
+ VNaN = 'NaN';
465
+ VInfinity = 'Infinity';
466
+ VMinusInfinity = '-Infinity';
467
+ begin_value = [nft\"\-\[\{NI] | digit;
468
+ begin_object = '{';
469
+ end_object = '}';
470
+ begin_array = '[';
471
+ end_array = ']';
472
+ begin_string = '"';
473
+ begin_name = begin_string;
474
+ begin_number = digit | '-';
475
+ }%%
476
+
477
+ %%{
478
+ machine JSON_object;
479
+ include JSON_common;
480
+
481
+ write data;
482
+
483
+ action parse_value {
484
+ char *np = JSON_parse_value(json, fpc, pe, result, current_nesting);
485
+ if (np == NULL) {
486
+ fhold; fbreak;
487
+ } else {
488
+ fexec np;
489
+ }
490
+ }
491
+
492
+ action allow_trailing_comma { json->allow_trailing_comma }
493
+
494
+ action parse_name {
495
+ char *np;
496
+ json->parsing_name = true;
497
+ np = JSON_parse_string(json, fpc, pe, result);
498
+ json->parsing_name = false;
499
+ if (np == NULL) { fhold; fbreak; } else {
500
+ PUSH(*result);
501
+ fexec np;
502
+ }
503
+ }
504
+
505
+ action exit { fhold; fbreak; }
506
+
507
+ pair = ignore* begin_name >parse_name ignore* name_separator ignore* begin_value >parse_value;
508
+ next_pair = ignore* value_separator pair;
509
+
510
+ main := (
511
+ begin_object
512
+ (pair (next_pair)*((ignore* value_separator) when allow_trailing_comma)?)? ignore*
513
+ end_object
514
+ ) @exit;
515
+ }%%
516
+
517
+ #define PUSH(result) rvalue_stack_push(json->stack, result, &json->stack_handle, &json->stack)
518
+
519
+ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting)
520
+ {
521
+ int cs = EVIL;
522
+
523
+ if (json->max_nesting && current_nesting > json->max_nesting) {
524
+ rb_raise(eNestingError, "nesting of %d is too deep", current_nesting);
525
+ }
526
+
527
+ long stack_head = json->stack->head;
528
+
529
+ %% write init;
530
+ %% write exec;
531
+
532
+ if (cs >= JSON_object_first_final) {
533
+ long count = json->stack->head - stack_head;
534
+
535
+ if (RB_UNLIKELY(json->object_class)) {
536
+ VALUE object = rb_class_new_instance(0, 0, json->object_class);
537
+ long index = 0;
538
+ VALUE *items = rvalue_stack_peek(json->stack, count);
539
+ while (index < count) {
540
+ VALUE name = items[index++];
541
+ VALUE value = items[index++];
542
+ rb_funcall(object, i_aset, 2, name, value);
543
+ }
544
+ *result = object;
545
+ } else {
546
+ VALUE hash;
547
+ #ifdef HAVE_RB_HASH_NEW_CAPA
548
+ hash = rb_hash_new_capa(count >> 1);
549
+ #else
550
+ hash = rb_hash_new();
551
+ #endif
552
+ rb_hash_bulk_insert(count, rvalue_stack_peek(json->stack, count), hash);
553
+ *result = hash;
554
+ }
555
+ rvalue_stack_pop(json->stack, count);
556
+
557
+ if (RB_UNLIKELY(json->create_additions)) {
558
+ VALUE klassname;
559
+ if (json->object_class) {
560
+ klassname = rb_funcall(*result, i_aref, 1, json->create_id);
561
+ } else {
562
+ klassname = rb_hash_aref(*result, json->create_id);
563
+ }
564
+ if (!NIL_P(klassname)) {
565
+ VALUE klass = rb_funcall(mJSON, i_deep_const_get, 1, klassname);
566
+ if (RTEST(rb_funcall(klass, i_json_creatable_p, 0))) {
567
+ if (json->deprecated_create_additions) {
568
+ json_deprecated(deprecated_create_additions_warning);
569
+ }
570
+ *result = rb_funcall(klass, i_json_create, 1, *result);
571
+ }
572
+ }
573
+ }
574
+ return p + 1;
575
+ } else {
576
+ return NULL;
577
+ }
578
+ }
579
+
580
+ %%{
581
+ machine JSON_value;
582
+ include JSON_common;
583
+
584
+ write data;
585
+
586
+ action parse_null {
587
+ *result = Qnil;
588
+ }
589
+ action parse_false {
590
+ *result = Qfalse;
591
+ }
592
+ action parse_true {
593
+ *result = Qtrue;
594
+ }
595
+ action parse_nan {
596
+ if (json->allow_nan) {
597
+ *result = CNaN;
598
+ } else {
599
+ raise_parse_error("unexpected token at '%s'", p - 2);
600
+ }
601
+ }
602
+ action parse_infinity {
603
+ if (json->allow_nan) {
604
+ *result = CInfinity;
605
+ } else {
606
+ raise_parse_error("unexpected token at '%s'", p - 7);
607
+ }
608
+ }
609
+ action parse_string {
610
+ char *np = JSON_parse_string(json, fpc, pe, result);
611
+ if (np == NULL) {
612
+ fhold;
613
+ fbreak;
614
+ } else {
615
+ fexec np;
616
+ }
617
+ }
618
+
619
+ action parse_number {
620
+ char *np;
621
+ if(pe > fpc + 8 && !strncmp(MinusInfinity, fpc, 9)) {
622
+ if (json->allow_nan) {
623
+ *result = CMinusInfinity;
624
+ fexec p + 10;
625
+ fhold; fbreak;
626
+ } else {
627
+ raise_parse_error("unexpected token at '%s'", p);
628
+ }
629
+ }
630
+ np = JSON_parse_number(json, fpc, pe, result);
631
+ if (np != NULL) {
632
+ fexec np;
633
+ }
634
+ fhold; fbreak;
635
+ }
636
+
637
+ action parse_array {
638
+ char *np;
639
+ json->in_array++;
640
+ np = JSON_parse_array(json, fpc, pe, result, current_nesting + 1);
641
+ json->in_array--;
642
+ if (np == NULL) { fhold; fbreak; } else fexec np;
643
+ }
644
+
645
+ action parse_object {
646
+ char *np;
647
+ np = JSON_parse_object(json, fpc, pe, result, current_nesting + 1);
648
+ if (np == NULL) { fhold; fbreak; } else fexec np;
649
+ }
650
+
651
+ action exit { fhold; fbreak; }
652
+
653
+ main := ignore* (
654
+ Vnull @parse_null |
655
+ Vfalse @parse_false |
656
+ Vtrue @parse_true |
657
+ VNaN @parse_nan |
658
+ VInfinity @parse_infinity |
659
+ begin_number @parse_number |
660
+ begin_string @parse_string |
661
+ begin_array @parse_array |
662
+ begin_object @parse_object
663
+ ) ignore* %*exit;
664
+ }%%
665
+
666
+ static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting)
667
+ {
668
+ int cs = EVIL;
669
+
670
+ %% write init;
671
+ %% write exec;
672
+
673
+ if (json->freeze) {
674
+ OBJ_FREEZE(*result);
675
+ }
676
+
677
+ if (cs >= JSON_value_first_final) {
678
+ PUSH(*result);
679
+ return p;
680
+ } else {
681
+ return NULL;
682
+ }
683
+ }
684
+
685
+ %%{
686
+ machine JSON_integer;
687
+
688
+ write data;
689
+
690
+ action exit { fhold; fbreak; }
691
+
692
+ main := '-'? ('0' | [1-9][0-9]*) (^[0-9]? @exit);
693
+ }%%
694
+
695
+ #define MAX_FAST_INTEGER_SIZE 18
696
+ static inline VALUE fast_parse_integer(char *p, char *pe)
697
+ {
698
+ bool negative = false;
699
+ if (*p == '-') {
700
+ negative = true;
701
+ p++;
702
+ }
703
+
704
+ long long memo = 0;
705
+ while (p < pe) {
706
+ memo *= 10;
707
+ memo += *p - '0';
708
+ p++;
709
+ }
710
+
711
+ if (negative) {
712
+ memo = -memo;
713
+ }
714
+ return LL2NUM(memo);
715
+ }
716
+
717
+ static char *JSON_decode_integer(JSON_Parser *json, char *p, VALUE *result)
718
+ {
719
+ long len = p - json->memo;
720
+ if (RB_LIKELY(len < MAX_FAST_INTEGER_SIZE)) {
721
+ *result = fast_parse_integer(json->memo, p);
722
+ } else {
723
+ fbuffer_clear(&json->fbuffer);
724
+ fbuffer_append(&json->fbuffer, json->memo, len);
725
+ fbuffer_append_char(&json->fbuffer, '\0');
726
+ *result = rb_cstr2inum(FBUFFER_PTR(&json->fbuffer), 10);
727
+ }
728
+ return p + 1;
729
+ }
730
+
731
+ %%{
732
+ machine JSON_float;
733
+ include JSON_common;
734
+
735
+ write data;
736
+
737
+ action exit { fhold; fbreak; }
738
+ action isFloat { is_float = true; }
739
+
740
+ main := '-'? (
741
+ (('0' | [1-9][0-9]*)
742
+ ((('.' [0-9]+ ([Ee] [+\-]?[0-9]+)?) |
743
+ ([Ee] [+\-]?[0-9]+)) > isFloat)?
744
+ ) (^[0-9Ee.\-]? @exit ));
745
+ }%%
746
+
747
+ static char *JSON_parse_number(JSON_Parser *json, char *p, char *pe, VALUE *result)
748
+ {
749
+ int cs = EVIL;
750
+ bool is_float = false;
751
+
752
+ %% write init;
753
+ json->memo = p;
754
+ %% write exec;
755
+
756
+ if (cs >= JSON_float_first_final) {
757
+ if (!is_float) {
758
+ return JSON_decode_integer(json, p, result);
759
+ }
760
+ VALUE mod = Qnil;
761
+ ID method_id = 0;
762
+ if (json->decimal_class) {
763
+ if (rb_respond_to(json->decimal_class, i_try_convert)) {
764
+ mod = json->decimal_class;
765
+ method_id = i_try_convert;
766
+ } else if (rb_respond_to(json->decimal_class, i_new)) {
767
+ mod = json->decimal_class;
768
+ method_id = i_new;
769
+ } else if (RB_TYPE_P(json->decimal_class, T_CLASS)) {
770
+ VALUE name = rb_class_name(json->decimal_class);
771
+ const char *name_cstr = RSTRING_PTR(name);
772
+ const char *last_colon = strrchr(name_cstr, ':');
773
+ if (last_colon) {
774
+ const char *mod_path_end = last_colon - 1;
775
+ VALUE mod_path = rb_str_substr(name, 0, mod_path_end - name_cstr);
776
+ mod = rb_path_to_class(mod_path);
777
+
778
+ const char *method_name_beg = last_colon + 1;
779
+ long before_len = method_name_beg - name_cstr;
780
+ long len = RSTRING_LEN(name) - before_len;
781
+ VALUE method_name = rb_str_substr(name, before_len, len);
782
+ method_id = SYM2ID(rb_str_intern(method_name));
783
+ } else {
784
+ mod = rb_mKernel;
785
+ method_id = SYM2ID(rb_str_intern(name));
786
+ }
787
+ }
788
+ }
789
+
790
+ long len = p - json->memo;
791
+ fbuffer_clear(&json->fbuffer);
792
+ fbuffer_append(&json->fbuffer, json->memo, len);
793
+ fbuffer_append_char(&json->fbuffer, '\0');
794
+
795
+ if (method_id) {
796
+ VALUE text = rb_str_new2(FBUFFER_PTR(&json->fbuffer));
797
+ *result = rb_funcallv(mod, method_id, 1, &text);
798
+ } else {
799
+ *result = DBL2NUM(rb_cstr_to_dbl(FBUFFER_PTR(&json->fbuffer), 1));
800
+ }
801
+
802
+ return p + 1;
803
+ } else {
804
+ return NULL;
805
+ }
806
+ }
807
+
808
+
809
+ %%{
810
+ machine JSON_array;
811
+ include JSON_common;
812
+
813
+ write data;
814
+
815
+ action parse_value {
816
+ VALUE v = Qnil;
817
+ char *np = JSON_parse_value(json, fpc, pe, &v, current_nesting);
818
+ if (np == NULL) {
819
+ fhold; fbreak;
820
+ } else {
821
+ fexec np;
822
+ }
823
+ }
824
+
825
+ action allow_trailing_comma { json->allow_trailing_comma }
826
+
827
+ action exit { fhold; fbreak; }
828
+
829
+ next_element = value_separator ignore* begin_value >parse_value;
830
+
831
+ main := begin_array ignore*
832
+ ((begin_value >parse_value ignore*)
833
+ (ignore* next_element ignore*)*((value_separator ignore*) when allow_trailing_comma)?)?
834
+ end_array @exit;
835
+ }%%
836
+
837
+ static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *result, int current_nesting)
838
+ {
839
+ int cs = EVIL;
840
+
841
+ if (json->max_nesting && current_nesting > json->max_nesting) {
842
+ rb_raise(eNestingError, "nesting of %d is too deep", current_nesting);
843
+ }
844
+ long stack_head = json->stack->head;
845
+
846
+ %% write init;
847
+ %% write exec;
848
+
849
+ if(cs >= JSON_array_first_final) {
850
+ long count = json->stack->head - stack_head;
851
+
852
+ if (RB_UNLIKELY(json->array_class)) {
853
+ VALUE array = rb_class_new_instance(0, 0, json->array_class);
854
+ VALUE *items = rvalue_stack_peek(json->stack, count);
855
+ long index;
856
+ for (index = 0; index < count; index++) {
857
+ rb_funcall(array, i_leftshift, 1, items[index]);
858
+ }
859
+ *result = array;
860
+ } else {
861
+ VALUE array = rb_ary_new_from_values(count, rvalue_stack_peek(json->stack, count));
862
+ *result = array;
863
+ }
864
+ rvalue_stack_pop(json->stack, count);
865
+
866
+ return p + 1;
867
+ } else {
868
+ raise_parse_error("unexpected token at '%s'", p);
869
+ return NULL;
870
+ }
871
+ }
872
+
873
+ static inline VALUE build_string(const char *start, const char *end, bool intern, bool symbolize)
874
+ {
875
+ if (symbolize) {
876
+ intern = true;
877
+ }
878
+ VALUE result;
879
+ # ifdef HAVE_RB_ENC_INTERNED_STR
880
+ if (intern) {
881
+ result = rb_enc_interned_str(start, (long)(end - start), enc_utf8);
882
+ } else {
883
+ result = rb_utf8_str_new(start, (long)(end - start));
884
+ }
885
+ # else
886
+ result = rb_utf8_str_new(start, (long)(end - start));
887
+ if (intern) {
888
+ result = rb_funcall(rb_str_freeze(result), i_uminus, 0);
889
+ }
890
+ # endif
891
+
892
+ if (symbolize) {
893
+ result = rb_str_intern(result);
894
+ }
895
+
896
+ return result;
897
+ }
898
+
899
+ static VALUE json_string_fastpath(JSON_Parser *json, char *string, char *stringEnd, bool is_name, bool intern, bool symbolize)
900
+ {
901
+ size_t bufferSize = stringEnd - string;
902
+
903
+ if (is_name && json->in_array) {
904
+ VALUE cached_key;
905
+ if (RB_UNLIKELY(symbolize)) {
906
+ cached_key = rsymbol_cache_fetch(&json->name_cache, string, bufferSize);
907
+ } else {
908
+ cached_key = rstring_cache_fetch(&json->name_cache, string, bufferSize);
909
+ }
910
+
911
+ if (RB_LIKELY(cached_key)) {
912
+ return cached_key;
913
+ }
914
+ }
915
+
916
+ return build_string(string, stringEnd, intern, symbolize);
917
+ }
918
+
919
+ static VALUE json_string_unescape(JSON_Parser *json, char *string, char *stringEnd, bool is_name, bool intern, bool symbolize)
920
+ {
921
+ size_t bufferSize = stringEnd - string;
922
+ char *p = string, *pe = string, *unescape, *bufferStart, *buffer;
923
+ int unescape_len;
924
+ char buf[4];
925
+
926
+ if (is_name && json->in_array) {
927
+ VALUE cached_key;
928
+ if (RB_UNLIKELY(symbolize)) {
929
+ cached_key = rsymbol_cache_fetch(&json->name_cache, string, bufferSize);
930
+ } else {
931
+ cached_key = rstring_cache_fetch(&json->name_cache, string, bufferSize);
932
+ }
933
+
934
+ if (RB_LIKELY(cached_key)) {
935
+ return cached_key;
936
+ }
937
+ }
938
+
939
+ pe = memchr(p, '\\', bufferSize);
940
+ if (RB_UNLIKELY(pe == NULL)) {
941
+ return build_string(string, stringEnd, intern, symbolize);
942
+ }
943
+
944
+ VALUE result = rb_str_buf_new(bufferSize);
945
+ rb_enc_associate_index(result, utf8_encindex);
946
+ buffer = bufferStart = RSTRING_PTR(result);
947
+
948
+ while (pe < stringEnd) {
949
+ if (*pe == '\\') {
950
+ unescape = (char *) "?";
951
+ unescape_len = 1;
952
+ if (pe > p) {
953
+ MEMCPY(buffer, p, char, pe - p);
954
+ buffer += pe - p;
955
+ }
956
+ switch (*++pe) {
957
+ case 'n':
958
+ unescape = (char *) "\n";
959
+ break;
960
+ case 'r':
961
+ unescape = (char *) "\r";
962
+ break;
963
+ case 't':
964
+ unescape = (char *) "\t";
965
+ break;
966
+ case '"':
967
+ unescape = (char *) "\"";
968
+ break;
969
+ case '\\':
970
+ unescape = (char *) "\\";
971
+ break;
972
+ case 'b':
973
+ unescape = (char *) "\b";
974
+ break;
975
+ case 'f':
976
+ unescape = (char *) "\f";
977
+ break;
978
+ case 'u':
979
+ if (pe > stringEnd - 4) {
980
+ raise_parse_error("incomplete unicode character escape sequence at '%s'", p);
981
+ } else {
982
+ uint32_t ch = unescape_unicode((unsigned char *) ++pe);
983
+ pe += 3;
984
+ /* To handle values above U+FFFF, we take a sequence of
985
+ * \uXXXX escapes in the U+D800..U+DBFF then
986
+ * U+DC00..U+DFFF ranges, take the low 10 bits from each
987
+ * to make a 20-bit number, then add 0x10000 to get the
988
+ * final codepoint.
989
+ *
990
+ * See Unicode 15: 3.8 "Surrogates", 5.3 "Handling
991
+ * Surrogate Pairs in UTF-16", and 23.6 "Surrogates
992
+ * Area".
993
+ */
994
+ if ((ch & 0xFC00) == 0xD800) {
995
+ pe++;
996
+ if (pe > stringEnd - 6) {
997
+ raise_parse_error("incomplete surrogate pair at '%s'", p);
998
+ }
999
+ if (pe[0] == '\\' && pe[1] == 'u') {
1000
+ uint32_t sur = unescape_unicode((unsigned char *) pe + 2);
1001
+ ch = (((ch & 0x3F) << 10) | ((((ch >> 6) & 0xF) + 1) << 16)
1002
+ | (sur & 0x3FF));
1003
+ pe += 5;
1004
+ } else {
1005
+ unescape = (char *) "?";
1006
+ break;
1007
+ }
1008
+ }
1009
+ unescape_len = convert_UTF32_to_UTF8(buf, ch);
1010
+ unescape = buf;
1011
+ }
1012
+ break;
1013
+ default:
1014
+ p = pe;
1015
+ continue;
1016
+ }
1017
+ MEMCPY(buffer, unescape, char, unescape_len);
1018
+ buffer += unescape_len;
1019
+ p = ++pe;
1020
+ } else {
1021
+ pe++;
1022
+ }
1023
+ }
1024
+
1025
+ if (pe > p) {
1026
+ MEMCPY(buffer, p, char, pe - p);
1027
+ buffer += pe - p;
1028
+ }
1029
+ rb_str_set_len(result, buffer - bufferStart);
1030
+
1031
+ if (symbolize) {
1032
+ result = rb_str_intern(result);
1033
+ } else if (intern) {
1034
+ result = rb_funcall(rb_str_freeze(result), i_uminus, 0);
1035
+ }
1036
+
1037
+ return result;
1038
+ }
1039
+
1040
+ %%{
1041
+ machine JSON_string;
1042
+ include JSON_common;
1043
+
1044
+ write data;
1045
+
1046
+ action parse_complex_string {
1047
+ *result = json_string_unescape(json, json->memo + 1, p, json->parsing_name, json->parsing_name || json-> freeze, json->parsing_name && json->symbolize_names);
1048
+ fexec p + 1;
1049
+ fhold;
1050
+ fbreak;
1051
+ }
1052
+
1053
+ action parse_simple_string {
1054
+ *result = json_string_fastpath(json, json->memo + 1, p, json->parsing_name, json->parsing_name || json-> freeze, json->parsing_name && json->symbolize_names);
1055
+ fexec p + 1;
1056
+ fhold;
1057
+ fbreak;
1058
+ }
1059
+
1060
+ double_quote = '"';
1061
+ escape = '\\';
1062
+ control = 0..0x1f;
1063
+ simple = any - escape - double_quote - control;
1064
+
1065
+ main := double_quote (
1066
+ (simple*)(
1067
+ (double_quote) @parse_simple_string |
1068
+ ((^([\"\\] | control) | escape[\"\\/bfnrt] | '\\u'[0-9a-fA-F]{4} | escape^([\"\\/bfnrtu]|0..0x1f))* double_quote) @parse_complex_string
1069
+ )
1070
+ );
1071
+ }%%
1072
+
1073
+ static int
1074
+ match_i(VALUE regexp, VALUE klass, VALUE memo)
1075
+ {
1076
+ if (regexp == Qundef) return ST_STOP;
1077
+ if (RTEST(rb_funcall(klass, i_json_creatable_p, 0)) &&
1078
+ RTEST(rb_funcall(regexp, i_match, 1, rb_ary_entry(memo, 0)))) {
1079
+ rb_ary_push(memo, klass);
1080
+ return ST_STOP;
1081
+ }
1082
+ return ST_CONTINUE;
1083
+ }
1084
+
1085
+ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *result)
1086
+ {
1087
+ int cs = EVIL;
1088
+ VALUE match_string;
1089
+
1090
+ %% write init;
1091
+ json->memo = p;
1092
+ %% write exec;
1093
+
1094
+ if (json->create_additions && RTEST(match_string = json->match_string)) {
1095
+ VALUE klass;
1096
+ VALUE memo = rb_ary_new2(2);
1097
+ rb_ary_push(memo, *result);
1098
+ rb_hash_foreach(match_string, match_i, memo);
1099
+ klass = rb_ary_entry(memo, 1);
1100
+ if (RTEST(klass)) {
1101
+ *result = rb_funcall(klass, i_json_create, 1, *result);
1102
+ }
1103
+ }
1104
+
1105
+ if (cs >= JSON_string_first_final) {
1106
+ return p + 1;
1107
+ } else {
1108
+ return NULL;
1109
+ }
1110
+ }
1111
+
1112
+ /*
1113
+ * Document-class: JSON::Ext::Parser
1114
+ *
1115
+ * This is the JSON parser implemented as a C extension. It can be configured
1116
+ * to be used by setting
1117
+ *
1118
+ * JSON.parser = JSON::Ext::Parser
1119
+ *
1120
+ * with the method parser= in JSON.
1121
+ *
1122
+ */
1123
+
1124
+ static VALUE convert_encoding(VALUE source)
1125
+ {
1126
+ int encindex = RB_ENCODING_GET(source);
1127
+
1128
+ if (RB_LIKELY(encindex == utf8_encindex)) {
1129
+ return source;
1130
+ }
1131
+
1132
+ if (encindex == binary_encindex) {
1133
+ // For historical reason, we silently reinterpret binary strings as UTF-8
1134
+ return rb_enc_associate_index(rb_str_dup(source), utf8_encindex);
1135
+ }
1136
+
1137
+ return rb_funcall(source, i_encode, 1, Encoding_UTF_8);
1138
+ }
1139
+
1140
+ static int configure_parser_i(VALUE key, VALUE val, VALUE data)
1141
+ {
1142
+ JSON_Parser *json = (JSON_Parser *)data;
1143
+
1144
+ if (key == sym_max_nesting) { json->max_nesting = RTEST(val) ? FIX2INT(val) : 0; }
1145
+ else if (key == sym_allow_nan) { json->allow_nan = RTEST(val); }
1146
+ else if (key == sym_allow_trailing_comma) { json->allow_trailing_comma = RTEST(val); }
1147
+ else if (key == sym_symbolize_names) { json->symbolize_names = RTEST(val); }
1148
+ else if (key == sym_freeze) { json->freeze = RTEST(val); }
1149
+ else if (key == sym_create_id) { json->create_id = RTEST(val) ? val : Qfalse; }
1150
+ else if (key == sym_object_class) { json->object_class = RTEST(val) ? val : Qfalse; }
1151
+ else if (key == sym_array_class) { json->array_class = RTEST(val) ? val : Qfalse; }
1152
+ else if (key == sym_decimal_class) { json->decimal_class = RTEST(val) ? val : Qfalse; }
1153
+ else if (key == sym_match_string) { json->match_string = RTEST(val) ? val : Qfalse; }
1154
+ else if (key == sym_create_additions) {
1155
+ if (NIL_P(val)) {
1156
+ json->create_additions = true;
1157
+ json->deprecated_create_additions = true;
1158
+ } else {
1159
+ json->create_additions = RTEST(val);
1160
+ json->deprecated_create_additions = false;
1161
+ }
1162
+ }
1163
+
1164
+ return ST_CONTINUE;
1165
+ }
1166
+
1167
+ static void parser_init(JSON_Parser *json, VALUE source, VALUE opts)
1168
+ {
1169
+ if (json->Vsource) {
1170
+ rb_raise(rb_eTypeError, "already initialized instance");
1171
+ }
1172
+
1173
+ json->fbuffer.initial_length = FBUFFER_INITIAL_LENGTH_DEFAULT;
1174
+ json->max_nesting = 100;
1175
+
1176
+ if (!NIL_P(opts)) {
1177
+ Check_Type(opts, T_HASH);
1178
+ if (RHASH_SIZE(opts) > 0) {
1179
+ // We assume in most cases few keys are set so it's faster to go over
1180
+ // the provided keys than to check all possible keys.
1181
+ rb_hash_foreach(opts, configure_parser_i, (VALUE)json);
1182
+
1183
+ if (json->symbolize_names && json->create_additions) {
1184
+ rb_raise(rb_eArgError,
1185
+ "options :symbolize_names and :create_additions cannot be "
1186
+ " used in conjunction");
1187
+ }
1188
+
1189
+ if (json->create_additions && !json->create_id) {
1190
+ json->create_id = rb_funcall(mJSON, i_create_id, 0);
1191
+ }
1192
+ }
1193
+
1194
+ }
1195
+ source = convert_encoding(StringValue(source));
1196
+ StringValue(source);
1197
+ json->len = RSTRING_LEN(source);
1198
+ json->source = RSTRING_PTR(source);
1199
+ json->Vsource = source;
1200
+ }
1201
+
1202
+ /*
1203
+ * call-seq: new(source, opts => {})
1204
+ *
1205
+ * Creates a new JSON::Ext::Parser instance for the string _source_.
1206
+ *
1207
+ * It will be configured by the _opts_ hash. _opts_ can have the following
1208
+ * keys:
1209
+ *
1210
+ * _opts_ can have the following keys:
1211
+ * * *max_nesting*: The maximum depth of nesting allowed in the parsed data
1212
+ * structures. Disable depth checking with :max_nesting => false|nil|0, it
1213
+ * defaults to 100.
1214
+ * * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
1215
+ * defiance of RFC 4627 to be parsed by the Parser. This option defaults to
1216
+ * false.
1217
+ * * *symbolize_names*: If set to true, returns symbols for the names
1218
+ * (keys) in a JSON object. Otherwise strings are returned, which is
1219
+ * also the default. It's not possible to use this option in
1220
+ * conjunction with the *create_additions* option.
1221
+ * * *create_additions*: If set to false, the Parser doesn't create
1222
+ * additions even if a matching class and create_id was found. This option
1223
+ * defaults to false.
1224
+ * * *object_class*: Defaults to Hash. If another type is provided, it will be used
1225
+ * instead of Hash to represent JSON objects. The type must respond to
1226
+ * +new+ without arguments, and return an object that respond to +[]=+.
1227
+ * * *array_class*: Defaults to Array If another type is provided, it will be used
1228
+ * instead of Hash to represent JSON arrays. The type must respond to
1229
+ * +new+ without arguments, and return an object that respond to +<<+.
1230
+ * * *decimal_class*: Specifies which class to use instead of the default
1231
+ * (Float) when parsing decimal numbers. This class must accept a single
1232
+ * string argument in its constructor.
1233
+ */
1234
+ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
1235
+ {
1236
+ GET_PARSER_INIT;
1237
+
1238
+ rb_check_arity(argc, 1, 2);
1239
+
1240
+ parser_init(json, argv[0], argc == 2 ? argv[1] : Qnil);
1241
+ return self;
1242
+ }
1243
+
1244
+ %%{
1245
+ machine JSON;
1246
+
1247
+ write data;
1248
+
1249
+ include JSON_common;
1250
+
1251
+ action parse_value {
1252
+ char *np = JSON_parse_value(json, fpc, pe, &result, 0);
1253
+ if (np == NULL) { fhold; fbreak; } else fexec np;
1254
+ }
1255
+
1256
+ main := ignore* (
1257
+ begin_value >parse_value
1258
+ ) ignore*;
1259
+ }%%
1260
+
1261
+ /*
1262
+ * call-seq: parse()
1263
+ *
1264
+ * Parses the current JSON text _source_ and returns the complete data
1265
+ * structure as a result.
1266
+ * It raises JSON::ParserError if fail to parse.
1267
+ */
1268
+ static VALUE cParser_parse(VALUE self)
1269
+ {
1270
+ char *p, *pe;
1271
+ int cs = EVIL;
1272
+ VALUE result = Qnil;
1273
+ GET_PARSER;
1274
+
1275
+ char stack_buffer[FBUFFER_STACK_SIZE];
1276
+ fbuffer_stack_init(&json->fbuffer, FBUFFER_INITIAL_LENGTH_DEFAULT, stack_buffer, FBUFFER_STACK_SIZE);
1277
+
1278
+ VALUE rvalue_stack_buffer[RVALUE_STACK_INITIAL_CAPA];
1279
+ rvalue_stack stack = {
1280
+ .type = RVALUE_STACK_STACK_ALLOCATED,
1281
+ .ptr = rvalue_stack_buffer,
1282
+ .capa = RVALUE_STACK_INITIAL_CAPA,
1283
+ };
1284
+ json->stack = &stack;
1285
+
1286
+ %% write init;
1287
+ p = json->source;
1288
+ pe = p + json->len;
1289
+ %% write exec;
1290
+
1291
+ if (json->stack_handle) {
1292
+ rvalue_stack_eagerly_release(json->stack_handle);
1293
+ }
1294
+
1295
+ if (cs >= JSON_first_final && p == pe) {
1296
+ return result;
1297
+ } else {
1298
+ raise_parse_error("unexpected token at '%s'", p);
1299
+ return Qnil;
1300
+ }
1301
+ }
1302
+
1303
+ static VALUE cParser_m_parse(VALUE klass, VALUE source, VALUE opts)
1304
+ {
1305
+ char *p, *pe;
1306
+ int cs = EVIL;
1307
+ VALUE result = Qnil;
1308
+
1309
+ JSON_Parser _parser = {0};
1310
+ JSON_Parser *json = &_parser;
1311
+ parser_init(json, source, opts);
1312
+
1313
+ char stack_buffer[FBUFFER_STACK_SIZE];
1314
+ fbuffer_stack_init(&json->fbuffer, FBUFFER_INITIAL_LENGTH_DEFAULT, stack_buffer, FBUFFER_STACK_SIZE);
1315
+
1316
+ VALUE rvalue_stack_buffer[RVALUE_STACK_INITIAL_CAPA];
1317
+ rvalue_stack stack = {
1318
+ .type = RVALUE_STACK_STACK_ALLOCATED,
1319
+ .ptr = rvalue_stack_buffer,
1320
+ .capa = RVALUE_STACK_INITIAL_CAPA,
1321
+ };
1322
+ json->stack = &stack;
1323
+
1324
+ %% write init;
1325
+ p = json->source;
1326
+ pe = p + json->len;
1327
+ %% write exec;
1328
+
1329
+ if (json->stack_handle) {
1330
+ rvalue_stack_eagerly_release(json->stack_handle);
1331
+ }
1332
+
1333
+ if (cs >= JSON_first_final && p == pe) {
1334
+ return result;
1335
+ } else {
1336
+ raise_parse_error("unexpected token at '%s'", p);
1337
+ return Qnil;
1338
+ }
1339
+ }
1340
+
1341
+ static void JSON_mark(void *ptr)
1342
+ {
1343
+ JSON_Parser *json = ptr;
1344
+ rb_gc_mark(json->Vsource);
1345
+ rb_gc_mark(json->create_id);
1346
+ rb_gc_mark(json->object_class);
1347
+ rb_gc_mark(json->array_class);
1348
+ rb_gc_mark(json->decimal_class);
1349
+ rb_gc_mark(json->match_string);
1350
+ rb_gc_mark(json->stack_handle);
1351
+
1352
+ const VALUE *name_cache_entries = &json->name_cache.entries[0];
1353
+ rb_gc_mark_locations(name_cache_entries, name_cache_entries + json->name_cache.length);
1354
+ }
1355
+
1356
+ static void JSON_free(void *ptr)
1357
+ {
1358
+ JSON_Parser *json = ptr;
1359
+ fbuffer_free(&json->fbuffer);
1360
+ ruby_xfree(json);
1361
+ }
1362
+
1363
+ static size_t JSON_memsize(const void *ptr)
1364
+ {
1365
+ const JSON_Parser *json = ptr;
1366
+ return sizeof(*json) + FBUFFER_CAPA(&json->fbuffer);
1367
+ }
1368
+
1369
+ static const rb_data_type_t JSON_Parser_type = {
1370
+ "JSON/Parser",
1371
+ {JSON_mark, JSON_free, JSON_memsize,},
1372
+ 0, 0,
1373
+ RUBY_TYPED_FREE_IMMEDIATELY,
1374
+ };
1375
+
1376
+ static VALUE cJSON_parser_s_allocate(VALUE klass)
1377
+ {
1378
+ JSON_Parser *json;
1379
+ VALUE obj = TypedData_Make_Struct(klass, JSON_Parser, &JSON_Parser_type, json);
1380
+ fbuffer_stack_init(&json->fbuffer, 0, NULL, 0);
1381
+ return obj;
1382
+ }
1383
+
1384
+ /*
1385
+ * call-seq: source()
1386
+ *
1387
+ * Returns a copy of the current _source_ string, that was used to construct
1388
+ * this Parser.
1389
+ */
1390
+ static VALUE cParser_source(VALUE self)
1391
+ {
1392
+ GET_PARSER;
1393
+ return rb_str_dup(json->Vsource);
1394
+ }
1395
+
1396
+ void Init_parser(void)
1397
+ {
1398
+ #ifdef HAVE_RB_EXT_RACTOR_SAFE
1399
+ rb_ext_ractor_safe(true);
1400
+ #endif
1401
+
1402
+ #undef rb_intern
1403
+ rb_require("json/common");
1404
+ mJSON = rb_define_module("JSON");
1405
+ mExt = rb_define_module_under(mJSON, "Ext");
1406
+ cParser = rb_define_class_under(mExt, "Parser", rb_cObject);
1407
+ eNestingError = rb_path2class("JSON::NestingError");
1408
+ rb_gc_register_mark_object(eNestingError);
1409
+ rb_define_alloc_func(cParser, cJSON_parser_s_allocate);
1410
+ rb_define_method(cParser, "initialize", cParser_initialize, -1);
1411
+ rb_define_method(cParser, "parse", cParser_parse, 0);
1412
+ rb_define_method(cParser, "source", cParser_source, 0);
1413
+
1414
+ rb_define_singleton_method(cParser, "parse", cParser_m_parse, 2);
1415
+
1416
+ CNaN = rb_const_get(mJSON, rb_intern("NaN"));
1417
+ rb_gc_register_mark_object(CNaN);
1418
+
1419
+ CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
1420
+ rb_gc_register_mark_object(CInfinity);
1421
+
1422
+ CMinusInfinity = rb_const_get(mJSON, rb_intern("MinusInfinity"));
1423
+ rb_gc_register_mark_object(CMinusInfinity);
1424
+
1425
+ rb_global_variable(&Encoding_UTF_8);
1426
+ Encoding_UTF_8 = rb_const_get(rb_path2class("Encoding"), rb_intern("UTF_8"));
1427
+
1428
+ sym_max_nesting = ID2SYM(rb_intern("max_nesting"));
1429
+ sym_allow_nan = ID2SYM(rb_intern("allow_nan"));
1430
+ sym_allow_trailing_comma = ID2SYM(rb_intern("allow_trailing_comma"));
1431
+ sym_symbolize_names = ID2SYM(rb_intern("symbolize_names"));
1432
+ sym_freeze = ID2SYM(rb_intern("freeze"));
1433
+ sym_create_additions = ID2SYM(rb_intern("create_additions"));
1434
+ sym_create_id = ID2SYM(rb_intern("create_id"));
1435
+ sym_object_class = ID2SYM(rb_intern("object_class"));
1436
+ sym_array_class = ID2SYM(rb_intern("array_class"));
1437
+ sym_decimal_class = ID2SYM(rb_intern("decimal_class"));
1438
+ sym_match_string = ID2SYM(rb_intern("match_string"));
1439
+
1440
+ i_create_id = rb_intern("create_id");
1441
+ i_json_creatable_p = rb_intern("json_creatable?");
1442
+ i_json_create = rb_intern("json_create");
1443
+ i_chr = rb_intern("chr");
1444
+ i_match = rb_intern("match");
1445
+ i_deep_const_get = rb_intern("deep_const_get");
1446
+ i_aset = rb_intern("[]=");
1447
+ i_aref = rb_intern("[]");
1448
+ i_leftshift = rb_intern("<<");
1449
+ i_new = rb_intern("new");
1450
+ i_try_convert = rb_intern("try_convert");
1451
+ i_uminus = rb_intern("-@");
1452
+ i_encode = rb_intern("encode");
1453
+
1454
+ binary_encindex = rb_ascii8bit_encindex();
1455
+ utf8_encindex = rb_utf8_encindex();
1456
+ enc_utf8 = rb_utf8_encoding();
1457
+ }
1458
+
1459
+ /*
1460
+ * Local variables:
1461
+ * mode: c
1462
+ * c-file-style: ruby
1463
+ * indent-tabs-mode: nil
1464
+ * End:
1465
+ */