es_cli 0.1.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 (485) hide show
  1. checksums.yaml +7 -0
  2. data/.bundle/config +2 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +39 -0
  5. data/Rakefile +12 -0
  6. data/exe/es +8 -0
  7. data/lib/es_cli/cli.rb +247 -0
  8. data/lib/es_cli/version.rb +5 -0
  9. data/lib/es_cli.rb +11 -0
  10. data/readme.org +78 -0
  11. data/sig/es_cli.rbs +4 -0
  12. data/vendor/bundle/ruby/3.1.0/bin/rake +29 -0
  13. data/vendor/bundle/ruby/3.1.0/bin/thor +29 -0
  14. data/vendor/bundle/ruby/3.1.0/cache/event_stream_parser-1.0.0.gem +0 -0
  15. data/vendor/bundle/ruby/3.1.0/cache/faraday-2.12.2.gem +0 -0
  16. data/vendor/bundle/ruby/3.1.0/cache/faraday-multipart-1.1.0.gem +0 -0
  17. data/vendor/bundle/ruby/3.1.0/cache/faraday-net_http-3.4.0.gem +0 -0
  18. data/vendor/bundle/ruby/3.1.0/cache/json-2.9.1.gem +0 -0
  19. data/vendor/bundle/ruby/3.1.0/cache/logger-1.6.5.gem +0 -0
  20. data/vendor/bundle/ruby/3.1.0/cache/multipart-post-2.4.1.gem +0 -0
  21. data/vendor/bundle/ruby/3.1.0/cache/net-http-0.6.0.gem +0 -0
  22. data/vendor/bundle/ruby/3.1.0/cache/power_assert-2.0.5.gem +0 -0
  23. data/vendor/bundle/ruby/3.1.0/cache/rake-13.2.1.gem +0 -0
  24. data/vendor/bundle/ruby/3.1.0/cache/ruby-openai-7.3.1.gem +0 -0
  25. data/vendor/bundle/ruby/3.1.0/cache/test-unit-3.6.7.gem +0 -0
  26. data/vendor/bundle/ruby/3.1.0/cache/thor-1.3.2.gem +0 -0
  27. data/vendor/bundle/ruby/3.1.0/cache/uri-1.0.2.gem +0 -0
  28. data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/gem.build_complete +0 -0
  29. data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/gem_make.out +22 -0
  30. data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/json/ext/generator.bundle +0 -0
  31. data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/json/ext/parser.bundle +0 -0
  32. data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/mkmf.log +208 -0
  33. data/vendor/bundle/ruby/3.1.0/gems/event_stream_parser-1.0.0/LICENSE.md +21 -0
  34. data/vendor/bundle/ruby/3.1.0/gems/event_stream_parser-1.0.0/README.md +99 -0
  35. data/vendor/bundle/ruby/3.1.0/gems/event_stream_parser-1.0.0/lib/event_stream_parser/version.rb +5 -0
  36. data/vendor/bundle/ruby/3.1.0/gems/event_stream_parser-1.0.0/lib/event_stream_parser.rb +222 -0
  37. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/CHANGELOG.md +574 -0
  38. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/LICENSE.md +20 -0
  39. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/README.md +67 -0
  40. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/Rakefile +12 -0
  41. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/examples/client_spec.rb +119 -0
  42. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/examples/client_test.rb +144 -0
  43. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/adapter/test.rb +311 -0
  44. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/adapter.rb +101 -0
  45. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/adapter_registry.rb +30 -0
  46. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/connection.rb +564 -0
  47. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/encoders/flat_params_encoder.rb +105 -0
  48. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/encoders/nested_params_encoder.rb +183 -0
  49. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/error.rb +165 -0
  50. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/logging/formatter.rb +118 -0
  51. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/methods.rb +6 -0
  52. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/middleware.rb +72 -0
  53. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/middleware_registry.rb +83 -0
  54. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/connection_options.rb +23 -0
  55. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/env.rb +204 -0
  56. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/proxy_options.rb +36 -0
  57. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/request_options.rb +23 -0
  58. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/ssl_options.rb +73 -0
  59. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options.rb +219 -0
  60. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/parameters.rb +5 -0
  61. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/rack_builder.rb +251 -0
  62. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request/authorization.rb +54 -0
  63. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request/instrumentation.rb +58 -0
  64. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request/json.rb +70 -0
  65. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request/url_encoded.rb +60 -0
  66. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request.rb +139 -0
  67. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/response/json.rb +74 -0
  68. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/response/logger.rb +37 -0
  69. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/response/raise_error.rb +83 -0
  70. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/response.rb +91 -0
  71. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/utils/headers.rb +150 -0
  72. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/utils/params_hash.rb +61 -0
  73. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/utils.rb +121 -0
  74. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/version.rb +5 -0
  75. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday.rb +157 -0
  76. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/external_adapters/faraday_specs_setup.rb +14 -0
  77. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/adapter/test_spec.rb +442 -0
  78. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/adapter_registry_spec.rb +28 -0
  79. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/adapter_spec.rb +55 -0
  80. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/connection_spec.rb +808 -0
  81. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/error_spec.rb +93 -0
  82. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/middleware_registry_spec.rb +31 -0
  83. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/middleware_spec.rb +213 -0
  84. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/options/env_spec.rb +76 -0
  85. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/options/options_spec.rb +297 -0
  86. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/options/proxy_options_spec.rb +52 -0
  87. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/options/request_options_spec.rb +19 -0
  88. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/params_encoders/flat_spec.rb +42 -0
  89. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/params_encoders/nested_spec.rb +151 -0
  90. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/rack_builder_spec.rb +317 -0
  91. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request/authorization_spec.rb +118 -0
  92. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request/instrumentation_spec.rb +74 -0
  93. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request/json_spec.rb +199 -0
  94. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request/url_encoded_spec.rb +93 -0
  95. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request_spec.rb +110 -0
  96. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/response/json_spec.rb +206 -0
  97. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/response/logger_spec.rb +278 -0
  98. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/response/raise_error_spec.rb +275 -0
  99. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/response_spec.rb +77 -0
  100. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/utils/headers_spec.rb +109 -0
  101. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/utils_spec.rb +119 -0
  102. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday_spec.rb +43 -0
  103. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/spec_helper.rb +133 -0
  104. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/disabling_stub.rb +14 -0
  105. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/fake_safe_buffer.rb +15 -0
  106. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/faraday_middleware_subclasses.rb +18 -0
  107. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/helper_methods.rb +96 -0
  108. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/shared_examples/adapter.rb +105 -0
  109. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/shared_examples/params_encoder.rb +18 -0
  110. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/shared_examples/request_method.rb +263 -0
  111. data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/streaming_response_checker.rb +35 -0
  112. data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/CHANGELOG.md +54 -0
  113. data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/LICENSE.md +21 -0
  114. data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/README.md +170 -0
  115. data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart/file_part.rb +130 -0
  116. data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart/middleware.rb +134 -0
  117. data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart/param_part.rb +55 -0
  118. data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart/version.rb +16 -0
  119. data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart.rb +26 -0
  120. data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/LICENSE.md +21 -0
  121. data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/README.md +57 -0
  122. data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/lib/faraday/adapter/net_http.rb +206 -0
  123. data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/lib/faraday/net_http/version.rb +7 -0
  124. data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/lib/faraday/net_http.rb +10 -0
  125. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/BSDL +22 -0
  126. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/CHANGES.md +572 -0
  127. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/COPYING +56 -0
  128. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/LEGAL +60 -0
  129. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/README.md +195 -0
  130. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/fbuffer/fbuffer.h +214 -0
  131. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/.sitearchdir.-.json.-.ext.time +0 -0
  132. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/Makefile +269 -0
  133. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/extconf.rb +10 -0
  134. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/generator.bundle +0 -0
  135. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/generator.c +1691 -0
  136. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/generator.o +0 -0
  137. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/.sitearchdir.-.json.-.ext.time +0 -0
  138. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/Makefile +269 -0
  139. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/extconf.rb +12 -0
  140. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/parser.bundle +0 -0
  141. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/parser.c +3238 -0
  142. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/parser.o +0 -0
  143. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/parser.rl +1465 -0
  144. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/json.gemspec +64 -0
  145. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/bigdecimal.rb +58 -0
  146. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/complex.rb +51 -0
  147. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/core.rb +12 -0
  148. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/date.rb +54 -0
  149. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/date_time.rb +67 -0
  150. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/exception.rb +49 -0
  151. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/ostruct.rb +54 -0
  152. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/range.rb +54 -0
  153. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/rational.rb +49 -0
  154. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/regexp.rb +48 -0
  155. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/set.rb +48 -0
  156. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/struct.rb +52 -0
  157. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/symbol.rb +47 -0
  158. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/time.rb +52 -0
  159. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/common.rb +896 -0
  160. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/ext/generator/state.rb +116 -0
  161. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/ext/generator.bundle +0 -0
  162. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/ext/parser.bundle +0 -0
  163. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/ext.rb +23 -0
  164. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/generic_object.rb +75 -0
  165. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/truffle_ruby/generator.rb +629 -0
  166. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/version.rb +5 -0
  167. data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json.rb +587 -0
  168. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/.github/dependabot.yml +6 -0
  169. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/.github/workflows/push_gem.yml +46 -0
  170. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/.github/workflows/test.yml +32 -0
  171. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/.gitignore +11 -0
  172. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/BSDL +22 -0
  173. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/COPYING +56 -0
  174. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/Gemfile +10 -0
  175. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/README.md +104 -0
  176. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/Rakefile +30 -0
  177. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/bin/console +14 -0
  178. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/bin/setup +8 -0
  179. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/errors.rb +9 -0
  180. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/formatter.rb +36 -0
  181. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/log_device.rb +241 -0
  182. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/period.rb +47 -0
  183. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/severity.rb +38 -0
  184. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/version.rb +5 -0
  185. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger.rb +761 -0
  186. data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/logger.gemspec +28 -0
  187. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/changelog.md +14 -0
  188. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/composite_io.rb +17 -0
  189. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/composite_read_io.rb +91 -0
  190. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/multipartable.rb +70 -0
  191. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/parts.rb +148 -0
  192. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/upload_io.rb +64 -0
  193. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/version.rb +11 -0
  194. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post.rb +8 -0
  195. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart_post.rb +11 -0
  196. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipartable.rb +19 -0
  197. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/net/http/post/multipart.rb +28 -0
  198. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/parts.rb +25 -0
  199. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/license.md +58 -0
  200. data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/readme.md +170 -0
  201. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/BSDL +22 -0
  202. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/COPYING +56 -0
  203. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/Gemfile +8 -0
  204. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/README.md +93 -0
  205. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/Rakefile +10 -0
  206. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/bin/console +14 -0
  207. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/bin/setup +8 -0
  208. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/doc/net-http/examples.rdoc +31 -0
  209. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/doc/net-http/included_getters.rdoc +3 -0
  210. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/exceptions.rb +34 -0
  211. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/generic_request.rb +414 -0
  212. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/header.rb +981 -0
  213. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/proxy_delta.rb +17 -0
  214. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/request.rb +88 -0
  215. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/requests.rb +430 -0
  216. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/response.rb +738 -0
  217. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/responses.rb +1174 -0
  218. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/status.rb +84 -0
  219. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http.rb +2580 -0
  220. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/https.rb +23 -0
  221. data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/net-http.gemspec +39 -0
  222. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/.github/dependabot.yml +6 -0
  223. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/.github/workflows/ci.yml +46 -0
  224. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/.gitignore +9 -0
  225. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/BSDL +22 -0
  226. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/COPYING +57 -0
  227. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/Gemfile +19 -0
  228. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/LEGAL +4 -0
  229. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/README.md +98 -0
  230. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/Rakefile +59 -0
  231. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/colorize.rb +7 -0
  232. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/configuration.rb +46 -0
  233. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/context.rb +233 -0
  234. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/enable_tracepoint_events.rb +62 -0
  235. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/inspector.rb +66 -0
  236. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/parser.rb +251 -0
  237. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/version.rb +3 -0
  238. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert.rb +93 -0
  239. data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/power_assert.gemspec +24 -0
  240. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/History.rdoc +2403 -0
  241. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
  242. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/README.rdoc +155 -0
  243. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/command_line_usage.rdoc +158 -0
  244. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/Rakefile1 +38 -0
  245. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/Rakefile2 +35 -0
  246. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/a.c +6 -0
  247. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/b.c +6 -0
  248. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/main.c +11 -0
  249. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/glossary.rdoc +42 -0
  250. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/jamis.rb +592 -0
  251. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/proto_rake.rdoc +127 -0
  252. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/rake.1 +156 -0
  253. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/rakefile.rdoc +622 -0
  254. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/rational.rdoc +151 -0
  255. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/exe/rake +27 -0
  256. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/application.rb +861 -0
  257. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/backtrace.rb +25 -0
  258. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/clean.rb +78 -0
  259. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/cloneable.rb +17 -0
  260. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/cpu_counter.rb +107 -0
  261. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/default_loader.rb +15 -0
  262. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/dsl_definition.rb +196 -0
  263. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/early_time.rb +22 -0
  264. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/ext/core.rb +26 -0
  265. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/ext/string.rb +176 -0
  266. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_creation_task.rb +25 -0
  267. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_list.rb +435 -0
  268. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_task.rb +58 -0
  269. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_utils.rb +132 -0
  270. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_utils_ext.rb +134 -0
  271. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/invocation_chain.rb +57 -0
  272. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/invocation_exception_mixin.rb +17 -0
  273. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/late_time.rb +18 -0
  274. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/linked_list.rb +112 -0
  275. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/loaders/makefile.rb +54 -0
  276. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/multi_task.rb +14 -0
  277. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/name_space.rb +38 -0
  278. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/packagetask.rb +222 -0
  279. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/phony.rb +16 -0
  280. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/private_reader.rb +21 -0
  281. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/promise.rb +100 -0
  282. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/pseudo_status.rb +30 -0
  283. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/rake_module.rb +67 -0
  284. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb +27 -0
  285. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/rule_recursion_overflow_error.rb +20 -0
  286. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/scope.rb +43 -0
  287. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/task.rb +434 -0
  288. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/task_argument_error.rb +8 -0
  289. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/task_arguments.rb +109 -0
  290. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/task_manager.rb +331 -0
  291. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/tasklib.rb +12 -0
  292. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/testtask.rb +189 -0
  293. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/thread_history_display.rb +49 -0
  294. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/thread_pool.rb +163 -0
  295. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/trace_output.rb +23 -0
  296. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/version.rb +10 -0
  297. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/win32.rb +51 -0
  298. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake.rb +70 -0
  299. data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/rake.gemspec +101 -0
  300. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.circleci/config.yml +46 -0
  301. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.devcontainer/Dockerfile +16 -0
  302. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.devcontainer/devcontainer.json +36 -0
  303. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.devcontainer/docker-compose.yml +19 -0
  304. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.github/FUNDING.yml +13 -0
  305. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  306. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  307. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.github/dependabot.yml +15 -0
  308. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.gitignore +69 -0
  309. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.rspec +3 -0
  310. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.rubocop.yml +31 -0
  311. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/CHANGELOG.md +467 -0
  312. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/CODE_OF_CONDUCT.md +74 -0
  313. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/CONTRIBUTING.md +3 -0
  314. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/Gemfile +12 -0
  315. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/Gemfile.lock +92 -0
  316. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/LICENSE.txt +21 -0
  317. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/README.md +1381 -0
  318. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/Rakefile +19 -0
  319. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/bin/console +14 -0
  320. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/bin/setup +8 -0
  321. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/assistants.rb +29 -0
  322. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/audio.rb +19 -0
  323. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/batches.rb +23 -0
  324. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/client.rb +122 -0
  325. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/compatibility.rb +10 -0
  326. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/files.rb +75 -0
  327. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/finetunes.rb +27 -0
  328. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/http.rb +134 -0
  329. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/http_headers.rb +36 -0
  330. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/images.rb +27 -0
  331. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/messages.rb +27 -0
  332. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/models.rb +15 -0
  333. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/run_steps.rb +15 -0
  334. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/runs.rb +37 -0
  335. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/threads.rb +23 -0
  336. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/vector_store_file_batches.rb +29 -0
  337. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/vector_store_files.rb +23 -0
  338. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/vector_stores.rb +27 -0
  339. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/version.rb +3 -0
  340. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai.rb +92 -0
  341. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/ruby/openai.rb +2 -0
  342. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/pull_request_template.md +5 -0
  343. data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/ruby-openai.gemspec +32 -0
  344. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/BSDL +24 -0
  345. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/COPYING +64 -0
  346. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/PSFL +271 -0
  347. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/README.md +108 -0
  348. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/Rakefile +74 -0
  349. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/doc/text/getting-started.md +246 -0
  350. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/doc/text/how-to.md +90 -0
  351. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/doc/text/news.md +1853 -0
  352. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/assertion-failed-error.rb +60 -0
  353. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/assertions.rb +2541 -0
  354. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/attribute-matcher.rb +26 -0
  355. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/attribute.rb +228 -0
  356. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/auto-runner-loader.rb +17 -0
  357. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/autorunner.rb +629 -0
  358. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/code-snippet-fetcher.rb +58 -0
  359. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/descendant.rb +20 -0
  360. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/dir.rb +110 -0
  361. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/load.rb +201 -0
  362. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/objectspace.rb +35 -0
  363. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/xml.rb +249 -0
  364. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector.rb +104 -0
  365. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/color-scheme.rb +225 -0
  366. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/color.rb +134 -0
  367. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/data-sets.rb +127 -0
  368. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/data.rb +371 -0
  369. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/diff.rb +745 -0
  370. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/error.rb +158 -0
  371. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/exception-handler.rb +82 -0
  372. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/failure.rb +169 -0
  373. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/fault-location-detector.rb +104 -0
  374. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/fixture.rb +304 -0
  375. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/notification.rb +138 -0
  376. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/omission.rb +198 -0
  377. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/pending.rb +155 -0
  378. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/priority.rb +194 -0
  379. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/runner/console.rb +86 -0
  380. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/runner/emacs.rb +8 -0
  381. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/runner/xml.rb +15 -0
  382. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/sub-test-result.rb +59 -0
  383. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/test-suite-creator.rb +103 -0
  384. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/test-suite-runner.rb +128 -0
  385. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/test-suite-thread-runner.rb +69 -0
  386. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/testcase.rb +963 -0
  387. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/testresult.rb +132 -0
  388. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/testsuite.rb +108 -0
  389. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/console/outputlevel.rb +15 -0
  390. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/console/testrunner.rb +891 -0
  391. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/emacs/testrunner.rb +49 -0
  392. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunner.rb +53 -0
  393. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunnermediator.rb +119 -0
  394. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunnerutilities.rb +41 -0
  395. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/xml/testrunner.rb +224 -0
  396. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/backtracefilter.rb +59 -0
  397. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/memory-usage.rb +47 -0
  398. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/method-owner-finder.rb +28 -0
  399. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/observable.rb +86 -0
  400. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/output.rb +32 -0
  401. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/procwrapper.rb +48 -0
  402. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/version.rb +5 -0
  403. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/warning.rb +3 -0
  404. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit.rb +521 -0
  405. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test-unit.rb +19 -0
  406. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/adder.rb +13 -0
  407. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/subtracter.rb +12 -0
  408. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/test_adder.rb +20 -0
  409. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/test_subtracter.rb +20 -0
  410. data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/test_user.rb +23 -0
  411. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/.document +5 -0
  412. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/CONTRIBUTING.md +15 -0
  413. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/LICENSE.md +20 -0
  414. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/README.md +45 -0
  415. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/bin/thor +6 -0
  416. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/create_file.rb +105 -0
  417. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/create_link.rb +61 -0
  418. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/directory.rb +108 -0
  419. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/empty_directory.rb +143 -0
  420. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/file_manipulation.rb +371 -0
  421. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/inject_into_file.rb +130 -0
  422. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions.rb +340 -0
  423. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/base.rb +825 -0
  424. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/command.rb +151 -0
  425. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
  426. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/error.rb +106 -0
  427. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/group.rb +292 -0
  428. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/invocation.rb +178 -0
  429. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/line_editor/basic.rb +37 -0
  430. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/line_editor/readline.rb +88 -0
  431. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/line_editor.rb +17 -0
  432. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/nested_context.rb +29 -0
  433. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser/argument.rb +86 -0
  434. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser/arguments.rb +195 -0
  435. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser/option.rb +178 -0
  436. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser/options.rb +294 -0
  437. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser.rb +4 -0
  438. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/rake_compat.rb +72 -0
  439. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/runner.rb +335 -0
  440. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/basic.rb +388 -0
  441. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/color.rb +115 -0
  442. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/column_printer.rb +29 -0
  443. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/html.rb +84 -0
  444. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/lcs_diff.rb +49 -0
  445. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/table_printer.rb +118 -0
  446. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/terminal.rb +42 -0
  447. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/wrapped_printer.rb +38 -0
  448. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell.rb +81 -0
  449. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/util.rb +285 -0
  450. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/version.rb +3 -0
  451. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor.rb +674 -0
  452. data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/thor.gemspec +33 -0
  453. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/BSDL +22 -0
  454. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/COPYING +56 -0
  455. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/README.md +55 -0
  456. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/common.rb +876 -0
  457. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/file.rb +100 -0
  458. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/ftp.rb +267 -0
  459. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/generic.rb +1578 -0
  460. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/http.rb +125 -0
  461. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/https.rb +23 -0
  462. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/ldap.rb +261 -0
  463. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/ldaps.rb +22 -0
  464. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/mailto.rb +293 -0
  465. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/rfc2396_parser.rb +546 -0
  466. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/rfc3986_parser.rb +206 -0
  467. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/version.rb +6 -0
  468. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/ws.rb +83 -0
  469. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/wss.rb +23 -0
  470. data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri.rb +104 -0
  471. data/vendor/bundle/ruby/3.1.0/specifications/event_stream_parser-1.0.0.gemspec +23 -0
  472. data/vendor/bundle/ruby/3.1.0/specifications/faraday-2.12.2.gemspec +0 -0
  473. data/vendor/bundle/ruby/3.1.0/specifications/faraday-multipart-1.1.0.gemspec +32 -0
  474. data/vendor/bundle/ruby/3.1.0/specifications/faraday-net_http-3.4.0.gemspec +32 -0
  475. data/vendor/bundle/ruby/3.1.0/specifications/json-2.9.1.gemspec +0 -0
  476. data/vendor/bundle/ruby/3.1.0/specifications/logger-1.6.5.gemspec +22 -0
  477. data/vendor/bundle/ruby/3.1.0/specifications/multipart-post-2.4.1.gemspec +21 -0
  478. data/vendor/bundle/ruby/3.1.0/specifications/net-http-0.6.0.gemspec +33 -0
  479. data/vendor/bundle/ruby/3.1.0/specifications/power_assert-2.0.5.gemspec +24 -0
  480. data/vendor/bundle/ruby/3.1.0/specifications/rake-13.2.1.gemspec +26 -0
  481. data/vendor/bundle/ruby/3.1.0/specifications/ruby-openai-7.3.1.gemspec +36 -0
  482. data/vendor/bundle/ruby/3.1.0/specifications/test-unit-3.6.7.gemspec +31 -0
  483. data/vendor/bundle/ruby/3.1.0/specifications/thor-1.3.2.gemspec +34 -0
  484. data/vendor/bundle/ruby/3.1.0/specifications/uri-1.0.2.gemspec +23 -0
  485. metadata +560 -0
@@ -0,0 +1,825 @@
1
+ require_relative "command"
2
+ require_relative "core_ext/hash_with_indifferent_access"
3
+ require_relative "error"
4
+ require_relative "invocation"
5
+ require_relative "nested_context"
6
+ require_relative "parser"
7
+ require_relative "shell"
8
+ require_relative "line_editor"
9
+ require_relative "util"
10
+
11
+ class Thor
12
+ autoload :Actions, File.expand_path("actions", __dir__)
13
+ autoload :RakeCompat, File.expand_path("rake_compat", __dir__)
14
+ autoload :Group, File.expand_path("group", __dir__)
15
+
16
+ # Shortcuts for help.
17
+ HELP_MAPPINGS = %w(-h -? --help -D)
18
+
19
+ # Thor methods that should not be overwritten by the user.
20
+ THOR_RESERVED_WORDS = %w(invoke shell options behavior root destination_root relative_root
21
+ action add_file create_file in_root inside run run_ruby_script)
22
+
23
+ TEMPLATE_EXTNAME = ".tt"
24
+
25
+ class << self
26
+ def deprecation_warning(message) #:nodoc:
27
+ unless ENV["THOR_SILENCE_DEPRECATION"]
28
+ warn "Deprecation warning: #{message}\n" +
29
+ "You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION."
30
+ end
31
+ end
32
+ end
33
+
34
+ module Base
35
+ attr_accessor :options, :parent_options, :args
36
+
37
+ # It receives arguments in an Array and two hashes, one for options and
38
+ # other for configuration.
39
+ #
40
+ # Notice that it does not check if all required arguments were supplied.
41
+ # It should be done by the parser.
42
+ #
43
+ # ==== Parameters
44
+ # args<Array[Object]>:: An array of objects. The objects are applied to their
45
+ # respective accessors declared with <tt>argument</tt>.
46
+ #
47
+ # options<Hash>:: An options hash that will be available as self.options.
48
+ # The hash given is converted to a hash with indifferent
49
+ # access, magic predicates (options.skip?) and then frozen.
50
+ #
51
+ # config<Hash>:: Configuration for this Thor class.
52
+ #
53
+ def initialize(args = [], local_options = {}, config = {})
54
+ parse_options = self.class.class_options
55
+
56
+ # The start method splits inbound arguments at the first argument
57
+ # that looks like an option (starts with - or --). It then calls
58
+ # new, passing in the two halves of the arguments Array as the
59
+ # first two parameters.
60
+
61
+ command_options = config.delete(:command_options) # hook for start
62
+ parse_options = parse_options.merge(command_options) if command_options
63
+
64
+ if local_options.is_a?(Array)
65
+ array_options = local_options
66
+ hash_options = {}
67
+ else
68
+ # Handle the case where the class was explicitly instantiated
69
+ # with pre-parsed options.
70
+ array_options = []
71
+ hash_options = local_options
72
+ end
73
+
74
+ # Let Thor::Options parse the options first, so it can remove
75
+ # declared options from the array. This will leave us with
76
+ # a list of arguments that weren't declared.
77
+ current_command = config[:current_command]
78
+ stop_on_unknown = self.class.stop_on_unknown_option? current_command
79
+
80
+ # Give a relation of options.
81
+ # After parsing, Thor::Options check whether right relations are kept
82
+ relations = if current_command.nil?
83
+ {exclusive_option_names: [], at_least_one_option_names: []}
84
+ else
85
+ current_command.options_relation
86
+ end
87
+
88
+ self.class.class_exclusive_option_names.map { |n| relations[:exclusive_option_names] << n }
89
+ self.class.class_at_least_one_option_names.map { |n| relations[:at_least_one_option_names] << n }
90
+
91
+ disable_required_check = self.class.disable_required_check? current_command
92
+
93
+ opts = Thor::Options.new(parse_options, hash_options, stop_on_unknown, disable_required_check, relations)
94
+
95
+ self.options = opts.parse(array_options)
96
+ self.options = config[:class_options].merge(options) if config[:class_options]
97
+
98
+ # If unknown options are disallowed, make sure that none of the
99
+ # remaining arguments looks like an option.
100
+ opts.check_unknown! if self.class.check_unknown_options?(config)
101
+
102
+ # Add the remaining arguments from the options parser to the
103
+ # arguments passed in to initialize. Then remove any positional
104
+ # arguments declared using #argument (this is primarily used
105
+ # by Thor::Group). Tis will leave us with the remaining
106
+ # positional arguments.
107
+ to_parse = args
108
+ to_parse += opts.remaining unless self.class.strict_args_position?(config)
109
+
110
+ thor_args = Thor::Arguments.new(self.class.arguments)
111
+ thor_args.parse(to_parse).each { |k, v| __send__("#{k}=", v) }
112
+ @args = thor_args.remaining
113
+ end
114
+
115
+ class << self
116
+ def included(base) #:nodoc:
117
+ super(base)
118
+ base.extend ClassMethods
119
+ base.send :include, Invocation
120
+ base.send :include, Shell
121
+ end
122
+
123
+ # Returns the classes that inherits from Thor or Thor::Group.
124
+ #
125
+ # ==== Returns
126
+ # Array[Class]
127
+ #
128
+ def subclasses
129
+ @subclasses ||= []
130
+ end
131
+
132
+ # Returns the files where the subclasses are kept.
133
+ #
134
+ # ==== Returns
135
+ # Hash[path<String> => Class]
136
+ #
137
+ def subclass_files
138
+ @subclass_files ||= Hash.new { |h, k| h[k] = [] }
139
+ end
140
+
141
+ # Whenever a class inherits from Thor or Thor::Group, we should track the
142
+ # class and the file on Thor::Base. This is the method responsible for it.
143
+ #
144
+ def register_klass_file(klass) #:nodoc:
145
+ file = caller[1].match(/(.*):\d+/)[1]
146
+ Thor::Base.subclasses << klass unless Thor::Base.subclasses.include?(klass)
147
+
148
+ file_subclasses = Thor::Base.subclass_files[File.expand_path(file)]
149
+ file_subclasses << klass unless file_subclasses.include?(klass)
150
+ end
151
+ end
152
+
153
+ module ClassMethods
154
+ def attr_reader(*) #:nodoc:
155
+ no_commands { super }
156
+ end
157
+
158
+ def attr_writer(*) #:nodoc:
159
+ no_commands { super }
160
+ end
161
+
162
+ def attr_accessor(*) #:nodoc:
163
+ no_commands { super }
164
+ end
165
+
166
+ # If you want to raise an error for unknown options, call check_unknown_options!
167
+ # This is disabled by default to allow dynamic invocations.
168
+ def check_unknown_options!
169
+ @check_unknown_options = true
170
+ end
171
+
172
+ def check_unknown_options #:nodoc:
173
+ @check_unknown_options ||= from_superclass(:check_unknown_options, false)
174
+ end
175
+
176
+ def check_unknown_options?(config) #:nodoc:
177
+ !!check_unknown_options
178
+ end
179
+
180
+ # If you want to raise an error when the default value of an option does not match
181
+ # the type call check_default_type!
182
+ # This will be the default; for compatibility a deprecation warning is issued if necessary.
183
+ def check_default_type!
184
+ @check_default_type = true
185
+ end
186
+
187
+ # If you want to use defaults that don't match the type of an option,
188
+ # either specify `check_default_type: false` or call `allow_incompatible_default_type!`
189
+ def allow_incompatible_default_type!
190
+ @check_default_type = false
191
+ end
192
+
193
+ def check_default_type #:nodoc:
194
+ @check_default_type = from_superclass(:check_default_type, nil) unless defined?(@check_default_type)
195
+ @check_default_type
196
+ end
197
+
198
+ # If true, option parsing is suspended as soon as an unknown option or a
199
+ # regular argument is encountered. All remaining arguments are passed to
200
+ # the command as regular arguments.
201
+ def stop_on_unknown_option?(command_name) #:nodoc:
202
+ false
203
+ end
204
+
205
+ # If true, option set will not suspend the execution of the command when
206
+ # a required option is not provided.
207
+ def disable_required_check?(command_name) #:nodoc:
208
+ false
209
+ end
210
+
211
+ # If you want only strict string args (useful when cascading thor classes),
212
+ # call strict_args_position! This is disabled by default to allow dynamic
213
+ # invocations.
214
+ def strict_args_position!
215
+ @strict_args_position = true
216
+ end
217
+
218
+ def strict_args_position #:nodoc:
219
+ @strict_args_position ||= from_superclass(:strict_args_position, false)
220
+ end
221
+
222
+ def strict_args_position?(config) #:nodoc:
223
+ !!strict_args_position
224
+ end
225
+
226
+ # Adds an argument to the class and creates an attr_accessor for it.
227
+ #
228
+ # Arguments are different from options in several aspects. The first one
229
+ # is how they are parsed from the command line, arguments are retrieved
230
+ # from position:
231
+ #
232
+ # thor command NAME
233
+ #
234
+ # Instead of:
235
+ #
236
+ # thor command --name=NAME
237
+ #
238
+ # Besides, arguments are used inside your code as an accessor (self.argument),
239
+ # while options are all kept in a hash (self.options).
240
+ #
241
+ # Finally, arguments cannot have type :default or :boolean but can be
242
+ # optional (supplying :optional => :true or :required => false), although
243
+ # you cannot have a required argument after a non-required argument. If you
244
+ # try it, an error is raised.
245
+ #
246
+ # ==== Parameters
247
+ # name<Symbol>:: The name of the argument.
248
+ # options<Hash>:: Described below.
249
+ #
250
+ # ==== Options
251
+ # :desc - Description for the argument.
252
+ # :required - If the argument is required or not.
253
+ # :optional - If the argument is optional or not.
254
+ # :type - The type of the argument, can be :string, :hash, :array, :numeric.
255
+ # :default - Default value for this argument. It cannot be required and have default values.
256
+ # :banner - String to show on usage notes.
257
+ #
258
+ # ==== Errors
259
+ # ArgumentError:: Raised if you supply a required argument after a non required one.
260
+ #
261
+ def argument(name, options = {})
262
+ is_thor_reserved_word?(name, :argument)
263
+ no_commands { attr_accessor name }
264
+
265
+ required = if options.key?(:optional)
266
+ !options[:optional]
267
+ elsif options.key?(:required)
268
+ options[:required]
269
+ else
270
+ options[:default].nil?
271
+ end
272
+
273
+ remove_argument name
274
+
275
+ if required
276
+ arguments.each do |argument|
277
+ next if argument.required?
278
+ raise ArgumentError, "You cannot have #{name.to_s.inspect} as required argument after " \
279
+ "the non-required argument #{argument.human_name.inspect}."
280
+ end
281
+ end
282
+
283
+ options[:required] = required
284
+
285
+ arguments << Thor::Argument.new(name, options)
286
+ end
287
+
288
+ # Returns this class arguments, looking up in the ancestors chain.
289
+ #
290
+ # ==== Returns
291
+ # Array[Thor::Argument]
292
+ #
293
+ def arguments
294
+ @arguments ||= from_superclass(:arguments, [])
295
+ end
296
+
297
+ # Adds a bunch of options to the set of class options.
298
+ #
299
+ # class_options :foo => false, :bar => :required, :baz => :string
300
+ #
301
+ # If you prefer more detailed declaration, check class_option.
302
+ #
303
+ # ==== Parameters
304
+ # Hash[Symbol => Object]
305
+ #
306
+ def class_options(options = nil)
307
+ @class_options ||= from_superclass(:class_options, {})
308
+ build_options(options, @class_options) if options
309
+ @class_options
310
+ end
311
+
312
+ # Adds an option to the set of class options
313
+ #
314
+ # ==== Parameters
315
+ # name<Symbol>:: The name of the argument.
316
+ # options<Hash>:: Described below.
317
+ #
318
+ # ==== Options
319
+ # :desc:: -- Description for the argument.
320
+ # :required:: -- If the argument is required or not.
321
+ # :default:: -- Default value for this argument.
322
+ # :group:: -- The group for this options. Use by class options to output options in different levels.
323
+ # :aliases:: -- Aliases for this option. <b>Note:</b> Thor follows a convention of one-dash-one-letter options. Thus aliases like "-something" wouldn't be parsed; use either "\--something" or "-s" instead.
324
+ # :type:: -- The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
325
+ # :banner:: -- String to show on usage notes.
326
+ # :hide:: -- If you want to hide this option from the help.
327
+ #
328
+ def class_option(name, options = {})
329
+ unless [ Symbol, String ].any? { |klass| name.is_a?(klass) }
330
+ raise ArgumentError, "Expected a Symbol or String, got #{name.inspect}"
331
+ end
332
+ build_option(name, options, class_options)
333
+ end
334
+
335
+ # Adds and declares option group for exclusive options in the
336
+ # block and arguments. You can declare options as the outside of the block.
337
+ #
338
+ # ==== Parameters
339
+ # Array[Thor::Option.name]
340
+ #
341
+ # ==== Examples
342
+ #
343
+ # class_exclusive do
344
+ # class_option :one
345
+ # class_option :two
346
+ # end
347
+ #
348
+ # Or
349
+ #
350
+ # class_option :one
351
+ # class_option :two
352
+ # class_exclusive :one, :two
353
+ #
354
+ # If you give "--one" and "--two" at the same time ExclusiveArgumentsError
355
+ # will be raised.
356
+ #
357
+ def class_exclusive(*args, &block)
358
+ register_options_relation_for(:class_options,
359
+ :class_exclusive_option_names, *args, &block)
360
+ end
361
+
362
+ # Adds and declares option group for required at least one of options in the
363
+ # block and arguments. You can declare options as the outside of the block.
364
+ #
365
+ # ==== Examples
366
+ #
367
+ # class_at_least_one do
368
+ # class_option :one
369
+ # class_option :two
370
+ # end
371
+ #
372
+ # Or
373
+ #
374
+ # class_option :one
375
+ # class_option :two
376
+ # class_at_least_one :one, :two
377
+ #
378
+ # If you do not give "--one" and "--two" AtLeastOneRequiredArgumentError
379
+ # will be raised.
380
+ #
381
+ # You can use class_at_least_one and class_exclusive at the same time.
382
+ #
383
+ # class_exclusive do
384
+ # class_at_least_one do
385
+ # class_option :one
386
+ # class_option :two
387
+ # end
388
+ # end
389
+ #
390
+ # Then it is required either only one of "--one" or "--two".
391
+ #
392
+ def class_at_least_one(*args, &block)
393
+ register_options_relation_for(:class_options,
394
+ :class_at_least_one_option_names, *args, &block)
395
+ end
396
+
397
+ # Returns this class exclusive options array set, looking up in the ancestors chain.
398
+ #
399
+ # ==== Returns
400
+ # Array[Array[Thor::Option.name]]
401
+ #
402
+ def class_exclusive_option_names
403
+ @class_exclusive_option_names ||= from_superclass(:class_exclusive_option_names, [])
404
+ end
405
+
406
+ # Returns this class at least one of required options array set, looking up in the ancestors chain.
407
+ #
408
+ # ==== Returns
409
+ # Array[Array[Thor::Option.name]]
410
+ #
411
+ def class_at_least_one_option_names
412
+ @class_at_least_one_option_names ||= from_superclass(:class_at_least_one_option_names, [])
413
+ end
414
+
415
+ # Removes a previous defined argument. If :undefine is given, undefine
416
+ # accessors as well.
417
+ #
418
+ # ==== Parameters
419
+ # names<Array>:: Arguments to be removed
420
+ #
421
+ # ==== Examples
422
+ #
423
+ # remove_argument :foo
424
+ # remove_argument :foo, :bar, :baz, :undefine => true
425
+ #
426
+ def remove_argument(*names)
427
+ options = names.last.is_a?(Hash) ? names.pop : {}
428
+
429
+ names.each do |name|
430
+ arguments.delete_if { |a| a.name == name.to_s }
431
+ undef_method name, "#{name}=" if options[:undefine]
432
+ end
433
+ end
434
+
435
+ # Removes a previous defined class option.
436
+ #
437
+ # ==== Parameters
438
+ # names<Array>:: Class options to be removed
439
+ #
440
+ # ==== Examples
441
+ #
442
+ # remove_class_option :foo
443
+ # remove_class_option :foo, :bar, :baz
444
+ #
445
+ def remove_class_option(*names)
446
+ names.each do |name|
447
+ class_options.delete(name)
448
+ end
449
+ end
450
+
451
+ # Defines the group. This is used when thor list is invoked so you can specify
452
+ # that only commands from a pre-defined group will be shown. Defaults to standard.
453
+ #
454
+ # ==== Parameters
455
+ # name<String|Symbol>
456
+ #
457
+ def group(name = nil)
458
+ if name
459
+ @group = name.to_s
460
+ else
461
+ @group ||= from_superclass(:group, "standard")
462
+ end
463
+ end
464
+
465
+ # Returns the commands for this Thor class.
466
+ #
467
+ # ==== Returns
468
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
469
+ # objects as values.
470
+ #
471
+ def commands
472
+ @commands ||= Hash.new
473
+ end
474
+ alias_method :tasks, :commands
475
+
476
+ # Returns the commands for this Thor class and all subclasses.
477
+ #
478
+ # ==== Returns
479
+ # Hash:: An ordered hash with commands names as keys and Thor::Command
480
+ # objects as values.
481
+ #
482
+ def all_commands
483
+ @all_commands ||= from_superclass(:all_commands, Hash.new)
484
+ @all_commands.merge!(commands)
485
+ end
486
+ alias_method :all_tasks, :all_commands
487
+
488
+ # Removes a given command from this Thor class. This is usually done if you
489
+ # are inheriting from another class and don't want it to be available
490
+ # anymore.
491
+ #
492
+ # By default it only remove the mapping to the command. But you can supply
493
+ # :undefine => true to undefine the method from the class as well.
494
+ #
495
+ # ==== Parameters
496
+ # name<Symbol|String>:: The name of the command to be removed
497
+ # options<Hash>:: You can give :undefine => true if you want commands the method
498
+ # to be undefined from the class as well.
499
+ #
500
+ def remove_command(*names)
501
+ options = names.last.is_a?(Hash) ? names.pop : {}
502
+
503
+ names.each do |name|
504
+ commands.delete(name.to_s)
505
+ all_commands.delete(name.to_s)
506
+ undef_method name if options[:undefine]
507
+ end
508
+ end
509
+ alias_method :remove_task, :remove_command
510
+
511
+ # All methods defined inside the given block are not added as commands.
512
+ #
513
+ # So you can do:
514
+ #
515
+ # class MyScript < Thor
516
+ # no_commands do
517
+ # def this_is_not_a_command
518
+ # end
519
+ # end
520
+ # end
521
+ #
522
+ # You can also add the method and remove it from the command list:
523
+ #
524
+ # class MyScript < Thor
525
+ # def this_is_not_a_command
526
+ # end
527
+ # remove_command :this_is_not_a_command
528
+ # end
529
+ #
530
+ def no_commands(&block)
531
+ no_commands_context.enter(&block)
532
+ end
533
+
534
+ alias_method :no_tasks, :no_commands
535
+
536
+ def no_commands_context
537
+ @no_commands_context ||= NestedContext.new
538
+ end
539
+
540
+ def no_commands?
541
+ no_commands_context.entered?
542
+ end
543
+
544
+ # Sets the namespace for the Thor or Thor::Group class. By default the
545
+ # namespace is retrieved from the class name. If your Thor class is named
546
+ # Scripts::MyScript, the help method, for example, will be called as:
547
+ #
548
+ # thor scripts:my_script -h
549
+ #
550
+ # If you change the namespace:
551
+ #
552
+ # namespace :my_scripts
553
+ #
554
+ # You change how your commands are invoked:
555
+ #
556
+ # thor my_scripts -h
557
+ #
558
+ # Finally, if you change your namespace to default:
559
+ #
560
+ # namespace :default
561
+ #
562
+ # Your commands can be invoked with a shortcut. Instead of:
563
+ #
564
+ # thor :my_command
565
+ #
566
+ def namespace(name = nil)
567
+ if name
568
+ @namespace = name.to_s
569
+ else
570
+ @namespace ||= Thor::Util.namespace_from_thor_class(self)
571
+ end
572
+ end
573
+
574
+ # Parses the command and options from the given args, instantiate the class
575
+ # and invoke the command. This method is used when the arguments must be parsed
576
+ # from an array. If you are inside Ruby and want to use a Thor class, you
577
+ # can simply initialize it:
578
+ #
579
+ # script = MyScript.new(args, options, config)
580
+ # script.invoke(:command, first_arg, second_arg, third_arg)
581
+ #
582
+ def start(given_args = ARGV, config = {})
583
+ config[:shell] ||= Thor::Base.shell.new
584
+ dispatch(nil, given_args.dup, nil, config)
585
+ rescue Thor::Error => e
586
+ config[:debug] || ENV["THOR_DEBUG"] == "1" ? (raise e) : config[:shell].error(e.message)
587
+ exit(false) if exit_on_failure?
588
+ rescue Errno::EPIPE
589
+ # This happens if a thor command is piped to something like `head`,
590
+ # which closes the pipe when it's done reading. This will also
591
+ # mean that if the pipe is closed, further unnecessary
592
+ # computation will not occur.
593
+ exit(true)
594
+ end
595
+
596
+ # Allows to use private methods from parent in child classes as commands.
597
+ #
598
+ # ==== Parameters
599
+ # names<Array>:: Method names to be used as commands
600
+ #
601
+ # ==== Examples
602
+ #
603
+ # public_command :foo
604
+ # public_command :foo, :bar, :baz
605
+ #
606
+ def public_command(*names)
607
+ names.each do |name|
608
+ class_eval "def #{name}(*); super end", __FILE__, __LINE__
609
+ end
610
+ end
611
+ alias_method :public_task, :public_command
612
+
613
+ def handle_no_command_error(command, has_namespace = $thor_runner) #:nodoc:
614
+ raise UndefinedCommandError.new(command, all_commands.keys, (namespace if has_namespace))
615
+ end
616
+ alias_method :handle_no_task_error, :handle_no_command_error
617
+
618
+ def handle_argument_error(command, error, args, arity) #:nodoc:
619
+ name = [command.ancestor_name, command.name].compact.join(" ")
620
+ msg = "ERROR: \"#{basename} #{name}\" was called with ".dup
621
+ msg << "no arguments" if args.empty?
622
+ msg << "arguments " << args.inspect unless args.empty?
623
+ msg << "\nUsage: \"#{banner(command).split("\n").join("\"\n \"")}\""
624
+ raise InvocationError, msg
625
+ end
626
+
627
+ # A flag that makes the process exit with status 1 if any error happens.
628
+ def exit_on_failure?
629
+ Thor.deprecation_warning "Thor exit with status 0 on errors. To keep this behavior, you must define `exit_on_failure?` in `#{self.name}`"
630
+ false
631
+ end
632
+
633
+ protected
634
+
635
+ # Prints the class options per group. If an option does not belong to
636
+ # any group, it's printed as Class option.
637
+ #
638
+ def class_options_help(shell, groups = {}) #:nodoc:
639
+ # Group options by group
640
+ class_options.each do |_, value|
641
+ groups[value.group] ||= []
642
+ groups[value.group] << value
643
+ end
644
+
645
+ # Deal with default group
646
+ global_options = groups.delete(nil) || []
647
+ print_options(shell, global_options)
648
+
649
+ # Print all others
650
+ groups.each do |group_name, options|
651
+ print_options(shell, options, group_name)
652
+ end
653
+ end
654
+
655
+ # Receives a set of options and print them.
656
+ def print_options(shell, options, group_name = nil)
657
+ return if options.empty?
658
+
659
+ list = []
660
+ padding = options.map { |o| o.aliases_for_usage.size }.max.to_i
661
+ options.each do |option|
662
+ next if option.hide
663
+ item = [option.usage(padding)]
664
+ item.push(option.description ? "# #{option.description}" : "")
665
+
666
+ list << item
667
+ list << ["", "# Default: #{option.print_default}"] if option.show_default?
668
+ list << ["", "# Possible values: #{option.enum_to_s}"] if option.enum
669
+ end
670
+
671
+ shell.say(group_name ? "#{group_name} options:" : "Options:")
672
+ shell.print_table(list, indent: 2)
673
+ shell.say ""
674
+ end
675
+
676
+ # Raises an error if the word given is a Thor reserved word.
677
+ def is_thor_reserved_word?(word, type) #:nodoc:
678
+ return false unless THOR_RESERVED_WORDS.include?(word.to_s)
679
+ raise "#{word.inspect} is a Thor reserved word and cannot be defined as #{type}"
680
+ end
681
+
682
+ # Build an option and adds it to the given scope.
683
+ #
684
+ # ==== Parameters
685
+ # name<Symbol>:: The name of the argument.
686
+ # options<Hash>:: Described in both class_option and method_option.
687
+ # scope<Hash>:: Options hash that is being built up
688
+ def build_option(name, options, scope) #:nodoc:
689
+ scope[name] = Thor::Option.new(name, {check_default_type: check_default_type}.merge!(options))
690
+ end
691
+
692
+ # Receives a hash of options, parse them and add to the scope. This is a
693
+ # fast way to set a bunch of options:
694
+ #
695
+ # build_options :foo => true, :bar => :required, :baz => :string
696
+ #
697
+ # ==== Parameters
698
+ # Hash[Symbol => Object]
699
+ def build_options(options, scope) #:nodoc:
700
+ options.each do |key, value|
701
+ scope[key] = Thor::Option.parse(key, value)
702
+ end
703
+ end
704
+
705
+ # Finds a command with the given name. If the command belongs to the current
706
+ # class, just return it, otherwise dup it and add the fresh copy to the
707
+ # current command hash.
708
+ def find_and_refresh_command(name) #:nodoc:
709
+ if commands[name.to_s]
710
+ commands[name.to_s]
711
+ elsif command = all_commands[name.to_s] # rubocop:disable Lint/AssignmentInCondition
712
+ commands[name.to_s] = command.clone
713
+ else
714
+ raise ArgumentError, "You supplied :for => #{name.inspect}, but the command #{name.inspect} could not be found."
715
+ end
716
+ end
717
+ alias_method :find_and_refresh_task, :find_and_refresh_command
718
+
719
+ # Every time someone inherits from a Thor class, register the klass
720
+ # and file into baseclass.
721
+ def inherited(klass)
722
+ super(klass)
723
+ Thor::Base.register_klass_file(klass)
724
+ klass.instance_variable_set(:@no_commands, 0)
725
+ end
726
+
727
+ # Fire this callback whenever a method is added. Added methods are
728
+ # tracked as commands by invoking the create_command method.
729
+ def method_added(meth)
730
+ super(meth)
731
+ meth = meth.to_s
732
+
733
+ if meth == "initialize"
734
+ initialize_added
735
+ return
736
+ end
737
+
738
+ # Return if it's not a public instance method
739
+ return unless public_method_defined?(meth.to_sym)
740
+
741
+ return if no_commands? || !create_command(meth)
742
+
743
+ is_thor_reserved_word?(meth, :command)
744
+ Thor::Base.register_klass_file(self)
745
+ end
746
+
747
+ # Retrieves a value from superclass. If it reaches the baseclass,
748
+ # returns default.
749
+ def from_superclass(method, default = nil)
750
+ if self == baseclass || !superclass.respond_to?(method, true)
751
+ default
752
+ else
753
+ value = superclass.send(method)
754
+
755
+ # Ruby implements `dup` on Object, but raises a `TypeError`
756
+ # if the method is called on immediates. As a result, we
757
+ # don't have a good way to check whether dup will succeed
758
+ # without calling it and rescuing the TypeError.
759
+ begin
760
+ value.dup
761
+ rescue TypeError
762
+ value
763
+ end
764
+
765
+ end
766
+ end
767
+
768
+ #
769
+ # The basename of the program invoking the thor class.
770
+ #
771
+ def basename
772
+ File.basename($PROGRAM_NAME).split(" ").first
773
+ end
774
+
775
+ # SIGNATURE: Sets the baseclass. This is where the superclass lookup
776
+ # finishes.
777
+ def baseclass #:nodoc:
778
+ end
779
+
780
+ # SIGNATURE: Creates a new command if valid_command? is true. This method is
781
+ # called when a new method is added to the class.
782
+ def create_command(meth) #:nodoc:
783
+ end
784
+ alias_method :create_task, :create_command
785
+
786
+ # SIGNATURE: Defines behavior when the initialize method is added to the
787
+ # class.
788
+ def initialize_added #:nodoc:
789
+ end
790
+
791
+ # SIGNATURE: The hook invoked by start.
792
+ def dispatch(command, given_args, given_opts, config) #:nodoc:
793
+ raise NotImplementedError
794
+ end
795
+
796
+ # Register a relation of options for target(method_option/class_option)
797
+ # by args and block.
798
+ def register_options_relation_for(target, relation, *args, &block) # :nodoc:
799
+ opt = args.pop if args.last.is_a? Hash
800
+ opt ||= {}
801
+ names = args.map{ |arg| arg.to_s }
802
+ names += built_option_names(target, opt, &block) if block_given?
803
+ command_scope_member(relation, opt) << names
804
+ end
805
+
806
+ # Get target(method_options or class_options) options
807
+ # of before and after by block evaluation.
808
+ def built_option_names(target, opt = {}, &block) # :nodoc:
809
+ before = command_scope_member(target, opt).map{ |k,v| v.name }
810
+ instance_eval(&block)
811
+ after = command_scope_member(target, opt).map{ |k,v| v.name }
812
+ after - before
813
+ end
814
+
815
+ # Get command scope member by name.
816
+ def command_scope_member(name, options = {}) # :nodoc:
817
+ if options[:for]
818
+ find_and_refresh_command(options[:for]).send(name)
819
+ else
820
+ send(name)
821
+ end
822
+ end
823
+ end
824
+ end
825
+ end