cybrid_api_organization_ruby 0.127.21 → 0.127.23

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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +10 -7
  3. data/README.md +5 -5
  4. data/cybrid_api_organization_ruby.gemspec +1 -1
  5. data/lib/cybrid_api_organization_ruby/api/organizations_organization_api.rb +1 -1
  6. data/lib/cybrid_api_organization_ruby/api/subscription_deliveries_organization_api.rb +1 -1
  7. data/lib/cybrid_api_organization_ruby/api/subscription_events_organization_api.rb +1 -1
  8. data/lib/cybrid_api_organization_ruby/api/subscriptions_organization_api.rb +1 -1
  9. data/lib/cybrid_api_organization_ruby/api_client.rb +1 -1
  10. data/lib/cybrid_api_organization_ruby/api_error.rb +1 -1
  11. data/lib/cybrid_api_organization_ruby/configuration.rb +1 -1
  12. data/lib/cybrid_api_organization_ruby/models/error_response_organization_model.rb +1 -1
  13. data/lib/cybrid_api_organization_ruby/models/organization_organization_model.rb +1 -1
  14. data/lib/cybrid_api_organization_ruby/models/patch_organization_organization_model.rb +1 -1
  15. data/lib/cybrid_api_organization_ruby/models/post_subscription_delivery_organization_model.rb +1 -1
  16. data/lib/cybrid_api_organization_ruby/models/post_subscription_organization_model.rb +1 -1
  17. data/lib/cybrid_api_organization_ruby/models/subscription_delivery_list_organization_model.rb +1 -1
  18. data/lib/cybrid_api_organization_ruby/models/subscription_delivery_organization_model.rb +1 -1
  19. data/lib/cybrid_api_organization_ruby/models/subscription_environment_organization_model.rb +1 -1
  20. data/lib/cybrid_api_organization_ruby/models/subscription_event_list_organization_model.rb +1 -1
  21. data/lib/cybrid_api_organization_ruby/models/subscription_event_organization_model.rb +1 -1
  22. data/lib/cybrid_api_organization_ruby/models/subscription_list_organization_model.rb +1 -1
  23. data/lib/cybrid_api_organization_ruby/models/subscription_organization_model.rb +1 -1
  24. data/lib/cybrid_api_organization_ruby/models/subscription_state_organization_model.rb +1 -1
  25. data/lib/cybrid_api_organization_ruby/models/subscription_type_organization_model.rb +1 -1
  26. data/lib/cybrid_api_organization_ruby/version.rb +2 -2
  27. data/lib/cybrid_api_organization_ruby.rb +1 -1
  28. data/spec/api/organizations_organization_api_spec.rb +1 -1
  29. data/spec/api/subscription_deliveries_organization_api_spec.rb +1 -1
  30. data/spec/api/subscription_events_organization_api_spec.rb +1 -1
  31. data/spec/api/subscriptions_organization_api_spec.rb +1 -1
  32. data/spec/api_client_spec.rb +1 -1
  33. data/spec/configuration_spec.rb +1 -1
  34. data/spec/models/error_response_organization_model_spec.rb +1 -1
  35. data/spec/models/organization_organization_model_spec.rb +1 -1
  36. data/spec/models/patch_organization_organization_model_spec.rb +1 -1
  37. data/spec/models/post_subscription_delivery_organization_model_spec.rb +1 -1
  38. data/spec/models/post_subscription_organization_model_spec.rb +1 -1
  39. data/spec/models/subscription_delivery_list_organization_model_spec.rb +1 -1
  40. data/spec/models/subscription_delivery_organization_model_spec.rb +1 -1
  41. data/spec/models/subscription_environment_organization_model_spec.rb +1 -1
  42. data/spec/models/subscription_event_list_organization_model_spec.rb +1 -1
  43. data/spec/models/subscription_event_organization_model_spec.rb +1 -1
  44. data/spec/models/subscription_list_organization_model_spec.rb +1 -1
  45. data/spec/models/subscription_organization_model_spec.rb +1 -1
  46. data/spec/models/subscription_state_organization_model_spec.rb +1 -1
  47. data/spec/models/subscription_type_organization_model_spec.rb +1 -1
  48. data/spec/spec_helper.rb +1 -1
  49. data/vendor/bundle/ruby/3.3.0/cache/ethon-0.18.0.gem +0 -0
  50. data/vendor/bundle/ruby/3.3.0/cache/logger-1.7.0.gem +0 -0
  51. data/vendor/bundle/ruby/3.3.0/cache/typhoeus-1.6.0.gem +0 -0
  52. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/byebug-13.0.0/gem_make.out +5 -5
  53. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.5.1/gem_make.out +5 -5
  54. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/io-console-0.8.2/gem_make.out +5 -5
  55. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  56. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.3.1/gem_make.out +5 -5
  57. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/racc-1.8.1/gem_make.out +5 -5
  58. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.2.0/gem_make.out +5 -5
  59. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/CHANGELOG.md +46 -1
  60. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/README.md +23 -0
  61. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.18.0/ethon.gemspec +37 -0
  62. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curls/classes.rb +12 -2
  63. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curls/codes.rb +3 -2
  64. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curls/options.rb +4 -3
  65. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/callbacks.rb +10 -3
  66. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/informations.rb +3 -0
  67. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/response_callbacks.rb +6 -1
  68. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/loggable.rb +0 -1
  69. data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/version.rb +1 -1
  70. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/.document +4 -0
  71. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/.rdoc_options +3 -0
  72. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/BSDL +22 -0
  73. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/COPYING +56 -0
  74. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/README.md +104 -0
  75. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/lib/logger/errors.rb +9 -0
  76. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/lib/logger/formatter.rb +36 -0
  77. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/lib/logger/log_device.rb +265 -0
  78. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/lib/logger/period.rb +47 -0
  79. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/lib/logger/severity.rb +38 -0
  80. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/lib/logger/version.rb +5 -0
  81. data/vendor/bundle/ruby/3.3.0/gems/logger-1.7.0/lib/logger.rb +789 -0
  82. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/CHANGELOG.md +14 -1
  83. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/README.md +2 -2
  84. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/version.rb +1 -1
  85. data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/typhoeus.gemspec +1 -1
  86. data/vendor/bundle/ruby/3.3.0/specifications/ethon-0.18.0.gemspec +27 -0
  87. data/vendor/bundle/ruby/3.3.0/specifications/logger-1.7.0.gemspec +22 -0
  88. data/vendor/bundle/ruby/3.3.0/specifications/{typhoeus-1.5.0.gemspec → typhoeus-1.6.0.gemspec} +5 -5
  89. metadata +126 -156
  90. data/vendor/bundle/ruby/3.3.0/cache/ethon-0.15.0.gem +0 -0
  91. data/vendor/bundle/ruby/3.3.0/cache/typhoeus-1.5.0.gem +0 -0
  92. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/.github/workflows/ruby.yml +0 -41
  93. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/.gitignore +0 -8
  94. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/.rspec +0 -3
  95. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/Gemfile +0 -43
  96. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/Guardfile +0 -10
  97. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/Rakefile +0 -40
  98. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/ethon.gemspec +0 -26
  99. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/benchmarks.rb +0 -104
  100. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/memory_leaks.rb +0 -114
  101. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/perf_spec_helper.rb +0 -37
  102. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/support/memory_test_helpers.rb +0 -76
  103. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/support/os_memory_leak_tracker.rb +0 -48
  104. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/profile/support/ruby_object_leak_tracker.rb +0 -49
  105. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/curl_spec.rb +0 -38
  106. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/callbacks_spec.rb +0 -59
  107. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/debug_info_spec.rb +0 -54
  108. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/features_spec.rb +0 -24
  109. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/form_spec.rb +0 -104
  110. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/header_spec.rb +0 -79
  111. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/custom_spec.rb +0 -177
  112. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/delete_spec.rb +0 -21
  113. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/get_spec.rb +0 -126
  114. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/head_spec.rb +0 -80
  115. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/options_spec.rb +0 -51
  116. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/patch_spec.rb +0 -51
  117. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/post_spec.rb +0 -317
  118. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http/put_spec.rb +0 -168
  119. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/http_spec.rb +0 -64
  120. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/informations_spec.rb +0 -120
  121. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/mirror_spec.rb +0 -47
  122. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/operations_spec.rb +0 -268
  123. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/options_spec.rb +0 -193
  124. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/queryable_spec.rb +0 -235
  125. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/response_callbacks_spec.rb +0 -152
  126. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy/util_spec.rb +0 -28
  127. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/easy_spec.rb +0 -203
  128. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/libc_spec.rb +0 -14
  129. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/loggable_spec.rb +0 -22
  130. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/multi/operations_spec.rb +0 -298
  131. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/multi/options_spec.rb +0 -182
  132. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/multi/stack_spec.rb +0 -80
  133. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/ethon/multi_spec.rb +0 -152
  134. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/spec_helper.rb +0 -28
  135. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/support/localhost_server.rb +0 -95
  136. data/vendor/bundle/ruby/3.3.0/gems/ethon-0.15.0/spec/support/server.rb +0 -115
  137. data/vendor/bundle/ruby/3.3.0/specifications/ethon-0.15.0.gemspec +0 -24
  138. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/LICENSE +0 -0
  139. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curl.rb +0 -0
  140. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curls/constants.rb +0 -0
  141. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curls/form_options.rb +0 -0
  142. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curls/functions.rb +0 -0
  143. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curls/infos.rb +0 -0
  144. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curls/messages.rb +0 -0
  145. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/curls/settings.rb +0 -0
  146. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/debug_info.rb +0 -0
  147. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/features.rb +0 -0
  148. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/form.rb +0 -0
  149. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/header.rb +0 -0
  150. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/actionable.rb +0 -0
  151. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/custom.rb +0 -0
  152. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/delete.rb +0 -0
  153. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/get.rb +0 -0
  154. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/head.rb +0 -0
  155. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/options.rb +0 -0
  156. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/patch.rb +0 -0
  157. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/post.rb +0 -0
  158. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/postable.rb +0 -0
  159. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/put.rb +0 -0
  160. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http/putable.rb +0 -0
  161. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/http.rb +0 -0
  162. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/mirror.rb +0 -0
  163. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/operations.rb +0 -0
  164. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/options.rb +0 -0
  165. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/params.rb +0 -0
  166. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/queryable.rb +0 -0
  167. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy/util.rb +0 -0
  168. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/easy.rb +0 -0
  169. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors/ethon_error.rb +0 -0
  170. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors/global_init.rb +0 -0
  171. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors/invalid_option.rb +0 -0
  172. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors/invalid_value.rb +0 -0
  173. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors/multi_add.rb +0 -0
  174. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors/multi_fdset.rb +0 -0
  175. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors/multi_remove.rb +0 -0
  176. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors/multi_timeout.rb +0 -0
  177. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors/select.rb +0 -0
  178. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/errors.rb +0 -0
  179. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/libc.rb +0 -0
  180. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/multi/operations.rb +0 -0
  181. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/multi/options.rb +0 -0
  182. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/multi/stack.rb +0 -0
  183. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon/multi.rb +0 -0
  184. /data/vendor/bundle/ruby/3.3.0/gems/{ethon-0.15.0 → ethon-0.18.0}/lib/ethon.rb +0 -0
  185. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/CONTRIBUTING.md +0 -0
  186. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/LICENSE +0 -0
  187. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/UPGRADE.md +0 -0
  188. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/rack/typhoeus/middleware/params_decoder/helper.rb +0 -0
  189. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/rack/typhoeus/middleware/params_decoder.rb +0 -0
  190. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/rack/typhoeus.rb +0 -0
  191. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/adapters/faraday.rb +0 -0
  192. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/cache/dalli.rb +0 -0
  193. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/cache/rails.rb +0 -0
  194. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/cache/redis.rb +0 -0
  195. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/config.rb +0 -0
  196. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/easy_factory.rb +0 -0
  197. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/errors/no_stub.rb +0 -0
  198. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/errors/typhoeus_error.rb +0 -0
  199. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/errors.rb +0 -0
  200. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/expectation.rb +0 -0
  201. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/hydra/addable.rb +0 -0
  202. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/hydra/before.rb +0 -0
  203. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/hydra/block_connection.rb +0 -0
  204. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/hydra/cacheable.rb +0 -0
  205. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/hydra/memoizable.rb +0 -0
  206. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/hydra/queueable.rb +0 -0
  207. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/hydra/runnable.rb +0 -0
  208. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/hydra/stubbable.rb +0 -0
  209. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/hydra.rb +0 -0
  210. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/pool.rb +0 -0
  211. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/railtie.rb +0 -0
  212. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/actions.rb +0 -0
  213. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/before.rb +0 -0
  214. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/block_connection.rb +0 -0
  215. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/cacheable.rb +0 -0
  216. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/callbacks.rb +0 -0
  217. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/marshal.rb +0 -0
  218. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/memoizable.rb +0 -0
  219. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/operations.rb +0 -0
  220. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/responseable.rb +0 -0
  221. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/streamable.rb +0 -0
  222. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request/stubbable.rb +0 -0
  223. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/request.rb +0 -0
  224. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/response/cacheable.rb +0 -0
  225. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/response/header.rb +0 -0
  226. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/response/informations.rb +0 -0
  227. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/response/status.rb +0 -0
  228. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus/response.rb +0 -0
  229. /data/vendor/bundle/ruby/3.3.0/gems/{typhoeus-1.5.0 → typhoeus-1.6.0}/lib/typhoeus.rb +0 -0
@@ -307,6 +307,7 @@ module Ethon
307
307
  option :easy, :port, :int, 3
308
308
  option :easy, :tcp_nodelay, :bool, 121
309
309
  option :easy, :address_scope, :int, 171
310
+ option :easy, :tcp_fastopen, :bool, 212
310
311
  option :easy, :tcp_keepalive, :bool, 213
311
312
  option :easy, :tcp_keepidle, :int, 214
312
313
  option :easy, :tcp_keepintvl, :int, 215
@@ -352,7 +353,7 @@ module Ethon
352
353
  option :easy, :cookiesession, :bool, 96
353
354
  option :easy, :cookielist, :string, 135
354
355
  option :easy, :httpget, :bool, 80
355
- option :easy, :http_version, :enum, 84, [:none, :httpv1_0, :httpv1_1, :httpv2_0]
356
+ option :easy, :http_version, :enum, 84, [:none, :httpv1_0, :httpv1_1, :httpv2_0, :httpv2_tls, :httpv2_prior_knowledge]
356
357
  option :easy, :ignore_content_length, :bool, 136
357
358
  option :easy, :http_content_decoding, :bool, 158
358
359
  option :easy, :http_transfer_decoding, :bool, 157
@@ -440,7 +441,7 @@ module Ethon
440
441
  option_alias :easy, :keypasswd, :sslkeypasswd
441
442
  option :easy, :sslengine, :string, 89
442
443
  option :easy, :sslengine_default, :none, 90
443
- option :easy, :sslversion, :enum, 32, [:default, :tlsv1, :sslv2, :sslv3, :tlsv1_0, :tlsv1_1, :tlsv1_2]
444
+ option :easy, :sslversion, :enum, 32, [:default, :tlsv1, :sslv2, :sslv3, :tlsv1_0, :tlsv1_1, :tlsv1_2, :tlsv1_3]
444
445
  option :easy, :ssl_verifypeer, :bool, 64
445
446
  option :easy, :cainfo, :string, 65
446
447
  option :easy, :issuercert, :string, 170
@@ -463,7 +464,7 @@ module Ethon
463
464
  option :easy, :proxy_capath, :string, 247
464
465
  option :easy, :proxy_ssl_verifypeer, :bool, 248
465
466
  option :easy, :proxy_ssl_verifyhost, :int, 249
466
- option :easy, :proxy_sslversion, :enum, 250, [:default, :tlsv1, :sslv2, :sslv3, :tlsv1_0, :tlsv1_1, :tlsv1_2]
467
+ option :easy, :proxy_sslversion, :enum, 250, [:default, :tlsv1, :sslv2, :sslv3, :tlsv1_0, :tlsv1_1, :tlsv1_2, :tlsv1_3]
467
468
  option :easy, :proxy_tlsauth_username, :string, 251
468
469
  option :easy, :proxy_tlsauth_password, :string, 252
469
470
  option :easy, :proxy_tlsauth_type, :enum, 253, [:none, :srp]
@@ -37,10 +37,10 @@ module Ethon
37
37
  # @return [ Proc ] The callback.
38
38
  def body_write_callback
39
39
  @body_write_callback ||= proc do |stream, size, num, object|
40
- headers
40
+ headers_user_callback_result = headers
41
41
  result = body(chunk = stream.read_string(size * num))
42
42
  @response_body << chunk if result == :unyielded
43
- result != :abort ? size * num : -1
43
+ (result != :abort && headers_user_callback_result != :abort) ? size * num : -1
44
44
  end
45
45
  end
46
46
 
@@ -68,7 +68,14 @@ module Ethon
68
68
  @debug_callback ||= proc {|handle, type, data, size, udata|
69
69
  message = data.read_string(size)
70
70
  @debug_info.add type, message
71
- print message unless [:data_in, :data_out].include?(type)
71
+
72
+ if [:ssl_data_in, :ssl_data_out].include?(type)
73
+ print "[#{size} bytes data]\n"
74
+ elsif [:data_in, :data_out].include?(type)
75
+ # print "} [#{size} bytes data]\n"
76
+ else
77
+ print message
78
+ end
72
79
  0
73
80
  }
74
81
  end
@@ -73,6 +73,9 @@ module Ethon
73
73
  # actually followed.
74
74
  :redirect_count => :long,
75
75
 
76
+ # URL a redirect would take you to, had you enabled redirects (Added in 7.18.2)
77
+ :redirect_url => :string,
78
+
76
79
  # Return the bytes, the total amount of bytes that were uploaded
77
80
  :size_upload => :double,
78
81
 
@@ -43,7 +43,12 @@ module Ethon
43
43
  return if @headers_called
44
44
  @headers_called = true
45
45
  if defined?(@on_headers) and not @on_headers.nil?
46
- @on_headers.each{ |callback| callback.call(self) }
46
+ result = nil
47
+ @on_headers.each do |callback|
48
+ result = callback.call(self)
49
+ break if result == :abort
50
+ end
51
+ result
47
52
  end
48
53
  end
49
54
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
3
2
  module Ethon
4
3
 
@@ -2,5 +2,5 @@
2
2
  module Ethon
3
3
 
4
4
  # Ethon version.
5
- VERSION = '0.15.0'
5
+ VERSION = '0.18.0'
6
6
  end
@@ -0,0 +1,4 @@
1
+ BSDL
2
+ COPYING
3
+ README.md
4
+ lib/
@@ -0,0 +1,3 @@
1
+ ---
2
+ main_page: README.md
3
+ title: Documentation for Logger
@@ -0,0 +1,22 @@
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a. place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b. use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c. give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d. make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a. distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b. accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c. give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d. make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
@@ -0,0 +1,104 @@
1
+ # Logger
2
+
3
+ Logger is a simple but powerful logging utility to output messages in your Ruby program.
4
+
5
+ Logger has the following features:
6
+
7
+ * Print messages to different levels such as `info` and `error`
8
+ * Auto-rolling of log files
9
+ * Setting the format of log messages
10
+ * Specifying a program name in conjunction with the message
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'logger'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ $ bundle
23
+
24
+ Or install it yourself as:
25
+
26
+ $ gem install logger
27
+
28
+ ## Usage
29
+
30
+ ### Simple Example
31
+
32
+ ```ruby
33
+ require 'logger'
34
+
35
+ # Create a Logger that prints to STDOUT
36
+ log = Logger.new(STDOUT)
37
+ log.debug("Created Logger")
38
+
39
+ log.info("Program finished")
40
+
41
+ # Create a Logger that prints to STDERR
42
+ error_log = Logger.new(STDERR)
43
+ error_log = error_log.error("fatal error")
44
+ ```
45
+
46
+ ## Development
47
+
48
+ After checking out the repo, run the following to install dependencies.
49
+
50
+ ```
51
+ $ bin/setup
52
+ ```
53
+
54
+ Then, run the tests as:
55
+
56
+ ```
57
+ $ rake test
58
+ ```
59
+
60
+ To install this gem onto your local machine, run
61
+
62
+ ```
63
+ $ rake install
64
+ ```
65
+
66
+ To release a new version, update the version number in `lib/logger/version.rb`, and then run
67
+
68
+ ```
69
+ $ rake release
70
+ ```
71
+
72
+ which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
73
+
74
+ ## Advanced Development
75
+
76
+ ### Run tests of a specific file
77
+
78
+ ```
79
+ $ ruby test/logger/test_logger.rb
80
+ ```
81
+
82
+ ### Run tests filtering test methods by a name
83
+
84
+ `--name` option is available as:
85
+
86
+ ```
87
+ $ ruby test/logger/test_logger.rb --name test_lshift
88
+ ```
89
+
90
+ ### Publish documents to GitHub Pages
91
+
92
+ ```
93
+ $ rake gh-pages
94
+ ```
95
+
96
+ Then, git commit and push the generated HTMLs onto `gh-pages` branch.
97
+
98
+ ## Contributing
99
+
100
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/logger.
101
+
102
+ ## License
103
+
104
+ The gem is available as open source under the terms of the [BSD-2-Clause](BSDL).
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Logger
4
+ # not used after 1.2.7. just for compat.
5
+ class Error < RuntimeError # :nodoc:
6
+ end
7
+ class ShiftingError < Error # :nodoc:
8
+ end
9
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Logger
4
+ # Default formatter for log messages.
5
+ class Formatter
6
+ Format = "%.1s, [%s #%d] %5s -- %s: %s\n"
7
+ DatetimeFormat = "%Y-%m-%dT%H:%M:%S.%6N"
8
+
9
+ attr_accessor :datetime_format
10
+
11
+ def initialize
12
+ @datetime_format = nil
13
+ end
14
+
15
+ def call(severity, time, progname, msg)
16
+ sprintf(Format, severity, format_datetime(time), Process.pid, severity, progname, msg2str(msg))
17
+ end
18
+
19
+ private
20
+
21
+ def format_datetime(time)
22
+ time.strftime(@datetime_format || DatetimeFormat)
23
+ end
24
+
25
+ def msg2str(msg)
26
+ case msg
27
+ when ::String
28
+ msg
29
+ when ::Exception
30
+ "#{ msg.message } (#{ msg.class })\n#{ msg.backtrace.join("\n") if msg.backtrace }"
31
+ else
32
+ msg.inspect
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,265 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'period'
4
+
5
+ class Logger
6
+ # Device used for logging messages.
7
+ class LogDevice
8
+ include Period
9
+
10
+ attr_reader :dev
11
+ attr_reader :filename
12
+ include MonitorMixin
13
+
14
+ def initialize(
15
+ log = nil, shift_age: nil, shift_size: nil, shift_period_suffix: nil,
16
+ binmode: false, reraise_write_errors: [], skip_header: false
17
+ )
18
+ @dev = @filename = @shift_age = @shift_size = @shift_period_suffix = nil
19
+ @binmode = binmode
20
+ @reraise_write_errors = reraise_write_errors
21
+ @skip_header = skip_header
22
+ mon_initialize
23
+ set_dev(log)
24
+ set_file(shift_age, shift_size, shift_period_suffix) if @filename
25
+ end
26
+
27
+ def write(message)
28
+ handle_write_errors("writing") do
29
+ synchronize do
30
+ if @shift_age and @dev.respond_to?(:stat)
31
+ handle_write_errors("shifting") {check_shift_log}
32
+ end
33
+ handle_write_errors("writing") {@dev.write(message)}
34
+ end
35
+ end
36
+ end
37
+
38
+ def close
39
+ begin
40
+ synchronize do
41
+ @dev.close rescue nil
42
+ end
43
+ rescue Exception
44
+ @dev.close rescue nil
45
+ end
46
+ end
47
+
48
+ def reopen(log = nil, shift_age: nil, shift_size: nil, shift_period_suffix: nil, binmode: nil)
49
+ # reopen the same filename if no argument, do nothing for IO
50
+ log ||= @filename if @filename
51
+ @binmode = binmode unless binmode.nil?
52
+ if log
53
+ synchronize do
54
+ if @filename and @dev
55
+ @dev.close rescue nil # close only file opened by Logger
56
+ @filename = nil
57
+ end
58
+ set_dev(log)
59
+ set_file(shift_age, shift_size, shift_period_suffix) if @filename
60
+ end
61
+ end
62
+ self
63
+ end
64
+
65
+ private
66
+
67
+ # :stopdoc:
68
+
69
+ MODE = File::WRONLY | File::APPEND
70
+ # TruffleRuby < 24.2 does not have File::SHARE_DELETE
71
+ if File.const_defined? :SHARE_DELETE
72
+ MODE_TO_OPEN = MODE | File::SHARE_DELETE | File::BINARY
73
+ else
74
+ MODE_TO_OPEN = MODE | File::BINARY
75
+ end
76
+ MODE_TO_CREATE = MODE_TO_OPEN | File::CREAT | File::EXCL
77
+
78
+ def set_dev(log)
79
+ if log.respond_to?(:write) and log.respond_to?(:close)
80
+ @dev = log
81
+ if log.respond_to?(:path) and path = log.path
82
+ if File.exist?(path)
83
+ @filename = path
84
+ end
85
+ end
86
+ else
87
+ @dev = open_logfile(log)
88
+ @filename = log
89
+ end
90
+ end
91
+
92
+ def set_file(shift_age, shift_size, shift_period_suffix)
93
+ @shift_age = shift_age || @shift_age || 7
94
+ @shift_size = shift_size || @shift_size || 1048576
95
+ @shift_period_suffix = shift_period_suffix || @shift_period_suffix || '%Y%m%d'
96
+
97
+ unless @shift_age.is_a?(Integer)
98
+ base_time = @dev.respond_to?(:stat) ? @dev.stat.mtime : Time.now
99
+ @next_rotate_time = next_rotate_time(base_time, @shift_age)
100
+ end
101
+ end
102
+
103
+ if MODE_TO_OPEN == MODE
104
+ def fixup_mode(dev)
105
+ dev
106
+ end
107
+ else
108
+ def fixup_mode(dev)
109
+ return dev if @binmode
110
+ dev.autoclose = false
111
+ old_dev = dev
112
+ dev = File.new(dev.fileno, mode: MODE, path: dev.path)
113
+ old_dev.close
114
+ PathAttr.set_path(dev, filename) if defined?(PathAttr)
115
+ dev
116
+ end
117
+ end
118
+
119
+ def open_logfile(filename)
120
+ begin
121
+ dev = File.open(filename, MODE_TO_OPEN)
122
+ rescue Errno::ENOENT
123
+ create_logfile(filename)
124
+ else
125
+ dev = fixup_mode(dev)
126
+ dev.sync = true
127
+ dev.binmode if @binmode
128
+ dev
129
+ end
130
+ end
131
+
132
+ def create_logfile(filename)
133
+ begin
134
+ logdev = File.open(filename, MODE_TO_CREATE)
135
+ logdev.flock(File::LOCK_EX)
136
+ logdev = fixup_mode(logdev)
137
+ logdev.sync = true
138
+ logdev.binmode if @binmode
139
+ add_log_header(logdev) unless @skip_header
140
+ logdev.flock(File::LOCK_UN)
141
+ logdev
142
+ rescue Errno::EEXIST
143
+ # file is created by another process
144
+ open_logfile(filename)
145
+ end
146
+ end
147
+
148
+ def handle_write_errors(mesg)
149
+ yield
150
+ rescue *@reraise_write_errors
151
+ raise
152
+ rescue
153
+ warn("log #{mesg} failed. #{$!}")
154
+ end
155
+
156
+ def add_log_header(file)
157
+ file.write(
158
+ "# Logfile created on %s by %s\n" % [Time.now.to_s, Logger::ProgName]
159
+ ) if file.size == 0
160
+ end
161
+
162
+ def check_shift_log
163
+ if @shift_age.is_a?(Integer)
164
+ # Note: always returns false if '0'.
165
+ if @filename && (@shift_age > 0) && (@dev.stat.size > @shift_size)
166
+ lock_shift_log { shift_log_age }
167
+ end
168
+ else
169
+ now = Time.now
170
+ if now >= @next_rotate_time
171
+ @next_rotate_time = next_rotate_time(now, @shift_age)
172
+ lock_shift_log { shift_log_period(previous_period_end(now, @shift_age)) }
173
+ end
174
+ end
175
+ end
176
+
177
+ def lock_shift_log
178
+ retry_limit = 8
179
+ retry_sleep = 0.1
180
+ begin
181
+ File.open(@filename, MODE_TO_OPEN) do |lock|
182
+ lock.flock(File::LOCK_EX) # inter-process locking. will be unlocked at closing file
183
+ if File.identical?(@filename, lock) and File.identical?(lock, @dev)
184
+ yield # log shifting
185
+ else
186
+ # log shifted by another process (i-node before locking and i-node after locking are different)
187
+ @dev.close rescue nil
188
+ @dev = open_logfile(@filename)
189
+ end
190
+ end
191
+ true
192
+ rescue Errno::ENOENT
193
+ # @filename file would not exist right after #rename and before #create_logfile
194
+ if retry_limit <= 0
195
+ warn("log rotation inter-process lock failed. #{$!}")
196
+ else
197
+ sleep retry_sleep
198
+ retry_limit -= 1
199
+ retry_sleep *= 2
200
+ retry
201
+ end
202
+ end
203
+ rescue
204
+ warn("log rotation inter-process lock failed. #{$!}")
205
+ end
206
+
207
+ def shift_log_age
208
+ (@shift_age-3).downto(0) do |i|
209
+ if FileTest.exist?("#{@filename}.#{i}")
210
+ File.rename("#{@filename}.#{i}", "#{@filename}.#{i+1}")
211
+ end
212
+ end
213
+ shift_log_file("#{@filename}.0")
214
+ end
215
+
216
+ def shift_log_period(period_end)
217
+ suffix = period_end.strftime(@shift_period_suffix)
218
+ age_file = "#{@filename}.#{suffix}"
219
+ if FileTest.exist?(age_file)
220
+ # try to avoid filename crash caused by Timestamp change.
221
+ idx = 0
222
+ # .99 can be overridden; avoid too much file search with 'loop do'
223
+ while idx < 100
224
+ idx += 1
225
+ age_file = "#{@filename}.#{suffix}.#{idx}"
226
+ break unless FileTest.exist?(age_file)
227
+ end
228
+ end
229
+ shift_log_file(age_file)
230
+ end
231
+
232
+ def shift_log_file(shifted)
233
+ stat = @dev.stat
234
+ @dev.close rescue nil
235
+ File.rename(@filename, shifted)
236
+ @dev = create_logfile(@filename)
237
+ mode, uid, gid = stat.mode, stat.uid, stat.gid
238
+ begin
239
+ @dev.chmod(mode) if mode
240
+ mode = nil
241
+ @dev.chown(uid, gid)
242
+ rescue Errno::EPERM
243
+ if mode
244
+ # failed to chmod, probably nothing can do more.
245
+ elsif uid
246
+ uid = nil
247
+ retry # to change gid only
248
+ end
249
+ end
250
+ return true
251
+ end
252
+ end
253
+ end
254
+
255
+ File.open(__FILE__) do |f|
256
+ File.new(f.fileno, autoclose: false, path: "").path
257
+ rescue IOError
258
+ module PathAttr # :nodoc:
259
+ attr_reader :path
260
+
261
+ def self.set_path(file, path)
262
+ file.extend(self).instance_variable_set(:@path, path)
263
+ end
264
+ end
265
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Logger
4
+ module Period
5
+ module_function
6
+
7
+ SiD = 24 * 60 * 60
8
+
9
+ def next_rotate_time(now, shift_age)
10
+ case shift_age
11
+ when 'daily', :daily
12
+ t = Time.mktime(now.year, now.month, now.mday) + SiD
13
+ when 'weekly', :weekly
14
+ t = Time.mktime(now.year, now.month, now.mday) + SiD * (7 - now.wday)
15
+ when 'monthly', :monthly
16
+ t = Time.mktime(now.year, now.month, 1) + SiD * 32
17
+ return Time.mktime(t.year, t.month, 1)
18
+ when 'now', 'everytime', :now, :everytime
19
+ return now
20
+ else
21
+ raise ArgumentError, "invalid :shift_age #{shift_age.inspect}, should be daily, weekly, monthly, or everytime"
22
+ end
23
+ if t.hour.nonzero? or t.min.nonzero? or t.sec.nonzero?
24
+ hour = t.hour
25
+ t = Time.mktime(t.year, t.month, t.mday)
26
+ t += SiD if hour > 12
27
+ end
28
+ t
29
+ end
30
+
31
+ def previous_period_end(now, shift_age)
32
+ case shift_age
33
+ when 'daily', :daily
34
+ t = Time.mktime(now.year, now.month, now.mday) - SiD / 2
35
+ when 'weekly', :weekly
36
+ t = Time.mktime(now.year, now.month, now.mday) - (SiD * now.wday + SiD / 2)
37
+ when 'monthly', :monthly
38
+ t = Time.mktime(now.year, now.month, 1) - SiD / 2
39
+ when 'now', 'everytime', :now, :everytime
40
+ return now
41
+ else
42
+ raise ArgumentError, "invalid :shift_age #{shift_age.inspect}, should be daily, weekly, monthly, or everytime"
43
+ end
44
+ Time.mktime(t.year, t.month, t.mday, 23, 59, 59)
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Logger
4
+ # Logging severity.
5
+ module Severity
6
+ # Low-level information, mostly for developers.
7
+ DEBUG = 0
8
+ # Generic (useful) information about system operation.
9
+ INFO = 1
10
+ # A warning.
11
+ WARN = 2
12
+ # A handleable error condition.
13
+ ERROR = 3
14
+ # An unhandleable error that results in a program crash.
15
+ FATAL = 4
16
+ # An unknown message that should always be logged.
17
+ UNKNOWN = 5
18
+
19
+ LEVELS = {
20
+ "debug" => DEBUG,
21
+ "info" => INFO,
22
+ "warn" => WARN,
23
+ "error" => ERROR,
24
+ "fatal" => FATAL,
25
+ "unknown" => UNKNOWN,
26
+ }
27
+ private_constant :LEVELS
28
+
29
+ def self.coerce(severity)
30
+ if severity.is_a?(Integer)
31
+ severity
32
+ else
33
+ key = severity.to_s.downcase
34
+ LEVELS[key] || raise(ArgumentError, "invalid log level: #{severity}")
35
+ end
36
+ end
37
+ end
38
+ end