cybrid_api_id_ruby 0.124.84 → 0.124.86

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 (253) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/README.md +5 -5
  4. data/cybrid_api_id_ruby.gemspec +1 -1
  5. data/lib/cybrid_api_id_ruby/api/bank_applications_idp_api.rb +1 -1
  6. data/lib/cybrid_api_id_ruby/api/customer_tokens_idp_api.rb +1 -1
  7. data/lib/cybrid_api_id_ruby/api/organization_applications_idp_api.rb +1 -1
  8. data/lib/cybrid_api_id_ruby/api/users_idp_api.rb +1 -1
  9. data/lib/cybrid_api_id_ruby/api_client.rb +1 -1
  10. data/lib/cybrid_api_id_ruby/api_error.rb +1 -1
  11. data/lib/cybrid_api_id_ruby/configuration.rb +1 -1
  12. data/lib/cybrid_api_id_ruby/models/application_idp_model.rb +1 -1
  13. data/lib/cybrid_api_id_ruby/models/application_list_idp_model.rb +1 -1
  14. data/lib/cybrid_api_id_ruby/models/application_with_secret_all_of_idp_model.rb +1 -1
  15. data/lib/cybrid_api_id_ruby/models/application_with_secret_idp_model.rb +1 -1
  16. data/lib/cybrid_api_id_ruby/models/customer_token_idp_model.rb +1 -1
  17. data/lib/cybrid_api_id_ruby/models/error_response_idp_model.rb +1 -1
  18. data/lib/cybrid_api_id_ruby/models/patch_user_idp_model.rb +1 -1
  19. data/lib/cybrid_api_id_ruby/models/post_bank_application_idp_model.rb +1 -1
  20. data/lib/cybrid_api_id_ruby/models/post_customer_token_idp_model.rb +1 -1
  21. data/lib/cybrid_api_id_ruby/models/post_organization_application_idp_model.rb +1 -1
  22. data/lib/cybrid_api_id_ruby/models/post_user_idp_model.rb +1 -1
  23. data/lib/cybrid_api_id_ruby/models/user_idp_model.rb +1 -1
  24. data/lib/cybrid_api_id_ruby/models/user_list_idp_model.rb +1 -1
  25. data/lib/cybrid_api_id_ruby/version.rb +2 -2
  26. data/lib/cybrid_api_id_ruby.rb +1 -1
  27. data/spec/api/bank_applications_idp_api_spec.rb +1 -1
  28. data/spec/api/customer_tokens_idp_api_spec.rb +1 -1
  29. data/spec/api/organization_applications_idp_api_spec.rb +1 -1
  30. data/spec/api/users_idp_api_spec.rb +1 -1
  31. data/spec/api_client_spec.rb +1 -1
  32. data/spec/configuration_spec.rb +1 -1
  33. data/spec/models/application_idp_model_spec.rb +1 -1
  34. data/spec/models/application_list_idp_model_spec.rb +1 -1
  35. data/spec/models/application_with_secret_all_of_idp_model_spec.rb +1 -1
  36. data/spec/models/application_with_secret_idp_model_spec.rb +1 -1
  37. data/spec/models/customer_token_idp_model_spec.rb +1 -1
  38. data/spec/models/error_response_idp_model_spec.rb +1 -1
  39. data/spec/models/patch_user_idp_model_spec.rb +1 -1
  40. data/spec/models/post_bank_application_idp_model_spec.rb +1 -1
  41. data/spec/models/post_customer_token_idp_model_spec.rb +1 -1
  42. data/spec/models/post_organization_application_idp_model_spec.rb +1 -1
  43. data/spec/models/post_user_idp_model_spec.rb +1 -1
  44. data/spec/models/user_idp_model_spec.rb +1 -1
  45. data/spec/models/user_list_idp_model_spec.rb +1 -1
  46. data/spec/spec_helper.rb +1 -1
  47. data/vendor/bundle/ruby/3.3.0/cache/ethon-0.15.0.gem +0 -0
  48. data/vendor/bundle/ruby/3.3.0/cache/typhoeus-1.5.0.gem +0 -0
  49. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/byebug-12.0.0/gem_make.out +5 -5
  50. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.4.1/gem_make.out +5 -5
  51. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  52. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.2.6/gem_make.out +5 -5
  53. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/racc-1.8.1/gem_make.out +5 -5
  54. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.1.7/gem_make.out +5 -5
  55. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/.github/workflows/ruby.yml +41 -0
  56. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → ethon-0.15.0}/.gitignore +4 -4
  57. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → ethon-0.15.0}/.rspec +0 -1
  58. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/CHANGELOG.md +1 -29
  59. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/Gemfile +43 -0
  60. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → ethon-0.15.0}/Guardfile +3 -2
  61. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/README.md +0 -23
  62. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → ethon-0.15.0}/Rakefile +7 -5
  63. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/ethon.gemspec +3 -6
  64. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curls/classes.rb +2 -12
  65. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curls/codes.rb +2 -3
  66. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curls/options.rb +3 -4
  67. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/callbacks.rb +1 -2
  68. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/informations.rb +0 -3
  69. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/response_callbacks.rb +1 -6
  70. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/version.rb +1 -1
  71. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/benchmarks.rb +104 -0
  72. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/memory_leaks.rb +114 -0
  73. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/perf_spec_helper.rb +37 -0
  74. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/support/memory_test_helpers.rb +76 -0
  75. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/support/os_memory_leak_tracker.rb +48 -0
  76. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/support/ruby_object_leak_tracker.rb +49 -0
  77. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb +38 -0
  78. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/callbacks_spec.rb +59 -0
  79. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/debug_info_spec.rb +54 -0
  80. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/features_spec.rb +24 -0
  81. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/form_spec.rb +104 -0
  82. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/header_spec.rb +79 -0
  83. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/custom_spec.rb +177 -0
  84. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/delete_spec.rb +21 -0
  85. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/get_spec.rb +126 -0
  86. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/head_spec.rb +80 -0
  87. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/options_spec.rb +51 -0
  88. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/patch_spec.rb +51 -0
  89. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/post_spec.rb +317 -0
  90. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/put_spec.rb +168 -0
  91. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http_spec.rb +64 -0
  92. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/informations_spec.rb +120 -0
  93. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/mirror_spec.rb +47 -0
  94. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/operations_spec.rb +268 -0
  95. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/options_spec.rb +193 -0
  96. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/queryable_spec.rb +235 -0
  97. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/response_callbacks_spec.rb +152 -0
  98. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/util_spec.rb +28 -0
  99. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy_spec.rb +203 -0
  100. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/libc_spec.rb +14 -0
  101. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/loggable_spec.rb +22 -0
  102. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/multi/operations_spec.rb +298 -0
  103. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/multi/options_spec.rb +182 -0
  104. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/multi/stack_spec.rb +80 -0
  105. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/multi_spec.rb +152 -0
  106. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/spec_helper.rb +28 -0
  107. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → ethon-0.15.0}/spec/support/localhost_server.rb +2 -1
  108. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → ethon-0.15.0}/spec/support/server.rb +10 -11
  109. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/CHANGELOG.md +43 -1
  110. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/expectation.rb +4 -2
  111. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/responseable.rb +1 -1
  112. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/version.rb +1 -1
  113. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/typhoeus.gemspec +14 -4
  114. data/vendor/bundle/ruby/3.3.0/specifications/{ethon-0.17.0.gemspec → ethon-0.15.0.gemspec} +5 -6
  115. data/vendor/bundle/ruby/3.3.0/specifications/typhoeus-1.5.0.gemspec +26 -0
  116. metadata +156 -160
  117. data/vendor/bundle/ruby/3.3.0/cache/ethon-0.17.0.gem +0 -0
  118. data/vendor/bundle/ruby/3.3.0/cache/typhoeus-1.4.1.gem +0 -0
  119. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.github/workflows/ci.yml +0 -30
  120. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/.github/workflows/experimental.yml +0 -33
  121. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/Gemfile +0 -36
  122. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/perf/profile.rb +0 -14
  123. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/perf/vs_nethttp.rb +0 -64
  124. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/rack/typhoeus/middleware/params_decoder/helper_spec.rb +0 -156
  125. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/rack/typhoeus/middleware/params_decoder_spec.rb +0 -31
  126. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/spec_helper.rb +0 -29
  127. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/support/memory_cache.rb +0 -15
  128. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/adapters/faraday_spec.rb +0 -339
  129. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/cache/dalli_spec.rb +0 -41
  130. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/cache/redis_spec.rb +0 -41
  131. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/config_spec.rb +0 -15
  132. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/easy_factory_spec.rb +0 -143
  133. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/errors/no_stub_spec.rb +0 -13
  134. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/expectation_spec.rb +0 -280
  135. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/addable_spec.rb +0 -22
  136. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/before_spec.rb +0 -98
  137. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/block_connection_spec.rb +0 -18
  138. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/cacheable_spec.rb +0 -88
  139. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/memoizable_spec.rb +0 -53
  140. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/queueable_spec.rb +0 -98
  141. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/runnable_spec.rb +0 -137
  142. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra/stubbable_spec.rb +0 -48
  143. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/hydra_spec.rb +0 -22
  144. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/pool_spec.rb +0 -137
  145. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/actions_spec.rb +0 -19
  146. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/before_spec.rb +0 -93
  147. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/block_connection_spec.rb +0 -75
  148. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/cacheable_spec.rb +0 -94
  149. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/callbacks_spec.rb +0 -91
  150. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/marshal_spec.rb +0 -60
  151. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/memoizable_spec.rb +0 -34
  152. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/operations_spec.rb +0 -101
  153. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/responseable_spec.rb +0 -13
  154. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request/stubbable_spec.rb +0 -45
  155. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/request_spec.rb +0 -256
  156. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/header_spec.rb +0 -147
  157. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/informations_spec.rb +0 -323
  158. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response/status_spec.rb +0 -256
  159. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus/response_spec.rb +0 -100
  160. data/vendor/bundle/ruby/3.3.0/gems/typhoeus-1.4.1/spec/typhoeus_spec.rb +0 -105
  161. data/vendor/bundle/ruby/3.3.0/specifications/typhoeus-1.4.1.gemspec +0 -24
  162. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/LICENSE +0 -0
  163. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curl.rb +0 -0
  164. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curls/constants.rb +0 -0
  165. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curls/form_options.rb +0 -0
  166. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curls/functions.rb +0 -0
  167. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curls/infos.rb +0 -0
  168. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curls/messages.rb +0 -0
  169. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/curls/settings.rb +0 -0
  170. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/debug_info.rb +0 -0
  171. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/features.rb +0 -0
  172. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/form.rb +0 -0
  173. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/header.rb +0 -0
  174. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/actionable.rb +0 -0
  175. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/custom.rb +0 -0
  176. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/delete.rb +0 -0
  177. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/get.rb +0 -0
  178. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/head.rb +0 -0
  179. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/options.rb +0 -0
  180. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/patch.rb +0 -0
  181. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/post.rb +0 -0
  182. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/postable.rb +0 -0
  183. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/put.rb +0 -0
  184. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http/putable.rb +0 -0
  185. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/http.rb +0 -0
  186. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/mirror.rb +0 -0
  187. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/operations.rb +0 -0
  188. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/options.rb +0 -0
  189. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/params.rb +0 -0
  190. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/queryable.rb +0 -0
  191. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy/util.rb +0 -0
  192. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/easy.rb +0 -0
  193. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors/ethon_error.rb +0 -0
  194. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors/global_init.rb +0 -0
  195. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors/invalid_option.rb +0 -0
  196. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors/invalid_value.rb +0 -0
  197. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors/multi_add.rb +0 -0
  198. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors/multi_fdset.rb +0 -0
  199. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors/multi_remove.rb +0 -0
  200. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors/multi_timeout.rb +0 -0
  201. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors/select.rb +0 -0
  202. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/errors.rb +0 -0
  203. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/libc.rb +0 -0
  204. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/loggable.rb +0 -0
  205. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/multi/operations.rb +0 -0
  206. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/multi/options.rb +0 -0
  207. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/multi/stack.rb +0 -0
  208. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon/multi.rb +0 -0
  209. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.17.0 → ethon-0.15.0}/lib/ethon.rb +0 -0
  210. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/CONTRIBUTING.md +0 -0
  211. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/LICENSE +0 -0
  212. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/README.md +0 -0
  213. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/UPGRADE.md +0 -0
  214. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/rack/typhoeus/middleware/params_decoder/helper.rb +0 -0
  215. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/rack/typhoeus/middleware/params_decoder.rb +0 -0
  216. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/rack/typhoeus.rb +0 -0
  217. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/adapters/faraday.rb +0 -0
  218. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/cache/dalli.rb +0 -0
  219. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/cache/rails.rb +0 -0
  220. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/cache/redis.rb +0 -0
  221. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/config.rb +0 -0
  222. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/easy_factory.rb +0 -0
  223. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/errors/no_stub.rb +0 -0
  224. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/errors/typhoeus_error.rb +0 -0
  225. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/errors.rb +0 -0
  226. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/addable.rb +0 -0
  227. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/before.rb +0 -0
  228. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/block_connection.rb +0 -0
  229. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/cacheable.rb +0 -0
  230. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/memoizable.rb +0 -0
  231. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/queueable.rb +0 -0
  232. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/runnable.rb +0 -0
  233. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra/stubbable.rb +0 -0
  234. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/hydra.rb +0 -0
  235. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/pool.rb +0 -0
  236. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/railtie.rb +0 -0
  237. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/actions.rb +0 -0
  238. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/before.rb +0 -0
  239. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/block_connection.rb +0 -0
  240. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/cacheable.rb +0 -0
  241. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/callbacks.rb +0 -0
  242. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/marshal.rb +0 -0
  243. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/memoizable.rb +0 -0
  244. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/operations.rb +0 -0
  245. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/streamable.rb +0 -0
  246. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request/stubbable.rb +0 -0
  247. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/request.rb +0 -0
  248. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response/cacheable.rb +0 -0
  249. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response/header.rb +0 -0
  250. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response/informations.rb +0 -0
  251. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response/status.rb +0 -0
  252. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus/response.rb +0 -0
  253. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.4.1 → typhoeus-1.5.0}/lib/typhoeus.rb +0 -0
@@ -0,0 +1,104 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+ require 'ethon'
4
+ require 'open-uri'
5
+ require 'patron'
6
+ require 'curb'
7
+ require 'net/http'
8
+ require 'cgi'
9
+ require 'benchmark/ips'
10
+
11
+ require_relative '../spec/support/server'
12
+ require_relative '../spec/support/localhost_server'
13
+
14
+ LocalhostServer.new(TESTSERVER.new, 3000)
15
+ LocalhostServer.new(TESTSERVER.new, 3001)
16
+ LocalhostServer.new(TESTSERVER.new, 3002)
17
+
18
+ url = 'http://localhost:3000/'.freeze
19
+ uri = URI.parse('http://localhost:3000/').freeze
20
+ ethon = Ethon::Easy.new(url: url)
21
+ patron = Patron::Session.new
22
+ patron_url = Patron::Session.new(base_url: url)
23
+ curb = Curl::Easy.new(url)
24
+
25
+ puts '[Creation]'
26
+ Benchmark.ips do |x|
27
+ x.report('String.new') { '' }
28
+ x.report('Easy.new') { Ethon::Easy.new }
29
+ end
30
+
31
+ puts '[Escape]'
32
+ Benchmark.ips do |x|
33
+ x.report('CGI.escape') { CGI.escape("まつもと") }
34
+ x.report('Easy.escape') { ethon.escape("まつもと") }
35
+ end
36
+
37
+ puts '[Requests]'
38
+ Benchmark.ips do |x|
39
+ x.report('net/http') { Net::HTTP.get_response(uri) }
40
+ x.report('open-uri') { open url }
41
+
42
+ x.report('patron') do
43
+ patron.base_url = url
44
+ patron.get('/')
45
+ end
46
+
47
+ x.report('patron reuse') { patron_url.get('/') }
48
+
49
+ x.report('curb') do
50
+ curb.url = url
51
+ curb.perform
52
+ end
53
+
54
+ x.report('curb reuse') { curb.perform }
55
+
56
+ x.report('Easy.perform') do
57
+ ethon.url = url
58
+ ethon.perform
59
+ end
60
+
61
+ x.report('Easy.perform reuse') { ethon.perform }
62
+ end
63
+
64
+ puts "[ 4 delayed Requests ]"
65
+ Benchmark.ips do |x|
66
+ x.report('net/http') do
67
+ 3.times do |i|
68
+ uri = URI.parse("http://localhost:300#{i}/?delay=1")
69
+ Net::HTTP.get_response(uri)
70
+ end
71
+ end
72
+
73
+ x.report("open-uri") do
74
+ 3.times do |i|
75
+ open("http://localhost:300#{i}/?delay=1")
76
+ end
77
+ end
78
+
79
+ x.report("patron") do
80
+ sess = Patron::Session.new
81
+ 3.times do |i|
82
+ sess.base_url = "http://localhost:300#{i}/?delay=1"
83
+ sess.get("/")
84
+ end
85
+ end
86
+
87
+ x.report("Easy.perform") do
88
+ easy = Ethon::Easy.new
89
+ 3.times do |i|
90
+ easy.url = "http://localhost:300#{i}/?delay=1"
91
+ easy.perform
92
+ end
93
+ end
94
+
95
+ x.report("Multi.perform") do
96
+ multi = Ethon::Multi.new
97
+ 3.times do |i|
98
+ easy = Ethon::Easy.new
99
+ easy.url = "http://localhost:300#{i}/?delay=1"
100
+ multi.add(easy)
101
+ end
102
+ multi.perform
103
+ end
104
+ end
@@ -0,0 +1,114 @@
1
+ # frozen_string_literal: true
2
+ require 'ethon'
3
+ require 'ethon/easy'
4
+
5
+ require_relative 'perf_spec_helper'
6
+ require 'rspec/autorun'
7
+
8
+ describe "low-level interactions with libcurl" do
9
+ describe Ethon::Multi do
10
+ memory_leak_test("init") do
11
+ Ethon::Multi.new
12
+ end
13
+
14
+ memory_leak_test("handle") do
15
+ Ethon::Multi.new.handle
16
+ end
17
+ end
18
+
19
+ describe Ethon::Easy do
20
+ memory_leak_test("init") do
21
+ Ethon::Easy.new
22
+ end
23
+
24
+ memory_leak_test("handle") do
25
+ Ethon::Easy.new.handle
26
+ end
27
+
28
+ memory_leak_test("headers") do
29
+ Ethon::Easy.new.headers = { "a" => 1, "b" => 2, "c" => 3, "d" => 4}
30
+ end
31
+
32
+ memory_leak_test("escape") do
33
+ Ethon::Easy.new.escape("the_sky&is_blue")
34
+ end
35
+ end
36
+
37
+
38
+ describe Ethon::Easy::Form do
39
+ memory_leak_test("init") do
40
+ Ethon::Easy::Form.new(nil, {})
41
+ end
42
+
43
+ memory_leak_test("first") do
44
+ Ethon::Easy::Form.new(nil, {}).first
45
+ end
46
+
47
+ memory_leak_test("last") do
48
+ Ethon::Easy::Form.new(nil, {}).last
49
+ end
50
+
51
+ memory_leak_test("materialized with some params") do
52
+ form = Ethon::Easy::Form.new(nil, { "a" => "1" })
53
+ form.materialize
54
+ end
55
+
56
+ memory_leak_test("materialized with a file") do
57
+ File.open(__FILE__, "r") do |file|
58
+ form = Ethon::Easy::Form.new(nil, { "a" => file })
59
+ form.materialize
60
+ end
61
+ end
62
+ end
63
+ end
64
+
65
+ describe "higher level operations" do
66
+ memory_leak_test("a simple request") do
67
+ Ethon::Easy.new(:url => "http://localhost:3001/",
68
+ :forbid_reuse => true).perform
69
+ end
70
+
71
+ memory_leak_test("a request with headers") do
72
+ Ethon::Easy.new(:url => "http://localhost:3001/",
73
+ :headers => { "Content-Type" => "application/json",
74
+ "Something" => "1",
75
+ "Else" => "qwerty",
76
+ "Long-String" => "aassddffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz"},
77
+ :forbid_reuse => true).perform
78
+ end
79
+
80
+ memory_leak_test("a request with headers and params") do
81
+ easy = Ethon::Easy.new(:url => "http://localhost:3001/",
82
+ :headers => { "Content-Type" => "application/json",
83
+ "Something" => "1",
84
+ "Else" => "qwerty",
85
+ "Long-String" => "aassddffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz"},
86
+ :forbid_reuse => true)
87
+ easy.http_request("http://localhost:3001/",
88
+ :get,
89
+ :params => { "param1" => "value1",
90
+ "param2" => "value2",
91
+ "param3" => "value3",
92
+ "param4" => "value4"})
93
+ end
94
+
95
+ memory_leak_test("a request with headers, params, and body") do
96
+ easy = Ethon::Easy.new(:url => "http://localhost:3001/",
97
+ :headers => { "Content-Type" => "application/json",
98
+ "Something" => "1",
99
+ "Else" => "qwerty",
100
+ "Long-String" => "aassddffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz"},
101
+ :forbid_reuse => true)
102
+ easy.http_request("http://localhost:3001/",
103
+ :get,
104
+ :params => { "param1" => "value1",
105
+ "param2" => "value2",
106
+ "param3" => "value3",
107
+ "param4" => "value4"},
108
+ :body => {
109
+ "body1" => "value1",
110
+ "body2" => "value2",
111
+ "body3" => "value3"
112
+ })
113
+ end
114
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ #### SETUP
3
+ require 'bundler'
4
+ Bundler.setup
5
+ require 'rspec'
6
+
7
+ require 'support/localhost_server'
8
+ require 'support/server'
9
+ require_relative 'support/memory_test_helpers'
10
+
11
+ require 'logger'
12
+
13
+ if ENV['VERBOSE']
14
+ Ethon.logger = Logger.new($stdout)
15
+ Ethon.logger.level = Logger::DEBUG
16
+ end
17
+
18
+ RSpec.configure do |config|
19
+ config.before(:suite) do
20
+ LocalhostServer.new(TESTSERVER.new, 3001)
21
+ end
22
+ config.include(MemoryTestHelpers)
23
+ config.extend(MemoryTestHelpers::TestMethods)
24
+ end
25
+
26
+ MemoryTestHelpers.setup
27
+ MemoryTestHelpers.logger = Logger.new($stdout)
28
+ MemoryTestHelpers.logger.level = Logger::INFO
29
+ MemoryTestHelpers.logger.formatter = proc do |severity, datetime, progname, msg|
30
+ "\t\t#{msg}\n"
31
+ end
32
+
33
+ if ENV['VERBOSE']
34
+ MemoryTestHelpers.logger.level = Logger::DEBUG
35
+ end
36
+
37
+ MemoryTestHelpers.iterations = ENV.fetch("ITERATIONS", 10_000).to_i
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+ require_relative 'ruby_object_leak_tracker'
3
+ require_relative 'os_memory_leak_tracker'
4
+
5
+ module MemoryTestHelpers
6
+ class << self
7
+ attr_accessor :gc_proc, :iterations, :logger
8
+
9
+ def setup
10
+ if RUBY_PLATFORM == "java"
11
+ # for leak detection
12
+ JRuby.objectspace = true if defined?(JRuby)
13
+ # for gc
14
+ require 'java'
15
+ java_import 'java.lang.System'
16
+ self.gc_proc = proc { System.gc }
17
+ else
18
+ self.gc_proc = proc { GC.start }
19
+ end
20
+ end
21
+ end
22
+
23
+ module TestMethods
24
+ def memory_leak_test(description, &block)
25
+ context(description) do
26
+ it "doesn't leak ruby objects" do
27
+ object_leak_tracker = RubyObjectLeakTracker.new
28
+ track_memory_usage(object_leak_tracker, &block)
29
+ object_leak_tracker.total_difference_between_runs.should be <= 10
30
+ end
31
+
32
+ it "doesn't leak OS memory (C interop check)" do
33
+ os_memory_leak_tracker = OSMemoryLeakTracker.new
34
+ track_memory_usage(os_memory_leak_tracker, &block)
35
+ os_memory_leak_tracker.total_difference_between_runs.should be <= 10
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ def track_memory_usage(tracker)
42
+ # Intentionally do all this setup before we do any testing
43
+ logger = MemoryTestHelpers.logger
44
+ iterations = MemoryTestHelpers.iterations
45
+
46
+ checkpoint_frequency = (iterations / 10.0).to_i
47
+ gc_frequency = 20
48
+
49
+ warmup_iterations = [(iterations / 3.0).to_i, 500].min
50
+ logger.info "Performing #{warmup_iterations} warmup iterations"
51
+ warmup_iterations.times do
52
+ yield
53
+ MemoryTestHelpers.gc_proc.call
54
+ end
55
+ tracker.capture_initial_memory_usage
56
+
57
+ logger.info "Performing #{iterations} iterations (checkpoint every #{checkpoint_frequency})"
58
+
59
+ iterations.times do |i|
60
+ yield
61
+
62
+ last_iteration = (i == iterations - 1)
63
+ checkpoint = last_iteration || (i % checkpoint_frequency == 0)
64
+
65
+ if checkpoint || (i % gc_frequency == 0)
66
+ MemoryTestHelpers.gc_proc.call
67
+ end
68
+
69
+ if checkpoint
70
+ logger.info "Iteration #{i} checkpoint"
71
+ tracker.capture_memory_usage
72
+ tracker.dump_status(logger)
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+ class OSMemoryLeakTracker
3
+ attr_reader :current_run
4
+
5
+ def initialize
6
+ @previous_run = @current_run = 0
7
+ end
8
+
9
+ def difference_between_runs(basis=@previous_run)
10
+ @current_run - basis
11
+ end
12
+
13
+ def total_difference_between_runs
14
+ difference_between_runs(@initial_count_run)
15
+ end
16
+
17
+ def capture_initial_memory_usage
18
+ capture_memory_usage
19
+ @initial_count_run = @current_run
20
+ end
21
+
22
+ def capture_memory_usage
23
+ @previous_run = @current_run
24
+ @current_run = rss_bytes
25
+ end
26
+
27
+ def dump_status(logger)
28
+ delta = difference_between_runs
29
+ logger.add(log_level(delta), sprintf("\tTotal memory usage (kb): %d (%+d)", current_run, delta))
30
+ end
31
+
32
+ private
33
+ # amount of memory the current process "is using", in RAM
34
+ # (doesn't include any swap memory that it may be using, just that in actual RAM)
35
+ # Code loosely based on https://github.com/rdp/os/blob/master/lib/os.rb
36
+ # returns 0 on windows
37
+ def rss_bytes
38
+ if ENV['OS'] == 'Windows_NT'
39
+ 0
40
+ else
41
+ `ps -o rss= -p #{Process.pid}`.to_i # in kilobytes
42
+ end
43
+ end
44
+
45
+ def log_level(delta)
46
+ delta > 0 ? Logger::WARN : Logger::DEBUG
47
+ end
48
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ class RubyObjectLeakTracker
3
+ attr_reader :previous_count_hash, :current_count_hash
4
+
5
+ def initialize
6
+ @previous_count_hash = @current_count_hash = {}
7
+ end
8
+
9
+ def difference_between_runs(basis=@previous_count_hash)
10
+ @difference_between_runs ||= Hash[@current_count_hash.map do |object_class, count|
11
+ [object_class, count - (basis[object_class] || 0)]
12
+ end]
13
+ end
14
+
15
+ def total_difference_between_runs
16
+ difference_between_runs(@initial_count_hash).values.inject(0) { |sum, count| sum + count }
17
+ end
18
+
19
+ def capture_initial_memory_usage
20
+ capture_memory_usage
21
+ @initial_count_hash = @current_count_hash
22
+ end
23
+
24
+ def capture_memory_usage
25
+ @difference_between_runs = nil
26
+ @previous_count_hash = @current_count_hash
27
+
28
+ class_to_count = Hash.new { |hash, key| hash[key] = 0 }
29
+ ObjectSpace.each_object { |obj| class_to_count[obj.class] += 1 }
30
+
31
+ sorted_class_to_count = class_to_count.sort_by { |k, v| -v }
32
+ @current_count_hash = Hash[sorted_class_to_count]
33
+ end
34
+
35
+ def dump_status(logger)
36
+ diff = difference_between_runs
37
+ most_used_objects = current_count_hash.to_a.sort_by(&:last).reverse[0, 20]
38
+
39
+ most_used_objects.each do |object_class, count|
40
+ delta = diff[object_class]
41
+ logger.add(log_level(delta), sprintf("\t%s: %d (%+d)", object_class, count, delta))
42
+ end
43
+ end
44
+
45
+ private
46
+ def log_level(delta)
47
+ delta > 0 ? Logger::WARN : Logger::DEBUG
48
+ end
49
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ describe Ethon::Curl do
5
+ describe ".init" do
6
+ before { Ethon::Curl.send(:class_variable_set, :@@initialized, false) }
7
+
8
+ context "when global_init fails" do
9
+ it "raises global init error" do
10
+ expect(Ethon::Curl).to receive(:global_init).and_return(1)
11
+ expect{ Ethon::Curl.init }.to raise_error(Ethon::Errors::GlobalInit)
12
+ end
13
+ end
14
+
15
+ context "when global_init works" do
16
+ before { expect(Ethon::Curl).to receive(:global_init).and_return(0) }
17
+
18
+ it "doesn't raises global init error" do
19
+ expect{ Ethon::Curl.init }.to_not raise_error
20
+ end
21
+
22
+ it "logs" do
23
+ expect(Ethon.logger).to receive(:debug)
24
+ Ethon::Curl.init
25
+ end
26
+ end
27
+
28
+ context "when global_cleanup is called" do
29
+ before { expect(Ethon::Curl).to receive(:global_cleanup) }
30
+
31
+ it "logs" do
32
+ expect(Ethon.logger).to receive(:debug).twice
33
+ Ethon::Curl.init
34
+ Ethon::Curl.cleanup
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ describe Ethon::Easy::Callbacks do
5
+ let!(:easy) { Ethon::Easy.new }
6
+
7
+ describe "#set_callbacks" do
8
+ before do
9
+ expect(Ethon::Curl).to receive(:set_option).exactly(3).times
10
+ end
11
+
12
+ it "sets write-, debug-, and headerfunction" do
13
+ easy.set_callbacks
14
+ end
15
+
16
+ it "resets @response_body" do
17
+ easy.set_callbacks
18
+ expect(easy.instance_variable_get(:@response_body)).to eq("")
19
+ end
20
+
21
+ it "resets @response_headers" do
22
+ easy.set_callbacks
23
+ expect(easy.instance_variable_get(:@response_headers)).to eq("")
24
+ end
25
+
26
+ it "resets @debug_info" do
27
+ easy.set_callbacks
28
+ expect(easy.instance_variable_get(:@debug_info).to_a).to eq([])
29
+ end
30
+ end
31
+
32
+ describe "#progress_callback" do
33
+ it "returns 0" do
34
+ expect(easy.progress_callback.call(0,1,1,1,1)).to be(0)
35
+ end
36
+ end
37
+
38
+ describe "#body_write_callback" do
39
+ let(:body_write_callback) { easy.instance_variable_get(:@body_write_callback) }
40
+ let(:stream) { double(:read_string => "") }
41
+ context "when body returns not :abort" do
42
+ it "returns number bigger than 0" do
43
+ expect(body_write_callback.call(stream, 1, 1, nil) > 0).to be(true)
44
+ end
45
+ end
46
+
47
+ context "when body returns :abort" do
48
+ before do
49
+ easy.on_body.clear
50
+ easy.on_body { :abort }
51
+ end
52
+ let(:body_write_callback) { easy.instance_variable_get(:@body_write_callback) }
53
+
54
+ it "returns -1 to indicate abort to libcurl" do
55
+ expect(body_write_callback.call(stream, 1, 1, nil)).to eq(-1)
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ describe Ethon::Easy::DebugInfo do
5
+ let(:easy) { Ethon::Easy.new }
6
+
7
+ before do
8
+ easy.url = "http://localhost:3001/"
9
+ easy.perform
10
+ end
11
+
12
+ describe "#debug_info" do
13
+ context "when verbose is not set to true" do
14
+ it "does not save any debug info after a request" do
15
+ expect(easy.debug_info.to_a.length).to eq(0)
16
+ expect(easy.debug_info.to_h.values.flatten.length).to eq(0)
17
+ end
18
+ end
19
+
20
+ context "when verbose is set to true" do
21
+ before do
22
+ easy.verbose = true
23
+ easy.perform
24
+ end
25
+
26
+ after do
27
+ easy.verbose = false
28
+ easy.reset
29
+ end
30
+
31
+ it "saves debug info after a request" do
32
+ expect(easy.debug_info.to_a.length).to be > 0
33
+ end
34
+
35
+ it "saves request headers" do
36
+ expect(easy.debug_info.header_out.join).to include('GET / HTTP/1.1')
37
+ end
38
+
39
+ it "saves response headers" do
40
+ expect(easy.debug_info.header_in.length).to be > 0
41
+ expect(easy.response_headers).to include(easy.debug_info.header_in.join)
42
+ end
43
+
44
+ it "saves incoming data" do
45
+ expect(easy.debug_info.data_in.length).to be > 0
46
+ expect(easy.response_body).to include(easy.debug_info.data_in.join)
47
+ end
48
+
49
+ it "saves debug text" do
50
+ expect(easy.debug_info.text.length).to be > 0
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ describe Ethon::Easy::Informations do
5
+
6
+ describe "#supports_asynch_dns?" do
7
+ it "returns boolean" do
8
+ expect([true, false].include? Ethon::Easy.supports_asynch_dns?).to be_truthy
9
+ end
10
+ end
11
+
12
+ describe "#supports_zlib?" do
13
+ it "returns boolean" do
14
+ expect([true, false].include? Ethon::Easy.supports_zlib?).to be_truthy
15
+ end
16
+ end
17
+
18
+ describe "#supports_timeout_ms?" do
19
+ it "returns boolean" do
20
+ expect([true, false].include? Ethon::Easy.supports_timeout_ms?).to be_truthy
21
+ end
22
+ end
23
+
24
+ end