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.
- checksums.yaml +7 -0
- data/.bundle/config +2 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +12 -0
- data/exe/es +8 -0
- data/lib/es_cli/cli.rb +247 -0
- data/lib/es_cli/version.rb +5 -0
- data/lib/es_cli.rb +11 -0
- data/readme.org +78 -0
- data/sig/es_cli.rbs +4 -0
- data/vendor/bundle/ruby/3.1.0/bin/rake +29 -0
- data/vendor/bundle/ruby/3.1.0/bin/thor +29 -0
- data/vendor/bundle/ruby/3.1.0/cache/event_stream_parser-1.0.0.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/faraday-2.12.2.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/faraday-multipart-1.1.0.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/faraday-net_http-3.4.0.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/json-2.9.1.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/logger-1.6.5.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/multipart-post-2.4.1.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/net-http-0.6.0.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/power_assert-2.0.5.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/rake-13.2.1.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/ruby-openai-7.3.1.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/test-unit-3.6.7.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/thor-1.3.2.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/cache/uri-1.0.2.gem +0 -0
- data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/gem.build_complete +0 -0
- data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/gem_make.out +22 -0
- data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/json/ext/generator.bundle +0 -0
- data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/json/ext/parser.bundle +0 -0
- data/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-23/3.1.0/json-2.9.1/mkmf.log +208 -0
- data/vendor/bundle/ruby/3.1.0/gems/event_stream_parser-1.0.0/LICENSE.md +21 -0
- data/vendor/bundle/ruby/3.1.0/gems/event_stream_parser-1.0.0/README.md +99 -0
- data/vendor/bundle/ruby/3.1.0/gems/event_stream_parser-1.0.0/lib/event_stream_parser/version.rb +5 -0
- data/vendor/bundle/ruby/3.1.0/gems/event_stream_parser-1.0.0/lib/event_stream_parser.rb +222 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/CHANGELOG.md +574 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/README.md +67 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/Rakefile +12 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/examples/client_spec.rb +119 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/examples/client_test.rb +144 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/adapter/test.rb +311 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/adapter.rb +101 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/adapter_registry.rb +30 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/connection.rb +564 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/encoders/flat_params_encoder.rb +105 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/encoders/nested_params_encoder.rb +183 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/error.rb +165 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/logging/formatter.rb +118 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/methods.rb +6 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/middleware.rb +72 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/middleware_registry.rb +83 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/connection_options.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/env.rb +204 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/proxy_options.rb +36 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/request_options.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options/ssl_options.rb +73 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/options.rb +219 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/parameters.rb +5 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/rack_builder.rb +251 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request/authorization.rb +54 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request/instrumentation.rb +58 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request/json.rb +70 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request/url_encoded.rb +60 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/request.rb +139 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/response/json.rb +74 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/response/logger.rb +37 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/response/raise_error.rb +83 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/response.rb +91 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/utils/headers.rb +150 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/utils/params_hash.rb +61 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/utils.rb +121 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday/version.rb +5 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/lib/faraday.rb +157 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/external_adapters/faraday_specs_setup.rb +14 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/adapter/test_spec.rb +442 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/adapter_registry_spec.rb +28 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/adapter_spec.rb +55 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/connection_spec.rb +808 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/error_spec.rb +93 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/middleware_registry_spec.rb +31 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/middleware_spec.rb +213 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/options/env_spec.rb +76 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/options/options_spec.rb +297 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/options/proxy_options_spec.rb +52 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/options/request_options_spec.rb +19 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/params_encoders/flat_spec.rb +42 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/params_encoders/nested_spec.rb +151 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/rack_builder_spec.rb +317 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request/authorization_spec.rb +118 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request/instrumentation_spec.rb +74 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request/json_spec.rb +199 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request/url_encoded_spec.rb +93 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/request_spec.rb +110 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/response/json_spec.rb +206 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/response/logger_spec.rb +278 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/response/raise_error_spec.rb +275 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/response_spec.rb +77 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/utils/headers_spec.rb +109 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday/utils_spec.rb +119 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/faraday_spec.rb +43 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/spec_helper.rb +133 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/disabling_stub.rb +14 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/fake_safe_buffer.rb +15 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/faraday_middleware_subclasses.rb +18 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/helper_methods.rb +96 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/shared_examples/adapter.rb +105 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/shared_examples/params_encoder.rb +18 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/shared_examples/request_method.rb +263 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-2.12.2/spec/support/streaming_response_checker.rb +35 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/CHANGELOG.md +54 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/LICENSE.md +21 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/README.md +170 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart/file_part.rb +130 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart/middleware.rb +134 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart/param_part.rb +55 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart/version.rb +16 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-multipart-1.1.0/lib/faraday/multipart.rb +26 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/LICENSE.md +21 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/README.md +57 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/lib/faraday/adapter/net_http.rb +206 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/lib/faraday/net_http/version.rb +7 -0
- data/vendor/bundle/ruby/3.1.0/gems/faraday-net_http-3.4.0/lib/faraday/net_http.rb +10 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/BSDL +22 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/CHANGES.md +572 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/COPYING +56 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/LEGAL +60 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/README.md +195 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/fbuffer/fbuffer.h +214 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/.sitearchdir.-.json.-.ext.time +0 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/Makefile +269 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/extconf.rb +10 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/generator.bundle +0 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/generator.c +1691 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/generator/generator.o +0 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/.sitearchdir.-.json.-.ext.time +0 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/Makefile +269 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/extconf.rb +12 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/parser.bundle +0 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/parser.c +3238 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/parser.o +0 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/ext/json/ext/parser/parser.rl +1465 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/json.gemspec +64 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/bigdecimal.rb +58 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/complex.rb +51 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/core.rb +12 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/date.rb +54 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/date_time.rb +67 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/exception.rb +49 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/ostruct.rb +54 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/range.rb +54 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/rational.rb +49 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/regexp.rb +48 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/set.rb +48 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/struct.rb +52 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/symbol.rb +47 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/add/time.rb +52 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/common.rb +896 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/ext/generator/state.rb +116 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/ext/generator.bundle +0 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/ext/parser.bundle +0 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/ext.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/generic_object.rb +75 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/truffle_ruby/generator.rb +629 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json/version.rb +5 -0
- data/vendor/bundle/ruby/3.1.0/gems/json-2.9.1/lib/json.rb +587 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/.github/dependabot.yml +6 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/.github/workflows/push_gem.yml +46 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/.github/workflows/test.yml +32 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/.gitignore +11 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/BSDL +22 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/COPYING +56 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/Gemfile +10 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/README.md +104 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/Rakefile +30 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/bin/console +14 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/bin/setup +8 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/errors.rb +9 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/formatter.rb +36 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/log_device.rb +241 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/period.rb +47 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/severity.rb +38 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger/version.rb +5 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/lib/logger.rb +761 -0
- data/vendor/bundle/ruby/3.1.0/gems/logger-1.6.5/logger.gemspec +28 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/changelog.md +14 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/composite_io.rb +17 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/composite_read_io.rb +91 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/multipartable.rb +70 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/parts.rb +148 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/upload_io.rb +64 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post/version.rb +11 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart/post.rb +8 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipart_post.rb +11 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/multipartable.rb +19 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/net/http/post/multipart.rb +28 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/lib/parts.rb +25 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/license.md +58 -0
- data/vendor/bundle/ruby/3.1.0/gems/multipart-post-2.4.1/readme.md +170 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/BSDL +22 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/COPYING +56 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/Gemfile +8 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/README.md +93 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/Rakefile +10 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/bin/console +14 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/bin/setup +8 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/doc/net-http/examples.rdoc +31 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/doc/net-http/included_getters.rdoc +3 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/exceptions.rb +34 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/generic_request.rb +414 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/header.rb +981 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/proxy_delta.rb +17 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/request.rb +88 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/requests.rb +430 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/response.rb +738 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/responses.rb +1174 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http/status.rb +84 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/http.rb +2580 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/lib/net/https.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/net-http-0.6.0/net-http.gemspec +39 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/.github/dependabot.yml +6 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/.github/workflows/ci.yml +46 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/.gitignore +9 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/BSDL +22 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/COPYING +57 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/Gemfile +19 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/LEGAL +4 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/README.md +98 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/Rakefile +59 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/colorize.rb +7 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/configuration.rb +46 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/context.rb +233 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/enable_tracepoint_events.rb +62 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/inspector.rb +66 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/parser.rb +251 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert/version.rb +3 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/lib/power_assert.rb +93 -0
- data/vendor/bundle/ruby/3.1.0/gems/power_assert-2.0.5/power_assert.gemspec +24 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/History.rdoc +2403 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/README.rdoc +155 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/command_line_usage.rdoc +158 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/glossary.rdoc +42 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/jamis.rb +592 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/rake.1 +156 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/rakefile.rdoc +622 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/exe/rake +27 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/application.rb +861 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/backtrace.rb +25 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/clean.rb +78 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/cloneable.rb +17 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/cpu_counter.rb +107 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/default_loader.rb +15 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/dsl_definition.rb +196 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/early_time.rb +22 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/ext/core.rb +26 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/ext/string.rb +176 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_creation_task.rb +25 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_list.rb +435 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_task.rb +58 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_utils.rb +132 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/file_utils_ext.rb +134 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/invocation_chain.rb +57 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/invocation_exception_mixin.rb +17 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/late_time.rb +18 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/linked_list.rb +112 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/loaders/makefile.rb +54 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/multi_task.rb +14 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/name_space.rb +38 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/packagetask.rb +222 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/phony.rb +16 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/private_reader.rb +21 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/promise.rb +100 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/pseudo_status.rb +30 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/rake_module.rb +67 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb +27 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/scope.rb +43 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/task.rb +434 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/task_argument_error.rb +8 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/task_arguments.rb +109 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/task_manager.rb +331 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/tasklib.rb +12 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/testtask.rb +189 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/thread_history_display.rb +49 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/thread_pool.rb +163 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/trace_output.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/version.rb +10 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake/win32.rb +51 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/lib/rake.rb +70 -0
- data/vendor/bundle/ruby/3.1.0/gems/rake-13.2.1/rake.gemspec +101 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.circleci/config.yml +46 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.devcontainer/Dockerfile +16 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.devcontainer/devcontainer.json +36 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.devcontainer/docker-compose.yml +19 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.github/FUNDING.yml +13 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.github/dependabot.yml +15 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.gitignore +69 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.rspec +3 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/.rubocop.yml +31 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/CHANGELOG.md +467 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/CODE_OF_CONDUCT.md +74 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/CONTRIBUTING.md +3 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/Gemfile +12 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/Gemfile.lock +92 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/LICENSE.txt +21 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/README.md +1381 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/Rakefile +19 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/bin/console +14 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/bin/setup +8 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/assistants.rb +29 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/audio.rb +19 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/batches.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/client.rb +122 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/compatibility.rb +10 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/files.rb +75 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/finetunes.rb +27 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/http.rb +134 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/http_headers.rb +36 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/images.rb +27 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/messages.rb +27 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/models.rb +15 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/run_steps.rb +15 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/runs.rb +37 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/threads.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/vector_store_file_batches.rb +29 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/vector_store_files.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/vector_stores.rb +27 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai/version.rb +3 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/openai.rb +92 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/lib/ruby/openai.rb +2 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/pull_request_template.md +5 -0
- data/vendor/bundle/ruby/3.1.0/gems/ruby-openai-7.3.1/ruby-openai.gemspec +32 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/BSDL +24 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/COPYING +64 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/PSFL +271 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/README.md +108 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/Rakefile +74 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/doc/text/getting-started.md +246 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/doc/text/how-to.md +90 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/doc/text/news.md +1853 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/assertion-failed-error.rb +60 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/assertions.rb +2541 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/attribute-matcher.rb +26 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/attribute.rb +228 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/auto-runner-loader.rb +17 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/autorunner.rb +629 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/code-snippet-fetcher.rb +58 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/descendant.rb +20 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/dir.rb +110 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/load.rb +201 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/objectspace.rb +35 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector/xml.rb +249 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/collector.rb +104 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/color-scheme.rb +225 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/color.rb +134 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/data-sets.rb +127 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/data.rb +371 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/diff.rb +745 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/error.rb +158 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/exception-handler.rb +82 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/failure.rb +169 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/fault-location-detector.rb +104 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/fixture.rb +304 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/notification.rb +138 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/omission.rb +198 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/pending.rb +155 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/priority.rb +194 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/runner/console.rb +86 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/runner/emacs.rb +8 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/runner/xml.rb +15 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/sub-test-result.rb +59 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/test-suite-creator.rb +103 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/test-suite-runner.rb +128 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/test-suite-thread-runner.rb +69 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/testcase.rb +963 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/testresult.rb +132 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/testsuite.rb +108 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/console/outputlevel.rb +15 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/console/testrunner.rb +891 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/emacs/testrunner.rb +49 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunner.rb +53 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunnermediator.rb +119 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunnerutilities.rb +41 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/xml/testrunner.rb +224 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/backtracefilter.rb +59 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/memory-usage.rb +47 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/method-owner-finder.rb +28 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/observable.rb +86 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/output.rb +32 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/util/procwrapper.rb +48 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/version.rb +5 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/warning.rb +3 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit.rb +521 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test-unit.rb +19 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/adder.rb +13 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/subtracter.rb +12 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/test_adder.rb +20 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/test_subtracter.rb +20 -0
- data/vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/sample/test_user.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/.document +5 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/CONTRIBUTING.md +15 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/README.md +45 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/bin/thor +6 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/create_file.rb +105 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/create_link.rb +61 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/directory.rb +108 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/empty_directory.rb +143 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/file_manipulation.rb +371 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions/inject_into_file.rb +130 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/actions.rb +340 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/base.rb +825 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/command.rb +151 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/error.rb +106 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/group.rb +292 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/invocation.rb +178 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/line_editor/basic.rb +37 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/line_editor/readline.rb +88 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/line_editor.rb +17 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/nested_context.rb +29 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser/argument.rb +86 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser/arguments.rb +195 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser/option.rb +178 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser/options.rb +294 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/parser.rb +4 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/rake_compat.rb +72 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/runner.rb +335 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/basic.rb +388 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/color.rb +115 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/column_printer.rb +29 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/html.rb +84 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/lcs_diff.rb +49 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/table_printer.rb +118 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/terminal.rb +42 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell/wrapped_printer.rb +38 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/shell.rb +81 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/util.rb +285 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor/version.rb +3 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/lib/thor.rb +674 -0
- data/vendor/bundle/ruby/3.1.0/gems/thor-1.3.2/thor.gemspec +33 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/BSDL +22 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/COPYING +56 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/README.md +55 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/common.rb +876 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/file.rb +100 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/ftp.rb +267 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/generic.rb +1578 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/http.rb +125 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/https.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/ldap.rb +261 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/ldaps.rb +22 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/mailto.rb +293 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/rfc2396_parser.rb +546 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/rfc3986_parser.rb +206 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/version.rb +6 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/ws.rb +83 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri/wss.rb +23 -0
- data/vendor/bundle/ruby/3.1.0/gems/uri-1.0.2/lib/uri.rb +104 -0
- data/vendor/bundle/ruby/3.1.0/specifications/event_stream_parser-1.0.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.1.0/specifications/faraday-2.12.2.gemspec +0 -0
- data/vendor/bundle/ruby/3.1.0/specifications/faraday-multipart-1.1.0.gemspec +32 -0
- data/vendor/bundle/ruby/3.1.0/specifications/faraday-net_http-3.4.0.gemspec +32 -0
- data/vendor/bundle/ruby/3.1.0/specifications/json-2.9.1.gemspec +0 -0
- data/vendor/bundle/ruby/3.1.0/specifications/logger-1.6.5.gemspec +22 -0
- data/vendor/bundle/ruby/3.1.0/specifications/multipart-post-2.4.1.gemspec +21 -0
- data/vendor/bundle/ruby/3.1.0/specifications/net-http-0.6.0.gemspec +33 -0
- data/vendor/bundle/ruby/3.1.0/specifications/power_assert-2.0.5.gemspec +24 -0
- data/vendor/bundle/ruby/3.1.0/specifications/rake-13.2.1.gemspec +26 -0
- data/vendor/bundle/ruby/3.1.0/specifications/ruby-openai-7.3.1.gemspec +36 -0
- data/vendor/bundle/ruby/3.1.0/specifications/test-unit-3.6.7.gemspec +31 -0
- data/vendor/bundle/ruby/3.1.0/specifications/thor-1.3.2.gemspec +34 -0
- data/vendor/bundle/ruby/3.1.0/specifications/uri-1.0.2.gemspec +23 -0
- metadata +560 -0
@@ -0,0 +1,876 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#--
|
3
|
+
# = uri/common.rb
|
4
|
+
#
|
5
|
+
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
|
+
# License::
|
7
|
+
# You can redistribute it and/or modify it under the same term as Ruby.
|
8
|
+
#
|
9
|
+
# See URI for general documentation
|
10
|
+
#
|
11
|
+
|
12
|
+
require_relative "rfc2396_parser"
|
13
|
+
require_relative "rfc3986_parser"
|
14
|
+
|
15
|
+
module URI
|
16
|
+
RFC2396_PARSER = RFC2396_Parser.new
|
17
|
+
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
|
18
|
+
|
19
|
+
RFC3986_PARSER = RFC3986_Parser.new
|
20
|
+
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
|
21
|
+
|
22
|
+
DEFAULT_PARSER = RFC3986_PARSER
|
23
|
+
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
|
24
|
+
|
25
|
+
def self.parser=(parser = RFC3986_PARSER)
|
26
|
+
remove_const(:Parser) if defined?(::URI::Parser)
|
27
|
+
const_set("Parser", parser.class)
|
28
|
+
|
29
|
+
remove_const(:REGEXP) if defined?(::URI::REGEXP)
|
30
|
+
remove_const(:PATTERN) if defined?(::URI::PATTERN)
|
31
|
+
if Parser == RFC2396_Parser
|
32
|
+
const_set("REGEXP", URI::RFC2396_REGEXP)
|
33
|
+
const_set("PATTERN", URI::RFC2396_REGEXP::PATTERN)
|
34
|
+
end
|
35
|
+
|
36
|
+
Parser.new.regexp.each_pair do |sym, str|
|
37
|
+
remove_const(sym) if const_defined?(sym, false)
|
38
|
+
const_set(sym, str)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
self.parser = RFC3986_PARSER
|
42
|
+
|
43
|
+
def self.const_missing(const)
|
44
|
+
if const == :REGEXP
|
45
|
+
warn "URI::REGEXP is obsolete. Use URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
|
46
|
+
URI::RFC2396_REGEXP
|
47
|
+
elsif value = RFC2396_PARSER.regexp[const]
|
48
|
+
warn "URI::#{const} is obsolete. Use RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE
|
49
|
+
value
|
50
|
+
elsif value = RFC2396_Parser.const_get(const)
|
51
|
+
warn "URI::#{const} is obsolete. Use RFC2396_Parser::#{const} explicitly.", uplevel: 1 if $VERBOSE
|
52
|
+
value
|
53
|
+
else
|
54
|
+
super
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
module Util # :nodoc:
|
59
|
+
def make_components_hash(klass, array_hash)
|
60
|
+
tmp = {}
|
61
|
+
if array_hash.kind_of?(Array) &&
|
62
|
+
array_hash.size == klass.component.size - 1
|
63
|
+
klass.component[1..-1].each_index do |i|
|
64
|
+
begin
|
65
|
+
tmp[klass.component[i + 1]] = array_hash[i].clone
|
66
|
+
rescue TypeError
|
67
|
+
tmp[klass.component[i + 1]] = array_hash[i]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
elsif array_hash.kind_of?(Hash)
|
72
|
+
array_hash.each do |key, value|
|
73
|
+
begin
|
74
|
+
tmp[key] = value.clone
|
75
|
+
rescue TypeError
|
76
|
+
tmp[key] = value
|
77
|
+
end
|
78
|
+
end
|
79
|
+
else
|
80
|
+
raise ArgumentError,
|
81
|
+
"expected Array of or Hash of components of #{klass} (#{klass.component[1..-1].join(', ')})"
|
82
|
+
end
|
83
|
+
tmp[:scheme] = klass.to_s.sub(/\A.*::/, '').downcase
|
84
|
+
|
85
|
+
return tmp
|
86
|
+
end
|
87
|
+
module_function :make_components_hash
|
88
|
+
end
|
89
|
+
|
90
|
+
module Schemes
|
91
|
+
end
|
92
|
+
private_constant :Schemes
|
93
|
+
|
94
|
+
# Registers the given +klass+ as the class to be instantiated
|
95
|
+
# when parsing a \URI with the given +scheme+:
|
96
|
+
#
|
97
|
+
# URI.register_scheme('MS_SEARCH', URI::Generic) # => URI::Generic
|
98
|
+
# URI.scheme_list['MS_SEARCH'] # => URI::Generic
|
99
|
+
#
|
100
|
+
# Note that after calling String#upcase on +scheme+, it must be a valid
|
101
|
+
# constant name.
|
102
|
+
def self.register_scheme(scheme, klass)
|
103
|
+
Schemes.const_set(scheme.to_s.upcase, klass)
|
104
|
+
end
|
105
|
+
|
106
|
+
# Returns a hash of the defined schemes:
|
107
|
+
#
|
108
|
+
# URI.scheme_list
|
109
|
+
# # =>
|
110
|
+
# {"MAILTO"=>URI::MailTo,
|
111
|
+
# "LDAPS"=>URI::LDAPS,
|
112
|
+
# "WS"=>URI::WS,
|
113
|
+
# "HTTP"=>URI::HTTP,
|
114
|
+
# "HTTPS"=>URI::HTTPS,
|
115
|
+
# "LDAP"=>URI::LDAP,
|
116
|
+
# "FILE"=>URI::File,
|
117
|
+
# "FTP"=>URI::FTP}
|
118
|
+
#
|
119
|
+
# Related: URI.register_scheme.
|
120
|
+
def self.scheme_list
|
121
|
+
Schemes.constants.map { |name|
|
122
|
+
[name.to_s.upcase, Schemes.const_get(name)]
|
123
|
+
}.to_h
|
124
|
+
end
|
125
|
+
|
126
|
+
INITIAL_SCHEMES = scheme_list
|
127
|
+
private_constant :INITIAL_SCHEMES
|
128
|
+
Ractor.make_shareable(INITIAL_SCHEMES) if defined?(Ractor)
|
129
|
+
|
130
|
+
# Returns a new object constructed from the given +scheme+, +arguments+,
|
131
|
+
# and +default+:
|
132
|
+
#
|
133
|
+
# - The new object is an instance of <tt>URI.scheme_list[scheme.upcase]</tt>.
|
134
|
+
# - The object is initialized by calling the class initializer
|
135
|
+
# using +scheme+ and +arguments+.
|
136
|
+
# See URI::Generic.new.
|
137
|
+
#
|
138
|
+
# Examples:
|
139
|
+
#
|
140
|
+
# values = ['john.doe', 'www.example.com', '123', nil, '/forum/questions/', nil, 'tag=networking&order=newest', 'top']
|
141
|
+
# URI.for('https', *values)
|
142
|
+
# # => #<URI::HTTPS https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
|
143
|
+
# URI.for('foo', *values, default: URI::HTTP)
|
144
|
+
# # => #<URI::HTTP foo://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
|
145
|
+
#
|
146
|
+
def self.for(scheme, *arguments, default: Generic)
|
147
|
+
const_name = scheme.to_s.upcase
|
148
|
+
|
149
|
+
uri_class = INITIAL_SCHEMES[const_name]
|
150
|
+
uri_class ||= if /\A[A-Z]\w*\z/.match?(const_name) && Schemes.const_defined?(const_name, false)
|
151
|
+
Schemes.const_get(const_name, false)
|
152
|
+
end
|
153
|
+
uri_class ||= default
|
154
|
+
|
155
|
+
return uri_class.new(scheme, *arguments)
|
156
|
+
end
|
157
|
+
|
158
|
+
#
|
159
|
+
# Base class for all URI exceptions.
|
160
|
+
#
|
161
|
+
class Error < StandardError; end
|
162
|
+
#
|
163
|
+
# Not a URI.
|
164
|
+
#
|
165
|
+
class InvalidURIError < Error; end
|
166
|
+
#
|
167
|
+
# Not a URI component.
|
168
|
+
#
|
169
|
+
class InvalidComponentError < Error; end
|
170
|
+
#
|
171
|
+
# URI is valid, bad usage is not.
|
172
|
+
#
|
173
|
+
class BadURIError < Error; end
|
174
|
+
|
175
|
+
# Returns a 9-element array representing the parts of the \URI
|
176
|
+
# formed from the string +uri+;
|
177
|
+
# each array element is a string or +nil+:
|
178
|
+
#
|
179
|
+
# names = %w[scheme userinfo host port registry path opaque query fragment]
|
180
|
+
# values = URI.split('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
|
181
|
+
# names.zip(values)
|
182
|
+
# # =>
|
183
|
+
# [["scheme", "https"],
|
184
|
+
# ["userinfo", "john.doe"],
|
185
|
+
# ["host", "www.example.com"],
|
186
|
+
# ["port", "123"],
|
187
|
+
# ["registry", nil],
|
188
|
+
# ["path", "/forum/questions/"],
|
189
|
+
# ["opaque", nil],
|
190
|
+
# ["query", "tag=networking&order=newest"],
|
191
|
+
# ["fragment", "top"]]
|
192
|
+
#
|
193
|
+
def self.split(uri)
|
194
|
+
DEFAULT_PARSER.split(uri)
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns a new \URI object constructed from the given string +uri+:
|
198
|
+
#
|
199
|
+
# URI.parse('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
|
200
|
+
# # => #<URI::HTTPS https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
|
201
|
+
# URI.parse('http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
|
202
|
+
# # => #<URI::HTTP http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
|
203
|
+
#
|
204
|
+
# It's recommended to first ::escape string +uri+
|
205
|
+
# if it may contain invalid URI characters.
|
206
|
+
#
|
207
|
+
def self.parse(uri)
|
208
|
+
DEFAULT_PARSER.parse(uri)
|
209
|
+
end
|
210
|
+
|
211
|
+
# Merges the given URI strings +str+
|
212
|
+
# per {RFC 2396}[https://www.rfc-editor.org/rfc/rfc2396.html].
|
213
|
+
#
|
214
|
+
# Each string in +str+ is converted to an
|
215
|
+
# {RFC3986 URI}[https://www.rfc-editor.org/rfc/rfc3986.html] before being merged.
|
216
|
+
#
|
217
|
+
# Examples:
|
218
|
+
#
|
219
|
+
# URI.join("http://example.com/","main.rbx")
|
220
|
+
# # => #<URI::HTTP http://example.com/main.rbx>
|
221
|
+
#
|
222
|
+
# URI.join('http://example.com', 'foo')
|
223
|
+
# # => #<URI::HTTP http://example.com/foo>
|
224
|
+
#
|
225
|
+
# URI.join('http://example.com', '/foo', '/bar')
|
226
|
+
# # => #<URI::HTTP http://example.com/bar>
|
227
|
+
#
|
228
|
+
# URI.join('http://example.com', '/foo', 'bar')
|
229
|
+
# # => #<URI::HTTP http://example.com/bar>
|
230
|
+
#
|
231
|
+
# URI.join('http://example.com', '/foo/', 'bar')
|
232
|
+
# # => #<URI::HTTP http://example.com/foo/bar>
|
233
|
+
#
|
234
|
+
def self.join(*str)
|
235
|
+
DEFAULT_PARSER.join(*str)
|
236
|
+
end
|
237
|
+
|
238
|
+
#
|
239
|
+
# == Synopsis
|
240
|
+
#
|
241
|
+
# URI::extract(str[, schemes][,&blk])
|
242
|
+
#
|
243
|
+
# == Args
|
244
|
+
#
|
245
|
+
# +str+::
|
246
|
+
# String to extract URIs from.
|
247
|
+
# +schemes+::
|
248
|
+
# Limit URI matching to specific schemes.
|
249
|
+
#
|
250
|
+
# == Description
|
251
|
+
#
|
252
|
+
# Extracts URIs from a string. If block given, iterates through all matched URIs.
|
253
|
+
# Returns nil if block given or array with matches.
|
254
|
+
#
|
255
|
+
# == Usage
|
256
|
+
#
|
257
|
+
# require "uri"
|
258
|
+
#
|
259
|
+
# URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.")
|
260
|
+
# # => ["http://foo.example.com/bla", "mailto:test@example.com"]
|
261
|
+
#
|
262
|
+
def self.extract(str, schemes = nil, &block) # :nodoc:
|
263
|
+
warn "URI.extract is obsolete", uplevel: 1 if $VERBOSE
|
264
|
+
DEFAULT_PARSER.extract(str, schemes, &block)
|
265
|
+
end
|
266
|
+
|
267
|
+
#
|
268
|
+
# == Synopsis
|
269
|
+
#
|
270
|
+
# URI::regexp([match_schemes])
|
271
|
+
#
|
272
|
+
# == Args
|
273
|
+
#
|
274
|
+
# +match_schemes+::
|
275
|
+
# Array of schemes. If given, resulting regexp matches to URIs
|
276
|
+
# whose scheme is one of the match_schemes.
|
277
|
+
#
|
278
|
+
# == Description
|
279
|
+
#
|
280
|
+
# Returns a Regexp object which matches to URI-like strings.
|
281
|
+
# The Regexp object returned by this method includes arbitrary
|
282
|
+
# number of capture group (parentheses). Never rely on its number.
|
283
|
+
#
|
284
|
+
# == Usage
|
285
|
+
#
|
286
|
+
# require 'uri'
|
287
|
+
#
|
288
|
+
# # extract first URI from html_string
|
289
|
+
# html_string.slice(URI.regexp)
|
290
|
+
#
|
291
|
+
# # remove ftp URIs
|
292
|
+
# html_string.sub(URI.regexp(['ftp']), '')
|
293
|
+
#
|
294
|
+
# # You should not rely on the number of parentheses
|
295
|
+
# html_string.scan(URI.regexp) do |*matches|
|
296
|
+
# p $&
|
297
|
+
# end
|
298
|
+
#
|
299
|
+
def self.regexp(schemes = nil)# :nodoc:
|
300
|
+
warn "URI.regexp is obsolete", uplevel: 1 if $VERBOSE
|
301
|
+
DEFAULT_PARSER.make_regexp(schemes)
|
302
|
+
end
|
303
|
+
|
304
|
+
TBLENCWWWCOMP_ = {} # :nodoc:
|
305
|
+
256.times do |i|
|
306
|
+
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
|
307
|
+
end
|
308
|
+
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
|
309
|
+
TBLENCWWWCOMP_[' '] = '+'
|
310
|
+
TBLENCWWWCOMP_.freeze
|
311
|
+
TBLDECWWWCOMP_ = {} # :nodoc:
|
312
|
+
256.times do |i|
|
313
|
+
h, l = i>>4, i&15
|
314
|
+
TBLDECWWWCOMP_[-('%%%X%X' % [h, l])] = -i.chr
|
315
|
+
TBLDECWWWCOMP_[-('%%%x%X' % [h, l])] = -i.chr
|
316
|
+
TBLDECWWWCOMP_[-('%%%X%x' % [h, l])] = -i.chr
|
317
|
+
TBLDECWWWCOMP_[-('%%%x%x' % [h, l])] = -i.chr
|
318
|
+
end
|
319
|
+
TBLDECWWWCOMP_['+'] = ' '
|
320
|
+
TBLDECWWWCOMP_.freeze
|
321
|
+
|
322
|
+
# Returns a URL-encoded string derived from the given string +str+.
|
323
|
+
#
|
324
|
+
# The returned string:
|
325
|
+
#
|
326
|
+
# - Preserves:
|
327
|
+
#
|
328
|
+
# - Characters <tt>'*'</tt>, <tt>'.'</tt>, <tt>'-'</tt>, and <tt>'_'</tt>.
|
329
|
+
# - Character in ranges <tt>'a'..'z'</tt>, <tt>'A'..'Z'</tt>,
|
330
|
+
# and <tt>'0'..'9'</tt>.
|
331
|
+
#
|
332
|
+
# Example:
|
333
|
+
#
|
334
|
+
# URI.encode_www_form_component('*.-_azAZ09')
|
335
|
+
# # => "*.-_azAZ09"
|
336
|
+
#
|
337
|
+
# - Converts:
|
338
|
+
#
|
339
|
+
# - Character <tt>' '</tt> to character <tt>'+'</tt>.
|
340
|
+
# - Any other character to "percent notation";
|
341
|
+
# the percent notation for character <i>c</i> is <tt>'%%%X' % c.ord</tt>.
|
342
|
+
#
|
343
|
+
# Example:
|
344
|
+
#
|
345
|
+
# URI.encode_www_form_component('Here are some punctuation characters: ,;?:')
|
346
|
+
# # => "Here+are+some+punctuation+characters%3A+%2C%3B%3F%3A"
|
347
|
+
#
|
348
|
+
# Encoding:
|
349
|
+
#
|
350
|
+
# - If +str+ has encoding Encoding::ASCII_8BIT, argument +enc+ is ignored.
|
351
|
+
# - Otherwise +str+ is converted first to Encoding::UTF_8
|
352
|
+
# (with suitable character replacements),
|
353
|
+
# and then to encoding +enc+.
|
354
|
+
#
|
355
|
+
# In either case, the returned string has forced encoding Encoding::US_ASCII.
|
356
|
+
#
|
357
|
+
# Related: URI.encode_uri_component (encodes <tt>' '</tt> as <tt>'%20'</tt>).
|
358
|
+
def self.encode_www_form_component(str, enc=nil)
|
359
|
+
_encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCWWWCOMP_, str, enc)
|
360
|
+
end
|
361
|
+
|
362
|
+
# Returns a string decoded from the given \URL-encoded string +str+.
|
363
|
+
#
|
364
|
+
# The given string is first encoded as Encoding::ASCII-8BIT (using String#b),
|
365
|
+
# then decoded (as below), and finally force-encoded to the given encoding +enc+.
|
366
|
+
#
|
367
|
+
# The returned string:
|
368
|
+
#
|
369
|
+
# - Preserves:
|
370
|
+
#
|
371
|
+
# - Characters <tt>'*'</tt>, <tt>'.'</tt>, <tt>'-'</tt>, and <tt>'_'</tt>.
|
372
|
+
# - Character in ranges <tt>'a'..'z'</tt>, <tt>'A'..'Z'</tt>,
|
373
|
+
# and <tt>'0'..'9'</tt>.
|
374
|
+
#
|
375
|
+
# Example:
|
376
|
+
#
|
377
|
+
# URI.decode_www_form_component('*.-_azAZ09')
|
378
|
+
# # => "*.-_azAZ09"
|
379
|
+
#
|
380
|
+
# - Converts:
|
381
|
+
#
|
382
|
+
# - Character <tt>'+'</tt> to character <tt>' '</tt>.
|
383
|
+
# - Each "percent notation" to an ASCII character.
|
384
|
+
#
|
385
|
+
# Example:
|
386
|
+
#
|
387
|
+
# URI.decode_www_form_component('Here+are+some+punctuation+characters%3A+%2C%3B%3F%3A')
|
388
|
+
# # => "Here are some punctuation characters: ,;?:"
|
389
|
+
#
|
390
|
+
# Related: URI.decode_uri_component (preserves <tt>'+'</tt>).
|
391
|
+
def self.decode_www_form_component(str, enc=Encoding::UTF_8)
|
392
|
+
_decode_uri_component(/\+|%\h\h/, str, enc)
|
393
|
+
end
|
394
|
+
|
395
|
+
# Like URI.encode_www_form_component, except that <tt>' '</tt> (space)
|
396
|
+
# is encoded as <tt>'%20'</tt> (instead of <tt>'+'</tt>).
|
397
|
+
def self.encode_uri_component(str, enc=nil)
|
398
|
+
_encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCURICOMP_, str, enc)
|
399
|
+
end
|
400
|
+
|
401
|
+
# Like URI.decode_www_form_component, except that <tt>'+'</tt> is preserved.
|
402
|
+
def self.decode_uri_component(str, enc=Encoding::UTF_8)
|
403
|
+
_decode_uri_component(/%\h\h/, str, enc)
|
404
|
+
end
|
405
|
+
|
406
|
+
def self._encode_uri_component(regexp, table, str, enc)
|
407
|
+
str = str.to_s.dup
|
408
|
+
if str.encoding != Encoding::ASCII_8BIT
|
409
|
+
if enc && enc != Encoding::ASCII_8BIT
|
410
|
+
str.encode!(Encoding::UTF_8, invalid: :replace, undef: :replace)
|
411
|
+
str.encode!(enc, fallback: ->(x){"&##{x.ord};"})
|
412
|
+
end
|
413
|
+
str.force_encoding(Encoding::ASCII_8BIT)
|
414
|
+
end
|
415
|
+
str.gsub!(regexp, table)
|
416
|
+
str.force_encoding(Encoding::US_ASCII)
|
417
|
+
end
|
418
|
+
private_class_method :_encode_uri_component
|
419
|
+
|
420
|
+
def self._decode_uri_component(regexp, str, enc)
|
421
|
+
raise ArgumentError, "invalid %-encoding (#{str})" if /%(?!\h\h)/.match?(str)
|
422
|
+
str.b.gsub(regexp, TBLDECWWWCOMP_).force_encoding(enc)
|
423
|
+
end
|
424
|
+
private_class_method :_decode_uri_component
|
425
|
+
|
426
|
+
# Returns a URL-encoded string derived from the given
|
427
|
+
# {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html#module-Enumerable-label-Enumerable+in+Ruby+Classes]
|
428
|
+
# +enum+.
|
429
|
+
#
|
430
|
+
# The result is suitable for use as form data
|
431
|
+
# for an \HTTP request whose <tt>Content-Type</tt> is
|
432
|
+
# <tt>'application/x-www-form-urlencoded'</tt>.
|
433
|
+
#
|
434
|
+
# The returned string consists of the elements of +enum+,
|
435
|
+
# each converted to one or more URL-encoded strings,
|
436
|
+
# and all joined with character <tt>'&'</tt>.
|
437
|
+
#
|
438
|
+
# Simple examples:
|
439
|
+
#
|
440
|
+
# URI.encode_www_form([['foo', 0], ['bar', 1], ['baz', 2]])
|
441
|
+
# # => "foo=0&bar=1&baz=2"
|
442
|
+
# URI.encode_www_form({foo: 0, bar: 1, baz: 2})
|
443
|
+
# # => "foo=0&bar=1&baz=2"
|
444
|
+
#
|
445
|
+
# The returned string is formed using method URI.encode_www_form_component,
|
446
|
+
# which converts certain characters:
|
447
|
+
#
|
448
|
+
# URI.encode_www_form('f#o': '/', 'b-r': '$', 'b z': '@')
|
449
|
+
# # => "f%23o=%2F&b-r=%24&b+z=%40"
|
450
|
+
#
|
451
|
+
# When +enum+ is Array-like, each element +ele+ is converted to a field:
|
452
|
+
#
|
453
|
+
# - If +ele+ is an array of two or more elements,
|
454
|
+
# the field is formed from its first two elements
|
455
|
+
# (and any additional elements are ignored):
|
456
|
+
#
|
457
|
+
# name = URI.encode_www_form_component(ele[0], enc)
|
458
|
+
# value = URI.encode_www_form_component(ele[1], enc)
|
459
|
+
# "#{name}=#{value}"
|
460
|
+
#
|
461
|
+
# Examples:
|
462
|
+
#
|
463
|
+
# URI.encode_www_form([%w[foo bar], %w[baz bat bah]])
|
464
|
+
# # => "foo=bar&baz=bat"
|
465
|
+
# URI.encode_www_form([['foo', 0], ['bar', :baz, 'bat']])
|
466
|
+
# # => "foo=0&bar=baz"
|
467
|
+
#
|
468
|
+
# - If +ele+ is an array of one element,
|
469
|
+
# the field is formed from <tt>ele[0]</tt>:
|
470
|
+
#
|
471
|
+
# URI.encode_www_form_component(ele[0])
|
472
|
+
#
|
473
|
+
# Example:
|
474
|
+
#
|
475
|
+
# URI.encode_www_form([['foo'], [:bar], [0]])
|
476
|
+
# # => "foo&bar&0"
|
477
|
+
#
|
478
|
+
# - Otherwise the field is formed from +ele+:
|
479
|
+
#
|
480
|
+
# URI.encode_www_form_component(ele)
|
481
|
+
#
|
482
|
+
# Example:
|
483
|
+
#
|
484
|
+
# URI.encode_www_form(['foo', :bar, 0])
|
485
|
+
# # => "foo&bar&0"
|
486
|
+
#
|
487
|
+
# The elements of an Array-like +enum+ may be mixture:
|
488
|
+
#
|
489
|
+
# URI.encode_www_form([['foo', 0], ['bar', 1, 2], ['baz'], :bat])
|
490
|
+
# # => "foo=0&bar=1&baz&bat"
|
491
|
+
#
|
492
|
+
# When +enum+ is Hash-like,
|
493
|
+
# each +key+/+value+ pair is converted to one or more fields:
|
494
|
+
#
|
495
|
+
# - If +value+ is
|
496
|
+
# {Array-convertible}[https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html#label-Array-Convertible+Objects],
|
497
|
+
# each element +ele+ in +value+ is paired with +key+ to form a field:
|
498
|
+
#
|
499
|
+
# name = URI.encode_www_form_component(key, enc)
|
500
|
+
# value = URI.encode_www_form_component(ele, enc)
|
501
|
+
# "#{name}=#{value}"
|
502
|
+
#
|
503
|
+
# Example:
|
504
|
+
#
|
505
|
+
# URI.encode_www_form({foo: [:bar, 1], baz: [:bat, :bam, 2]})
|
506
|
+
# # => "foo=bar&foo=1&baz=bat&baz=bam&baz=2"
|
507
|
+
#
|
508
|
+
# - Otherwise, +key+ and +value+ are paired to form a field:
|
509
|
+
#
|
510
|
+
# name = URI.encode_www_form_component(key, enc)
|
511
|
+
# value = URI.encode_www_form_component(value, enc)
|
512
|
+
# "#{name}=#{value}"
|
513
|
+
#
|
514
|
+
# Example:
|
515
|
+
#
|
516
|
+
# URI.encode_www_form({foo: 0, bar: 1, baz: 2})
|
517
|
+
# # => "foo=0&bar=1&baz=2"
|
518
|
+
#
|
519
|
+
# The elements of a Hash-like +enum+ may be mixture:
|
520
|
+
#
|
521
|
+
# URI.encode_www_form({foo: [0, 1], bar: 2})
|
522
|
+
# # => "foo=0&foo=1&bar=2"
|
523
|
+
#
|
524
|
+
def self.encode_www_form(enum, enc=nil)
|
525
|
+
enum.map do |k,v|
|
526
|
+
if v.nil?
|
527
|
+
encode_www_form_component(k, enc)
|
528
|
+
elsif v.respond_to?(:to_ary)
|
529
|
+
v.to_ary.map do |w|
|
530
|
+
str = encode_www_form_component(k, enc)
|
531
|
+
unless w.nil?
|
532
|
+
str << '='
|
533
|
+
str << encode_www_form_component(w, enc)
|
534
|
+
end
|
535
|
+
end.join('&')
|
536
|
+
else
|
537
|
+
str = encode_www_form_component(k, enc)
|
538
|
+
str << '='
|
539
|
+
str << encode_www_form_component(v, enc)
|
540
|
+
end
|
541
|
+
end.join('&')
|
542
|
+
end
|
543
|
+
|
544
|
+
# Returns name/value pairs derived from the given string +str+,
|
545
|
+
# which must be an ASCII string.
|
546
|
+
#
|
547
|
+
# The method may be used to decode the body of Net::HTTPResponse object +res+
|
548
|
+
# for which <tt>res['Content-Type']</tt> is <tt>'application/x-www-form-urlencoded'</tt>.
|
549
|
+
#
|
550
|
+
# The returned data is an array of 2-element subarrays;
|
551
|
+
# each subarray is a name/value pair (both are strings).
|
552
|
+
# Each returned string has encoding +enc+,
|
553
|
+
# and has had invalid characters removed via
|
554
|
+
# {String#scrub}[https://docs.ruby-lang.org/en/master/String.html#method-i-scrub].
|
555
|
+
#
|
556
|
+
# A simple example:
|
557
|
+
#
|
558
|
+
# URI.decode_www_form('foo=0&bar=1&baz')
|
559
|
+
# # => [["foo", "0"], ["bar", "1"], ["baz", ""]]
|
560
|
+
#
|
561
|
+
# The returned strings have certain conversions,
|
562
|
+
# similar to those performed in URI.decode_www_form_component:
|
563
|
+
#
|
564
|
+
# URI.decode_www_form('f%23o=%2F&b-r=%24&b+z=%40')
|
565
|
+
# # => [["f#o", "/"], ["b-r", "$"], ["b z", "@"]]
|
566
|
+
#
|
567
|
+
# The given string may contain consecutive separators:
|
568
|
+
#
|
569
|
+
# URI.decode_www_form('foo=0&&bar=1&&baz=2')
|
570
|
+
# # => [["foo", "0"], ["", ""], ["bar", "1"], ["", ""], ["baz", "2"]]
|
571
|
+
#
|
572
|
+
# A different separator may be specified:
|
573
|
+
#
|
574
|
+
# URI.decode_www_form('foo=0--bar=1--baz', separator: '--')
|
575
|
+
# # => [["foo", "0"], ["bar", "1"], ["baz", ""]]
|
576
|
+
#
|
577
|
+
def self.decode_www_form(str, enc=Encoding::UTF_8, separator: '&', use__charset_: false, isindex: false)
|
578
|
+
raise ArgumentError, "the input of #{self.name}.#{__method__} must be ASCII only string" unless str.ascii_only?
|
579
|
+
ary = []
|
580
|
+
return ary if str.empty?
|
581
|
+
enc = Encoding.find(enc)
|
582
|
+
str.b.each_line(separator) do |string|
|
583
|
+
string.chomp!(separator)
|
584
|
+
key, sep, val = string.partition('=')
|
585
|
+
if isindex
|
586
|
+
if sep.empty?
|
587
|
+
val = key
|
588
|
+
key = +''
|
589
|
+
end
|
590
|
+
isindex = false
|
591
|
+
end
|
592
|
+
|
593
|
+
if use__charset_ and key == '_charset_' and e = get_encoding(val)
|
594
|
+
enc = e
|
595
|
+
use__charset_ = false
|
596
|
+
end
|
597
|
+
|
598
|
+
key.gsub!(/\+|%\h\h/, TBLDECWWWCOMP_)
|
599
|
+
if val
|
600
|
+
val.gsub!(/\+|%\h\h/, TBLDECWWWCOMP_)
|
601
|
+
else
|
602
|
+
val = +''
|
603
|
+
end
|
604
|
+
|
605
|
+
ary << [key, val]
|
606
|
+
end
|
607
|
+
ary.each do |k, v|
|
608
|
+
k.force_encoding(enc)
|
609
|
+
k.scrub!
|
610
|
+
v.force_encoding(enc)
|
611
|
+
v.scrub!
|
612
|
+
end
|
613
|
+
ary
|
614
|
+
end
|
615
|
+
|
616
|
+
private
|
617
|
+
=begin command for WEB_ENCODINGS_
|
618
|
+
curl https://encoding.spec.whatwg.org/encodings.json|
|
619
|
+
ruby -rjson -e 'H={}
|
620
|
+
h={
|
621
|
+
"shift_jis"=>"Windows-31J",
|
622
|
+
"euc-jp"=>"cp51932",
|
623
|
+
"iso-2022-jp"=>"cp50221",
|
624
|
+
"x-mac-cyrillic"=>"macCyrillic",
|
625
|
+
}
|
626
|
+
JSON($<.read).map{|x|x["encodings"]}.flatten.each{|x|
|
627
|
+
Encoding.find(n=h.fetch(n=x["name"].downcase,n))rescue next
|
628
|
+
x["labels"].each{|y|H[y]=n}
|
629
|
+
}
|
630
|
+
puts "{"
|
631
|
+
H.each{|k,v|puts %[ #{k.dump}=>#{v.dump},]}
|
632
|
+
puts "}"
|
633
|
+
'
|
634
|
+
=end
|
635
|
+
WEB_ENCODINGS_ = {
|
636
|
+
"unicode-1-1-utf-8"=>"utf-8",
|
637
|
+
"utf-8"=>"utf-8",
|
638
|
+
"utf8"=>"utf-8",
|
639
|
+
"866"=>"ibm866",
|
640
|
+
"cp866"=>"ibm866",
|
641
|
+
"csibm866"=>"ibm866",
|
642
|
+
"ibm866"=>"ibm866",
|
643
|
+
"csisolatin2"=>"iso-8859-2",
|
644
|
+
"iso-8859-2"=>"iso-8859-2",
|
645
|
+
"iso-ir-101"=>"iso-8859-2",
|
646
|
+
"iso8859-2"=>"iso-8859-2",
|
647
|
+
"iso88592"=>"iso-8859-2",
|
648
|
+
"iso_8859-2"=>"iso-8859-2",
|
649
|
+
"iso_8859-2:1987"=>"iso-8859-2",
|
650
|
+
"l2"=>"iso-8859-2",
|
651
|
+
"latin2"=>"iso-8859-2",
|
652
|
+
"csisolatin3"=>"iso-8859-3",
|
653
|
+
"iso-8859-3"=>"iso-8859-3",
|
654
|
+
"iso-ir-109"=>"iso-8859-3",
|
655
|
+
"iso8859-3"=>"iso-8859-3",
|
656
|
+
"iso88593"=>"iso-8859-3",
|
657
|
+
"iso_8859-3"=>"iso-8859-3",
|
658
|
+
"iso_8859-3:1988"=>"iso-8859-3",
|
659
|
+
"l3"=>"iso-8859-3",
|
660
|
+
"latin3"=>"iso-8859-3",
|
661
|
+
"csisolatin4"=>"iso-8859-4",
|
662
|
+
"iso-8859-4"=>"iso-8859-4",
|
663
|
+
"iso-ir-110"=>"iso-8859-4",
|
664
|
+
"iso8859-4"=>"iso-8859-4",
|
665
|
+
"iso88594"=>"iso-8859-4",
|
666
|
+
"iso_8859-4"=>"iso-8859-4",
|
667
|
+
"iso_8859-4:1988"=>"iso-8859-4",
|
668
|
+
"l4"=>"iso-8859-4",
|
669
|
+
"latin4"=>"iso-8859-4",
|
670
|
+
"csisolatincyrillic"=>"iso-8859-5",
|
671
|
+
"cyrillic"=>"iso-8859-5",
|
672
|
+
"iso-8859-5"=>"iso-8859-5",
|
673
|
+
"iso-ir-144"=>"iso-8859-5",
|
674
|
+
"iso8859-5"=>"iso-8859-5",
|
675
|
+
"iso88595"=>"iso-8859-5",
|
676
|
+
"iso_8859-5"=>"iso-8859-5",
|
677
|
+
"iso_8859-5:1988"=>"iso-8859-5",
|
678
|
+
"arabic"=>"iso-8859-6",
|
679
|
+
"asmo-708"=>"iso-8859-6",
|
680
|
+
"csiso88596e"=>"iso-8859-6",
|
681
|
+
"csiso88596i"=>"iso-8859-6",
|
682
|
+
"csisolatinarabic"=>"iso-8859-6",
|
683
|
+
"ecma-114"=>"iso-8859-6",
|
684
|
+
"iso-8859-6"=>"iso-8859-6",
|
685
|
+
"iso-8859-6-e"=>"iso-8859-6",
|
686
|
+
"iso-8859-6-i"=>"iso-8859-6",
|
687
|
+
"iso-ir-127"=>"iso-8859-6",
|
688
|
+
"iso8859-6"=>"iso-8859-6",
|
689
|
+
"iso88596"=>"iso-8859-6",
|
690
|
+
"iso_8859-6"=>"iso-8859-6",
|
691
|
+
"iso_8859-6:1987"=>"iso-8859-6",
|
692
|
+
"csisolatingreek"=>"iso-8859-7",
|
693
|
+
"ecma-118"=>"iso-8859-7",
|
694
|
+
"elot_928"=>"iso-8859-7",
|
695
|
+
"greek"=>"iso-8859-7",
|
696
|
+
"greek8"=>"iso-8859-7",
|
697
|
+
"iso-8859-7"=>"iso-8859-7",
|
698
|
+
"iso-ir-126"=>"iso-8859-7",
|
699
|
+
"iso8859-7"=>"iso-8859-7",
|
700
|
+
"iso88597"=>"iso-8859-7",
|
701
|
+
"iso_8859-7"=>"iso-8859-7",
|
702
|
+
"iso_8859-7:1987"=>"iso-8859-7",
|
703
|
+
"sun_eu_greek"=>"iso-8859-7",
|
704
|
+
"csiso88598e"=>"iso-8859-8",
|
705
|
+
"csisolatinhebrew"=>"iso-8859-8",
|
706
|
+
"hebrew"=>"iso-8859-8",
|
707
|
+
"iso-8859-8"=>"iso-8859-8",
|
708
|
+
"iso-8859-8-e"=>"iso-8859-8",
|
709
|
+
"iso-ir-138"=>"iso-8859-8",
|
710
|
+
"iso8859-8"=>"iso-8859-8",
|
711
|
+
"iso88598"=>"iso-8859-8",
|
712
|
+
"iso_8859-8"=>"iso-8859-8",
|
713
|
+
"iso_8859-8:1988"=>"iso-8859-8",
|
714
|
+
"visual"=>"iso-8859-8",
|
715
|
+
"csisolatin6"=>"iso-8859-10",
|
716
|
+
"iso-8859-10"=>"iso-8859-10",
|
717
|
+
"iso-ir-157"=>"iso-8859-10",
|
718
|
+
"iso8859-10"=>"iso-8859-10",
|
719
|
+
"iso885910"=>"iso-8859-10",
|
720
|
+
"l6"=>"iso-8859-10",
|
721
|
+
"latin6"=>"iso-8859-10",
|
722
|
+
"iso-8859-13"=>"iso-8859-13",
|
723
|
+
"iso8859-13"=>"iso-8859-13",
|
724
|
+
"iso885913"=>"iso-8859-13",
|
725
|
+
"iso-8859-14"=>"iso-8859-14",
|
726
|
+
"iso8859-14"=>"iso-8859-14",
|
727
|
+
"iso885914"=>"iso-8859-14",
|
728
|
+
"csisolatin9"=>"iso-8859-15",
|
729
|
+
"iso-8859-15"=>"iso-8859-15",
|
730
|
+
"iso8859-15"=>"iso-8859-15",
|
731
|
+
"iso885915"=>"iso-8859-15",
|
732
|
+
"iso_8859-15"=>"iso-8859-15",
|
733
|
+
"l9"=>"iso-8859-15",
|
734
|
+
"iso-8859-16"=>"iso-8859-16",
|
735
|
+
"cskoi8r"=>"koi8-r",
|
736
|
+
"koi"=>"koi8-r",
|
737
|
+
"koi8"=>"koi8-r",
|
738
|
+
"koi8-r"=>"koi8-r",
|
739
|
+
"koi8_r"=>"koi8-r",
|
740
|
+
"koi8-ru"=>"koi8-u",
|
741
|
+
"koi8-u"=>"koi8-u",
|
742
|
+
"dos-874"=>"windows-874",
|
743
|
+
"iso-8859-11"=>"windows-874",
|
744
|
+
"iso8859-11"=>"windows-874",
|
745
|
+
"iso885911"=>"windows-874",
|
746
|
+
"tis-620"=>"windows-874",
|
747
|
+
"windows-874"=>"windows-874",
|
748
|
+
"cp1250"=>"windows-1250",
|
749
|
+
"windows-1250"=>"windows-1250",
|
750
|
+
"x-cp1250"=>"windows-1250",
|
751
|
+
"cp1251"=>"windows-1251",
|
752
|
+
"windows-1251"=>"windows-1251",
|
753
|
+
"x-cp1251"=>"windows-1251",
|
754
|
+
"ansi_x3.4-1968"=>"windows-1252",
|
755
|
+
"ascii"=>"windows-1252",
|
756
|
+
"cp1252"=>"windows-1252",
|
757
|
+
"cp819"=>"windows-1252",
|
758
|
+
"csisolatin1"=>"windows-1252",
|
759
|
+
"ibm819"=>"windows-1252",
|
760
|
+
"iso-8859-1"=>"windows-1252",
|
761
|
+
"iso-ir-100"=>"windows-1252",
|
762
|
+
"iso8859-1"=>"windows-1252",
|
763
|
+
"iso88591"=>"windows-1252",
|
764
|
+
"iso_8859-1"=>"windows-1252",
|
765
|
+
"iso_8859-1:1987"=>"windows-1252",
|
766
|
+
"l1"=>"windows-1252",
|
767
|
+
"latin1"=>"windows-1252",
|
768
|
+
"us-ascii"=>"windows-1252",
|
769
|
+
"windows-1252"=>"windows-1252",
|
770
|
+
"x-cp1252"=>"windows-1252",
|
771
|
+
"cp1253"=>"windows-1253",
|
772
|
+
"windows-1253"=>"windows-1253",
|
773
|
+
"x-cp1253"=>"windows-1253",
|
774
|
+
"cp1254"=>"windows-1254",
|
775
|
+
"csisolatin5"=>"windows-1254",
|
776
|
+
"iso-8859-9"=>"windows-1254",
|
777
|
+
"iso-ir-148"=>"windows-1254",
|
778
|
+
"iso8859-9"=>"windows-1254",
|
779
|
+
"iso88599"=>"windows-1254",
|
780
|
+
"iso_8859-9"=>"windows-1254",
|
781
|
+
"iso_8859-9:1989"=>"windows-1254",
|
782
|
+
"l5"=>"windows-1254",
|
783
|
+
"latin5"=>"windows-1254",
|
784
|
+
"windows-1254"=>"windows-1254",
|
785
|
+
"x-cp1254"=>"windows-1254",
|
786
|
+
"cp1255"=>"windows-1255",
|
787
|
+
"windows-1255"=>"windows-1255",
|
788
|
+
"x-cp1255"=>"windows-1255",
|
789
|
+
"cp1256"=>"windows-1256",
|
790
|
+
"windows-1256"=>"windows-1256",
|
791
|
+
"x-cp1256"=>"windows-1256",
|
792
|
+
"cp1257"=>"windows-1257",
|
793
|
+
"windows-1257"=>"windows-1257",
|
794
|
+
"x-cp1257"=>"windows-1257",
|
795
|
+
"cp1258"=>"windows-1258",
|
796
|
+
"windows-1258"=>"windows-1258",
|
797
|
+
"x-cp1258"=>"windows-1258",
|
798
|
+
"x-mac-cyrillic"=>"macCyrillic",
|
799
|
+
"x-mac-ukrainian"=>"macCyrillic",
|
800
|
+
"chinese"=>"gbk",
|
801
|
+
"csgb2312"=>"gbk",
|
802
|
+
"csiso58gb231280"=>"gbk",
|
803
|
+
"gb2312"=>"gbk",
|
804
|
+
"gb_2312"=>"gbk",
|
805
|
+
"gb_2312-80"=>"gbk",
|
806
|
+
"gbk"=>"gbk",
|
807
|
+
"iso-ir-58"=>"gbk",
|
808
|
+
"x-gbk"=>"gbk",
|
809
|
+
"gb18030"=>"gb18030",
|
810
|
+
"big5"=>"big5",
|
811
|
+
"big5-hkscs"=>"big5",
|
812
|
+
"cn-big5"=>"big5",
|
813
|
+
"csbig5"=>"big5",
|
814
|
+
"x-x-big5"=>"big5",
|
815
|
+
"cseucpkdfmtjapanese"=>"cp51932",
|
816
|
+
"euc-jp"=>"cp51932",
|
817
|
+
"x-euc-jp"=>"cp51932",
|
818
|
+
"csiso2022jp"=>"cp50221",
|
819
|
+
"iso-2022-jp"=>"cp50221",
|
820
|
+
"csshiftjis"=>"Windows-31J",
|
821
|
+
"ms932"=>"Windows-31J",
|
822
|
+
"ms_kanji"=>"Windows-31J",
|
823
|
+
"shift-jis"=>"Windows-31J",
|
824
|
+
"shift_jis"=>"Windows-31J",
|
825
|
+
"sjis"=>"Windows-31J",
|
826
|
+
"windows-31j"=>"Windows-31J",
|
827
|
+
"x-sjis"=>"Windows-31J",
|
828
|
+
"cseuckr"=>"euc-kr",
|
829
|
+
"csksc56011987"=>"euc-kr",
|
830
|
+
"euc-kr"=>"euc-kr",
|
831
|
+
"iso-ir-149"=>"euc-kr",
|
832
|
+
"korean"=>"euc-kr",
|
833
|
+
"ks_c_5601-1987"=>"euc-kr",
|
834
|
+
"ks_c_5601-1989"=>"euc-kr",
|
835
|
+
"ksc5601"=>"euc-kr",
|
836
|
+
"ksc_5601"=>"euc-kr",
|
837
|
+
"windows-949"=>"euc-kr",
|
838
|
+
"utf-16be"=>"utf-16be",
|
839
|
+
"utf-16"=>"utf-16le",
|
840
|
+
"utf-16le"=>"utf-16le",
|
841
|
+
} # :nodoc:
|
842
|
+
Ractor.make_shareable(WEB_ENCODINGS_) if defined?(Ractor)
|
843
|
+
|
844
|
+
# :nodoc:
|
845
|
+
# return encoding or nil
|
846
|
+
# http://encoding.spec.whatwg.org/#concept-encoding-get
|
847
|
+
def self.get_encoding(label)
|
848
|
+
Encoding.find(WEB_ENCODINGS_[label.to_str.strip.downcase]) rescue nil
|
849
|
+
end
|
850
|
+
end # module URI
|
851
|
+
|
852
|
+
module Kernel
|
853
|
+
|
854
|
+
#
|
855
|
+
# Returns a \URI object derived from the given +uri+,
|
856
|
+
# which may be a \URI string or an existing \URI object:
|
857
|
+
#
|
858
|
+
# # Returns a new URI.
|
859
|
+
# uri = URI('http://github.com/ruby/ruby')
|
860
|
+
# # => #<URI::HTTP http://github.com/ruby/ruby>
|
861
|
+
# # Returns the given URI.
|
862
|
+
# URI(uri)
|
863
|
+
# # => #<URI::HTTP http://github.com/ruby/ruby>
|
864
|
+
#
|
865
|
+
def URI(uri)
|
866
|
+
if uri.is_a?(URI::Generic)
|
867
|
+
uri
|
868
|
+
elsif uri = String.try_convert(uri)
|
869
|
+
URI.parse(uri)
|
870
|
+
else
|
871
|
+
raise ArgumentError,
|
872
|
+
"bad argument (expected URI object or URI string)"
|
873
|
+
end
|
874
|
+
end
|
875
|
+
module_function :URI
|
876
|
+
end
|