iron_admin 0.5.0 → 0.6.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 +4 -4
- data/app/assets/config/iron_admin_manifest.js +12 -0
- data/app/components/iron_admin/dashboards/metric_card_component.html.haml +8 -3
- data/app/components/iron_admin/dashboards/metric_card_component.rb +21 -1
- data/app/components/iron_admin/form/belongs_to_component.rb +60 -6
- data/app/components/iron_admin/form/nested_form_component.html.haml +28 -0
- data/app/components/iron_admin/form/nested_form_component.rb +81 -0
- data/app/components/iron_admin/resources/data_table_component.html.haml +1 -1
- data/app/components/iron_admin/resources/data_table_component.rb +6 -0
- data/app/components/iron_admin/resources/show_field_component.rb +2 -0
- data/app/controllers/iron_admin/application_controller.rb +32 -1
- data/app/controllers/iron_admin/concerns/action_executable.rb +44 -0
- data/app/controllers/iron_admin/concerns/filterable.rb +84 -0
- data/app/controllers/iron_admin/concerns/json_params_coercion.rb +67 -0
- data/app/controllers/iron_admin/concerns/nested_permittable.rb +36 -0
- data/app/controllers/iron_admin/concerns/scopeable.rb +84 -0
- data/app/controllers/iron_admin/concerns/searchable.rb +13 -16
- data/app/controllers/iron_admin/exports_controller.rb +15 -11
- data/app/controllers/iron_admin/imports_controller.rb +83 -0
- data/app/controllers/iron_admin/live_controller.rb +12 -0
- data/app/controllers/iron_admin/resources_controller.rb +118 -117
- data/app/controllers/iron_admin/search_controller.rb +5 -5
- data/app/controllers/iron_admin/tools_controller.rb +63 -4
- data/app/helpers/iron_admin/application_helper.rb +33 -14
- data/app/helpers/iron_admin/field_display_helper.rb +160 -1
- data/app/javascript/iron_admin/controllers/cp_nested_form_controller.js +113 -0
- data/app/javascript/iron_admin/controllers/filter_operator_controller.js +10 -0
- data/app/javascript/iron_admin/index.js +4 -0
- data/app/views/iron_admin/dashboard/index.html.haml +7 -2
- data/app/views/iron_admin/form/_nested_row.html.haml +70 -0
- data/app/views/iron_admin/imports/new.html.haml +27 -0
- data/app/views/iron_admin/imports/preview.html.haml +31 -0
- data/app/views/iron_admin/resources/_form.html.haml +81 -5
- data/app/views/iron_admin/resources/action_form.html.haml +62 -0
- data/app/views/iron_admin/resources/bulk_action_form.html.haml +62 -0
- data/app/views/iron_admin/resources/index.html.haml +60 -18
- data/app/views/iron_admin/tools/action_form.html.haml +57 -0
- data/app/views/iron_admin/tools/show.html.haml +20 -1
- data/config/importmap.rb +2 -0
- data/config/locales/en.yml +36 -0
- data/config/routes.rb +7 -0
- data/docs/components/filter-components.md +60 -0
- data/docs/getting-started/quick-start.md +17 -1
- data/docs/guides/authentication.md +7 -6
- data/docs/guides/custom-adapters.md +628 -0
- data/docs/guides/extending.md +132 -3
- data/docs/guides/fields.md +1 -1
- data/docs/guides/resources.md +78 -2
- data/docs/guides/troubleshooting.md +29 -0
- data/docs/reference/routes.md +10 -0
- data/lib/generators/iron_admin/install/install_generator.rb +28 -4
- data/lib/generators/iron_admin/install_audit/install_audit_generator.rb +26 -10
- data/lib/iron_admin/action_field.rb +56 -0
- data/lib/iron_admin/adapters/active_record.rb +237 -0
- data/lib/iron_admin/adapters/base.rb +340 -0
- data/lib/iron_admin/adapters/http/column_descriptor.rb +10 -0
- data/lib/iron_admin/adapters/http/configuration.rb +27 -0
- data/lib/iron_admin/adapters/http/connection.rb +117 -0
- data/lib/iron_admin/adapters/http/model_proxy.rb +75 -0
- data/lib/iron_admin/adapters/http/query.rb +111 -0
- data/lib/iron_admin/adapters/http/record.rb +83 -0
- data/lib/iron_admin/adapters/http/type_inferrer.rb +51 -0
- data/lib/iron_admin/adapters/http.rb +241 -0
- data/lib/iron_admin/adapters/mongoid/association_wrapper.rb +74 -0
- data/lib/iron_admin/adapters/mongoid/column_descriptor.rb +10 -0
- data/lib/iron_admin/adapters/mongoid.rb +284 -0
- data/lib/iron_admin/adapters/registry.rb +44 -0
- data/lib/iron_admin/concerns/importable.rb +81 -0
- data/lib/iron_admin/concerns/live_updatable.rb +38 -0
- data/lib/iron_admin/concerns/nestable.rb +69 -0
- data/lib/iron_admin/concerns/soft_deletable.rb +61 -0
- data/lib/iron_admin/configuration.rb +20 -0
- data/lib/iron_admin/dashboard.rb +15 -20
- data/lib/iron_admin/engine.rb +28 -1
- data/lib/iron_admin/errors.rb +29 -0
- data/lib/iron_admin/field_inferrer.rb +61 -22
- data/lib/iron_admin/filters/active_record_query_builder.rb +63 -0
- data/lib/iron_admin/filters/base_query_builder.rb +55 -0
- data/lib/iron_admin/filters/http_query_builder.rb +39 -0
- data/lib/iron_admin/filters/mongoid_query_builder.rb +58 -0
- data/lib/iron_admin/filters/query_builder.rb +12 -0
- data/lib/iron_admin/import/column_mapper.rb +42 -0
- data/lib/iron_admin/import/import_preview.rb +10 -0
- data/lib/iron_admin/import/import_result.rb +10 -0
- data/lib/iron_admin/import/importer.rb +231 -0
- data/lib/iron_admin/import/parser/csv.rb +34 -0
- data/lib/iron_admin/import/parser/json.rb +36 -0
- data/lib/iron_admin/import/type_caster.rb +47 -0
- data/lib/iron_admin/live/broadcaster.rb +43 -0
- data/lib/iron_admin/live/poll_cache.rb +28 -0
- data/lib/iron_admin/live.rb +29 -0
- data/lib/iron_admin/nested_association.rb +15 -0
- data/lib/iron_admin/nested_attributes_validator.rb +25 -0
- data/lib/iron_admin/policy.rb +72 -13
- data/lib/iron_admin/resource.rb +148 -90
- data/lib/iron_admin/resource_registry.rb +77 -4
- data/lib/iron_admin/tool.rb +50 -0
- data/lib/iron_admin/tool_action.rb +73 -0
- data/lib/iron_admin/tool_context.rb +49 -0
- data/lib/iron_admin/version.rb +1 -1
- data/lib/iron_admin.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/cache/addressable-2.9.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/crack-1.0.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/faraday-2.14.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/faraday-net_http-3.4.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/hashdiff-1.2.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/net-http-0.9.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/public_suffix-7.0.5.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/rexml-3.4.4.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/webmock-3.26.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/mkmf.log +25 -25
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/mkmf.log +4 -4
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/mkmf.log +2 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/mkmf.log +22 -22
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/mkmf.log +9 -9
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/mkmf.log +12 -12
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/mkmf.log +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/mkmf.log +7 -7
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/redcarpet.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/mkmf.log +2 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/websocket_mask.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/CHANGELOG.md +326 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/README.md +121 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/native.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/pure.rb +4710 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna.rb +26 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/template.rb +1040 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/uri.rb +2602 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/version.rb +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable.rb +4 -0
- data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/ext/bigdecimal/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/lib/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/History +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/LICENSE +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/README.md +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/json.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/util.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/version.rb +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/xml.rb +240 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack.rb +8 -0
- data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/ext/date/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/ext/erb/escape/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/lib/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/CHANGELOG.md +574 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/README.md +67 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/Rakefile +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_spec.rb +119 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_test.rb +144 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter/test.rb +311 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter.rb +101 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter_registry.rb +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/connection.rb +565 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/flat_params_encoder.rb +105 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/nested_params_encoder.rb +183 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/error.rb +202 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/logging/formatter.rb +118 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/methods.rb +6 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware.rb +72 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware_registry.rb +83 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/connection_options.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/env.rb +204 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/proxy_options.rb +38 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/request_options.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/ssl_options.rb +76 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options.rb +219 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/parameters.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/rack_builder.rb +248 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/authorization.rb +54 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/instrumentation.rb +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/json.rb +70 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/url_encoded.rb +60 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request.rb +139 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/json.rb +74 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/logger.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/raise_error.rb +83 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response.rb +95 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/headers.rb +150 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/params_hash.rb +61 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils.rb +121 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday.rb +158 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/external_adapters/faraday_specs_setup.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter/test_spec.rb +442 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_registry_spec.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_spec.rb +55 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/connection_spec.rb +841 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/error_spec.rb +175 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_registry_spec.rb +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_spec.rb +213 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/env_spec.rb +76 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/options_spec.rb +297 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/proxy_options_spec.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/request_options_spec.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/flat_spec.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/nested_spec.rb +151 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/rack_builder_spec.rb +317 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/authorization_spec.rb +118 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/instrumentation_spec.rb +74 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/json_spec.rb +199 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/url_encoded_spec.rb +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request_spec.rb +110 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/json_spec.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/logger_spec.rb +299 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/raise_error_spec.rb +286 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response_spec.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils/headers_spec.rb +109 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils_spec.rb +120 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday_spec.rb +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/spec_helper.rb +133 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/disabling_stub.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/fake_safe_buffer.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/faraday_middleware_subclasses.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/helper_methods.rb +96 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/adapter.rb +105 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/params_encoder.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/request_method.rb +263 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/streaming_response_checker.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/LICENSE.md +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/README.md +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/adapter/net_http.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http/version.rb +7 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Gemfile +8 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/LICENSE +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/README.md +323 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Rakefile +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/changelog.md +127 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/hashdiff.gemspec +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/compare_hashes.rb +101 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/diff.rb +185 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs_compare_arrays.rb +32 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/linear_compare_array.rb +159 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/patch.rb +88 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/util.rb +155 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/ext/io/console/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/generator/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/parser/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/BSDL +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/COPYING +56 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/README.md +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/examples.rdoc +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/included_getters.rdoc +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/exceptions.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/generic_request.rb +429 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/header.rb +985 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/proxy_delta.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/request.rb +88 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/requests.rb +444 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/response.rb +739 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/responses.rb +1242 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/status.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http.rb +2608 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/https.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/ext/nio4r/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/lib/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/ext/prism/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/lib/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/ext/psych/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/lib/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/CHANGELOG.md +649 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/Gemfile +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/README.md +231 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/SECURITY.md +24 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/data/list.txt +16298 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/domain.rb +235 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/errors.rb +41 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/list.rb +247 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/rule.rb +350 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/version.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix.rb +177 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/ext/redcarpet/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/lib/redcarpet.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/NEWS.md +843 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/README.md +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/context.rdoc +143 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/child.rdoc +87 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/document.rdoc +276 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/element.rdoc +602 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/node.rdoc +97 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tutorial.rdoc +1358 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attlistdecl.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attribute.rb +210 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/cdata.rb +68 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/child.rb +96 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/comment.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/doctype.rb +306 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/document.rb +471 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/attlistdecl.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/dtd.rb +47 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/elementdecl.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/entitydecl.rb +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/notationdecl.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/element.rb +2578 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/encoding.rb +48 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/entity.rb +142 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/default.rb +116 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/pretty.rb +142 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/transitive.rb +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/functions.rb +446 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/instruction.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/light/node.rb +188 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/namespace.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/node.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/output.rb +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parent.rb +166 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parseexception.rb +53 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/baseparser.rb +949 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/lightparser.rb +59 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/pullparser.rb +213 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/sax2parser.rb +270 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/streamparser.rb +67 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/treeparser.rb +89 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/ultralightparser.rb +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/xpathparser.rb +739 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/quickpath.rb +267 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/rexml.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/sax2listener.rb +98 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/security.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/source.rb +388 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/streamlistener.rb +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/text.rb +420 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/undefinednamespaceexception.rb +9 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/relaxng.rb +540 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validation.rb +144 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validationexception.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmldecl.rb +130 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmltokens.rb +85 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath.rb +70 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath_parser.rb +980 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml.rb +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/ext/stringio/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/lib/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/CHANGELOG.md +2148 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/LICENSE +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/README.md +1229 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/api.rb +111 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/assertion_failure.rb +13 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/callback_registry.rb +37 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/config.rb +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/cucumber.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/deprecation.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/errors.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +228 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/curb_adapter.rb +354 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +239 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/excon_adapter.rb +167 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter.rb +9 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/request.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/response.rb +95 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/streamer.rb +44 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/webmock.rb +77 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb_adapter.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/httpclient_adapter.rb +260 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/manticore_adapter.rb +147 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http.rb +310 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http_response.rb +36 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/patron_adapter.rb +132 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +190 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/any_arg_matcher.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_argument_matcher.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_excluding_matcher.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_including_matcher.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/minitest.rb +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rack_response.rb +73 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_body_diff.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_execution_verifier.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_pattern.rb +428 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_registry.rb +37 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature.rb +56 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature_snippet.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_stub.rb +134 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/response.rb +161 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/responses_sequence.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/request_pattern_matcher.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/webmock_matcher.rb +69 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers.rb +29 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec.rb +44 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_registry.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_request_snippet.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/test_unit.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_counter.rb +45 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_keys_stringifier.rb +27 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_validator.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/headers.rb +77 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/json.rb +72 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/parse_error.rb +7 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/xml.rb +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/query_mapper.rb +283 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/uri.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/values_stringifier.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/version_checker.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/webmock.rb +175 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock.rb +61 -0
- data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/ext/websocket-driver/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/lib/websocket_mask.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/addressable-2.9.0.gemspec +29 -0
- data/vendor/bundle/ruby/3.2.0/specifications/crack-1.0.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.2.0/specifications/faraday-2.14.1.gemspec +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/faraday-net_http-3.4.2.gemspec +26 -0
- data/vendor/bundle/ruby/3.2.0/specifications/hashdiff-1.2.1.gemspec +30 -0
- data/vendor/bundle/ruby/3.2.0/specifications/net-http-0.9.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.2.0/specifications/public_suffix-7.0.5.gemspec +24 -0
- data/vendor/bundle/ruby/3.2.0/specifications/rexml-3.4.4.gemspec +25 -0
- data/vendor/bundle/ruby/3.2.0/specifications/webmock-3.26.2.gemspec +44 -0
- metadata +377 -2
data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/nested_params_encoder.rb
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Faraday
|
|
4
|
+
# Sub-module for encoding parameters into query-string.
|
|
5
|
+
module EncodeMethods
|
|
6
|
+
# @param params [nil, Array, #to_hash] parameters to be encoded
|
|
7
|
+
#
|
|
8
|
+
# @return [String] the encoded params
|
|
9
|
+
#
|
|
10
|
+
# @raise [TypeError] if params can not be converted to a Hash
|
|
11
|
+
def encode(params)
|
|
12
|
+
return nil if params.nil?
|
|
13
|
+
|
|
14
|
+
unless params.is_a?(Array)
|
|
15
|
+
unless params.respond_to?(:to_hash)
|
|
16
|
+
raise TypeError, "Can't convert #{params.class} into Hash."
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
params = params.to_hash
|
|
20
|
+
params = params.map do |key, value|
|
|
21
|
+
key = key.to_s if key.is_a?(Symbol)
|
|
22
|
+
[key, value]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Only to be used for non-Array inputs. Arrays should preserve order.
|
|
26
|
+
params.sort! if @sort_params
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# The params have form [['key1', 'value1'], ['key2', 'value2']].
|
|
30
|
+
buffer = +''
|
|
31
|
+
params.each do |parent, value|
|
|
32
|
+
encoded_parent = escape(parent)
|
|
33
|
+
buffer << "#{encode_pair(encoded_parent, value)}&"
|
|
34
|
+
end
|
|
35
|
+
buffer.chop
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
protected
|
|
39
|
+
|
|
40
|
+
def encode_pair(parent, value)
|
|
41
|
+
if value.is_a?(Hash)
|
|
42
|
+
encode_hash(parent, value)
|
|
43
|
+
elsif value.is_a?(Array)
|
|
44
|
+
encode_array(parent, value)
|
|
45
|
+
elsif value.nil?
|
|
46
|
+
parent
|
|
47
|
+
else
|
|
48
|
+
encoded_value = escape(value)
|
|
49
|
+
"#{parent}=#{encoded_value}"
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def encode_hash(parent, value)
|
|
54
|
+
value = value.map { |key, val| [escape(key), val] }.sort
|
|
55
|
+
|
|
56
|
+
buffer = +''
|
|
57
|
+
value.each do |key, val|
|
|
58
|
+
new_parent = "#{parent}%5B#{key}%5D"
|
|
59
|
+
buffer << "#{encode_pair(new_parent, val)}&"
|
|
60
|
+
end
|
|
61
|
+
buffer.chop
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def encode_array(parent, value)
|
|
65
|
+
return "#{parent}%5B%5D" if value.empty?
|
|
66
|
+
|
|
67
|
+
buffer = +''
|
|
68
|
+
value.each_with_index do |val, index|
|
|
69
|
+
new_parent = if @array_indices
|
|
70
|
+
"#{parent}%5B#{index}%5D"
|
|
71
|
+
else
|
|
72
|
+
"#{parent}%5B%5D"
|
|
73
|
+
end
|
|
74
|
+
buffer << "#{encode_pair(new_parent, val)}&"
|
|
75
|
+
end
|
|
76
|
+
buffer.chop
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Sub-module for decoding query-string into parameters.
|
|
81
|
+
module DecodeMethods
|
|
82
|
+
# @param query [nil, String]
|
|
83
|
+
#
|
|
84
|
+
# @return [Array<Array, String>] the decoded params
|
|
85
|
+
#
|
|
86
|
+
# @raise [TypeError] if the nesting is incorrect
|
|
87
|
+
def decode(query)
|
|
88
|
+
return nil if query.nil?
|
|
89
|
+
|
|
90
|
+
params = {}
|
|
91
|
+
query.split('&').each do |pair|
|
|
92
|
+
next if pair.empty?
|
|
93
|
+
|
|
94
|
+
key, value = pair.split('=', 2)
|
|
95
|
+
key = unescape(key)
|
|
96
|
+
value = unescape(value.tr('+', ' ')) if value
|
|
97
|
+
decode_pair(key, value, params)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
dehash(params, 0)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
protected
|
|
104
|
+
|
|
105
|
+
SUBKEYS_REGEX = /[^\[\]]+(?:\]?\[\])?/
|
|
106
|
+
|
|
107
|
+
def decode_pair(key, value, context)
|
|
108
|
+
subkeys = key.scan(SUBKEYS_REGEX)
|
|
109
|
+
subkeys.each_with_index do |subkey, i|
|
|
110
|
+
is_array = subkey =~ /[\[\]]+\Z/
|
|
111
|
+
subkey = Regexp.last_match.pre_match if is_array
|
|
112
|
+
last_subkey = i == subkeys.length - 1
|
|
113
|
+
|
|
114
|
+
context = prepare_context(context, subkey, is_array, last_subkey)
|
|
115
|
+
add_to_context(is_array, context, value, subkey) if last_subkey
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def prepare_context(context, subkey, is_array, last_subkey)
|
|
120
|
+
if !last_subkey || is_array
|
|
121
|
+
context = new_context(subkey, is_array, context)
|
|
122
|
+
end
|
|
123
|
+
if context.is_a?(Array) && !is_array
|
|
124
|
+
context = match_context(context, subkey)
|
|
125
|
+
end
|
|
126
|
+
context
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def new_context(subkey, is_array, context)
|
|
130
|
+
value_type = is_array ? Array : Hash
|
|
131
|
+
if context[subkey] && !context[subkey].is_a?(value_type)
|
|
132
|
+
raise TypeError, "expected #{value_type.name} " \
|
|
133
|
+
"(got #{context[subkey].class.name}) for param `#{subkey}'"
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
context[subkey] ||= value_type.new
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def match_context(context, subkey)
|
|
140
|
+
context << {} if !context.last.is_a?(Hash) || context.last.key?(subkey)
|
|
141
|
+
context.last
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def add_to_context(is_array, context, value, subkey)
|
|
145
|
+
is_array ? context << value : context[subkey] = value
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Internal: convert a nested hash with purely numeric keys into an array.
|
|
149
|
+
# FIXME: this is not compatible with Rack::Utils.parse_nested_query
|
|
150
|
+
# @!visibility private
|
|
151
|
+
def dehash(hash, depth)
|
|
152
|
+
hash.each do |key, value|
|
|
153
|
+
hash[key] = dehash(value, depth + 1) if value.is_a?(Hash)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if depth.positive? && !hash.empty? && hash.keys.all? { |k| k =~ /^\d+$/ }
|
|
157
|
+
hash.sort.map(&:last)
|
|
158
|
+
else
|
|
159
|
+
hash
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# This is the default encoder for Faraday requests.
|
|
165
|
+
# Using this encoder, parameters will be encoded respecting their structure,
|
|
166
|
+
# so you can send objects such as Arrays or Hashes as parameters
|
|
167
|
+
# for your requests.
|
|
168
|
+
module NestedParamsEncoder
|
|
169
|
+
class << self
|
|
170
|
+
attr_accessor :sort_params, :array_indices
|
|
171
|
+
|
|
172
|
+
extend Forwardable
|
|
173
|
+
def_delegators :'Faraday::Utils', :escape, :unescape
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Useful default for OAuth and caching.
|
|
177
|
+
@sort_params = true
|
|
178
|
+
@array_indices = false
|
|
179
|
+
|
|
180
|
+
extend EncodeMethods
|
|
181
|
+
extend DecodeMethods
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Faraday namespace.
|
|
4
|
+
module Faraday
|
|
5
|
+
# Faraday error base class.
|
|
6
|
+
class Error < StandardError
|
|
7
|
+
attr_reader :response, :wrapped_exception
|
|
8
|
+
|
|
9
|
+
def initialize(exc = nil, response = nil)
|
|
10
|
+
@wrapped_exception = nil unless defined?(@wrapped_exception)
|
|
11
|
+
@response = nil unless defined?(@response)
|
|
12
|
+
super(exc_msg_and_response!(exc, response))
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def backtrace
|
|
16
|
+
if @wrapped_exception
|
|
17
|
+
@wrapped_exception.backtrace
|
|
18
|
+
else
|
|
19
|
+
super
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def inspect
|
|
24
|
+
inner = +''
|
|
25
|
+
inner << " wrapped=#{@wrapped_exception.inspect}" if @wrapped_exception
|
|
26
|
+
inner << " response=#{@response.inspect}" if @response
|
|
27
|
+
inner << " #{super}" if inner.empty?
|
|
28
|
+
%(#<#{self.class}#{inner}>)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def response_status
|
|
32
|
+
return unless @response
|
|
33
|
+
|
|
34
|
+
@response.is_a?(Faraday::Response) ? @response.status : @response[:status]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def response_headers
|
|
38
|
+
return unless @response
|
|
39
|
+
|
|
40
|
+
@response.is_a?(Faraday::Response) ? @response.headers : @response[:headers]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def response_body
|
|
44
|
+
return unless @response
|
|
45
|
+
|
|
46
|
+
@response.is_a?(Faraday::Response) ? @response.body : @response[:body]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
protected
|
|
50
|
+
|
|
51
|
+
# Pulls out potential parent exception and response hash, storing them in
|
|
52
|
+
# instance variables.
|
|
53
|
+
# exc - Either an Exception, a string message, or a response hash.
|
|
54
|
+
# response - Hash
|
|
55
|
+
# :status - Optional integer HTTP response status
|
|
56
|
+
# :headers - String key/value hash of HTTP response header
|
|
57
|
+
# values.
|
|
58
|
+
# :body - Optional string HTTP response body.
|
|
59
|
+
# :request - Hash
|
|
60
|
+
# :method - Symbol with the request HTTP method.
|
|
61
|
+
# :url - URI object with the url requested.
|
|
62
|
+
# :url_path - String with the url path requested.
|
|
63
|
+
# :params - String key/value hash of query params
|
|
64
|
+
# present in the request.
|
|
65
|
+
# :headers - String key/value hash of HTTP request
|
|
66
|
+
# header values.
|
|
67
|
+
# :body - String HTTP request body.
|
|
68
|
+
#
|
|
69
|
+
# If a subclass has to call this, then it should pass a string message
|
|
70
|
+
# to `super`. See NilStatusError.
|
|
71
|
+
def exc_msg_and_response!(exc, response = nil)
|
|
72
|
+
if @response.nil? && @wrapped_exception.nil?
|
|
73
|
+
@wrapped_exception, msg, @response = exc_msg_and_response(exc, response)
|
|
74
|
+
return msg
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
exc.to_s
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Pulls out potential parent exception and response hash.
|
|
81
|
+
def exc_msg_and_response(exc, response = nil)
|
|
82
|
+
case exc
|
|
83
|
+
when Exception
|
|
84
|
+
[exc, exc.message, response]
|
|
85
|
+
when Hash
|
|
86
|
+
[nil, build_error_message_from_hash(exc), exc]
|
|
87
|
+
when Faraday::Env
|
|
88
|
+
[nil, build_error_message_from_env(exc), exc]
|
|
89
|
+
else
|
|
90
|
+
[nil, exc.to_s, response]
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
private
|
|
95
|
+
|
|
96
|
+
def build_error_message_from_hash(hash)
|
|
97
|
+
# Be defensive with external Hash objects - they might be missing keys
|
|
98
|
+
status = hash.fetch(:status, nil)
|
|
99
|
+
request = hash.fetch(:request, nil)
|
|
100
|
+
|
|
101
|
+
return fallback_error_message(status) if request.nil?
|
|
102
|
+
|
|
103
|
+
method = request.fetch(:method, nil)
|
|
104
|
+
url = request.fetch(:url, nil)
|
|
105
|
+
build_status_error_message(status, method, url)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def build_error_message_from_env(env)
|
|
109
|
+
# Faraday::Env is internal - we can make reasonable assumptions about its structure
|
|
110
|
+
build_status_error_message(env.status, env.method, env.url)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def build_status_error_message(status, method, url)
|
|
114
|
+
method_str = method ? method.to_s.upcase : ''
|
|
115
|
+
url_str = url ? url.to_s : ''
|
|
116
|
+
"the server responded with status #{status} for #{method_str} #{url_str}"
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def fallback_error_message(status)
|
|
120
|
+
"the server responded with status #{status} - method and url are not available " \
|
|
121
|
+
'due to include_request: false on Faraday::Response::RaiseError middleware'
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Faraday client error class. Represents 4xx status responses.
|
|
126
|
+
class ClientError < Error
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Raised by Faraday::Response::RaiseError in case of a 400 response.
|
|
130
|
+
class BadRequestError < ClientError
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Raised by Faraday::Response::RaiseError in case of a 401 response.
|
|
134
|
+
class UnauthorizedError < ClientError
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Raised by Faraday::Response::RaiseError in case of a 403 response.
|
|
138
|
+
class ForbiddenError < ClientError
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Raised by Faraday::Response::RaiseError in case of a 404 response.
|
|
142
|
+
class ResourceNotFound < ClientError
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Raised by Faraday::Response::RaiseError in case of a 407 response.
|
|
146
|
+
class ProxyAuthError < ClientError
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Raised by Faraday::Response::RaiseError in case of a 408 response.
|
|
150
|
+
class RequestTimeoutError < ClientError
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Raised by Faraday::Response::RaiseError in case of a 409 response.
|
|
154
|
+
class ConflictError < ClientError
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Raised by Faraday::Response::RaiseError in case of a 422 response.
|
|
158
|
+
class UnprocessableContentError < ClientError
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Used to provide compatibility with legacy error name.
|
|
162
|
+
UnprocessableEntityError = UnprocessableContentError
|
|
163
|
+
|
|
164
|
+
# Raised by Faraday::Response::RaiseError in case of a 429 response.
|
|
165
|
+
class TooManyRequestsError < ClientError
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Faraday server error class. Represents 5xx status responses.
|
|
169
|
+
class ServerError < Error
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# A unified client error for timeouts.
|
|
173
|
+
class TimeoutError < ServerError
|
|
174
|
+
def initialize(exc = 'timeout', response = nil)
|
|
175
|
+
super(exc, response)
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Raised by Faraday::Response::RaiseError in case of a nil status in response.
|
|
180
|
+
class NilStatusError < ServerError
|
|
181
|
+
def initialize(exc, response = nil)
|
|
182
|
+
exc_msg_and_response!(exc, response)
|
|
183
|
+
super('http status could not be derived from the server response')
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# A unified error for failed connections.
|
|
188
|
+
class ConnectionFailed < Error
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# A unified client error for SSL errors.
|
|
192
|
+
class SSLError < Error
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Raised by middlewares that parse the response, like the JSON response middleware.
|
|
196
|
+
class ParsingError < Error
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Raised by Faraday::Middleware and subclasses when invalid default_options are used
|
|
200
|
+
class InitializationError < Error
|
|
201
|
+
end
|
|
202
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'pp' # This require is necessary for Hash#pretty_inspect to work, do not remove it, people rely on it.
|
|
4
|
+
|
|
5
|
+
module Faraday
|
|
6
|
+
module Logging
|
|
7
|
+
# Serves as an integration point to customize logging
|
|
8
|
+
class Formatter
|
|
9
|
+
extend Forwardable
|
|
10
|
+
|
|
11
|
+
DEFAULT_OPTIONS = { headers: true, bodies: false, errors: false,
|
|
12
|
+
log_level: :info }.freeze
|
|
13
|
+
|
|
14
|
+
def initialize(logger:, options:)
|
|
15
|
+
@logger = logger
|
|
16
|
+
@options = DEFAULT_OPTIONS.merge(options)
|
|
17
|
+
unless %i[debug info warn error fatal].include?(@options[:log_level])
|
|
18
|
+
@options[:log_level] = :info
|
|
19
|
+
end
|
|
20
|
+
@filter = []
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def_delegators :@logger, :debug, :info, :warn, :error, :fatal
|
|
24
|
+
|
|
25
|
+
def request(env)
|
|
26
|
+
public_send(log_level) do
|
|
27
|
+
"request: #{env.method.upcase} #{apply_filters(env.url.to_s)}"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
log_headers('request', env.request_headers) if log_headers?(:request)
|
|
31
|
+
log_body('request', env[:body]) if env[:body] && log_body?(:request)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def response(env)
|
|
35
|
+
public_send(log_level) { "response: Status #{env.status}" }
|
|
36
|
+
|
|
37
|
+
log_headers('response', env.response_headers) if log_headers?(:response)
|
|
38
|
+
log_body('response', env[:body]) if env[:body] && log_body?(:response)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def exception(exc)
|
|
42
|
+
return unless log_errors?
|
|
43
|
+
|
|
44
|
+
public_send(log_level) { "error: #{exc.full_message}" }
|
|
45
|
+
|
|
46
|
+
log_headers('error', exc.response_headers) if exc.respond_to?(:response_headers) && log_headers?(:error)
|
|
47
|
+
return unless exc.respond_to?(:response_body) && exc.response_body && log_body?(:error)
|
|
48
|
+
|
|
49
|
+
log_body('error', exc.response_body)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def filter(filter_word, filter_replacement)
|
|
53
|
+
@filter.push([filter_word, filter_replacement])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
private
|
|
57
|
+
|
|
58
|
+
def dump_headers(headers)
|
|
59
|
+
return if headers.nil?
|
|
60
|
+
|
|
61
|
+
headers.map { |k, v| "#{k}: #{v.inspect}" }.join("\n")
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def dump_body(body)
|
|
65
|
+
if body.respond_to?(:to_str)
|
|
66
|
+
body.to_str.encode(::Encoding::UTF_8, undef: :replace, invalid: :replace)
|
|
67
|
+
else
|
|
68
|
+
pretty_inspect(body)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def pretty_inspect(body)
|
|
73
|
+
body.pretty_inspect
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def log_headers?(type)
|
|
77
|
+
case @options[:headers]
|
|
78
|
+
when Hash
|
|
79
|
+
@options[:headers][type]
|
|
80
|
+
else
|
|
81
|
+
@options[:headers]
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def log_body?(type)
|
|
86
|
+
case @options[:bodies]
|
|
87
|
+
when Hash
|
|
88
|
+
@options[:bodies][type]
|
|
89
|
+
else
|
|
90
|
+
@options[:bodies]
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def log_errors?
|
|
95
|
+
@options[:errors]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def apply_filters(output)
|
|
99
|
+
@filter.each do |pattern, replacement|
|
|
100
|
+
output = output.to_s.gsub(pattern, replacement)
|
|
101
|
+
end
|
|
102
|
+
output
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def log_level
|
|
106
|
+
@options[:log_level]
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def log_headers(type, headers)
|
|
110
|
+
public_send(log_level) { "#{type}: #{apply_filters(dump_headers(headers))}" }
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def log_body(type, body)
|
|
114
|
+
public_send(log_level) { "#{type}: #{apply_filters(dump_body(body))}" }
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'monitor'
|
|
4
|
+
|
|
5
|
+
module Faraday
|
|
6
|
+
# Middleware is the basic base class of any Faraday middleware.
|
|
7
|
+
class Middleware
|
|
8
|
+
extend MiddlewareRegistry
|
|
9
|
+
|
|
10
|
+
attr_reader :app, :options
|
|
11
|
+
|
|
12
|
+
DEFAULT_OPTIONS = {}.freeze
|
|
13
|
+
LOCK = Mutex.new
|
|
14
|
+
|
|
15
|
+
def initialize(app = nil, options = {})
|
|
16
|
+
@app = app
|
|
17
|
+
@options = self.class.default_options.merge(options)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class << self
|
|
21
|
+
# Faraday::Middleware::default_options= allows user to set default options at the Faraday::Middleware
|
|
22
|
+
# class level.
|
|
23
|
+
#
|
|
24
|
+
# @example Set the Faraday::Response::RaiseError option, `include_request` to `false`
|
|
25
|
+
# my_app/config/initializers/my_faraday_middleware.rb
|
|
26
|
+
#
|
|
27
|
+
# Faraday::Response::RaiseError.default_options = { include_request: false }
|
|
28
|
+
#
|
|
29
|
+
def default_options=(options = {})
|
|
30
|
+
validate_default_options(options)
|
|
31
|
+
LOCK.synchronize do
|
|
32
|
+
@default_options = default_options.merge(options)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# default_options attr_reader that initializes class instance variable
|
|
37
|
+
# with the values of any Faraday::Middleware defaults, and merges with
|
|
38
|
+
# subclass defaults
|
|
39
|
+
def default_options
|
|
40
|
+
@default_options ||= DEFAULT_OPTIONS.merge(self::DEFAULT_OPTIONS)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
def validate_default_options(options)
|
|
46
|
+
invalid_keys = options.keys.reject { |opt| self::DEFAULT_OPTIONS.key?(opt) }
|
|
47
|
+
return unless invalid_keys.any?
|
|
48
|
+
|
|
49
|
+
raise(Faraday::InitializationError,
|
|
50
|
+
"Invalid options provided. Keys not found in #{self}::DEFAULT_OPTIONS: #{invalid_keys.join(', ')}")
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def call(env)
|
|
55
|
+
on_request(env) if respond_to?(:on_request)
|
|
56
|
+
app.call(env).on_complete do |environment|
|
|
57
|
+
on_complete(environment) if respond_to?(:on_complete)
|
|
58
|
+
end
|
|
59
|
+
rescue StandardError => e
|
|
60
|
+
on_error(e) if respond_to?(:on_error)
|
|
61
|
+
raise
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def close
|
|
65
|
+
if app.respond_to?(:close)
|
|
66
|
+
app.close
|
|
67
|
+
else
|
|
68
|
+
warn "#{app} does not implement \#close!"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'monitor'
|
|
4
|
+
|
|
5
|
+
module Faraday
|
|
6
|
+
# Adds the ability for other modules to register and lookup
|
|
7
|
+
# middleware classes.
|
|
8
|
+
module MiddlewareRegistry
|
|
9
|
+
def registered_middleware
|
|
10
|
+
@registered_middleware ||= {}
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Register middleware class(es) on the current module.
|
|
14
|
+
#
|
|
15
|
+
# @param mappings [Hash] Middleware mappings from a lookup symbol to a middleware class.
|
|
16
|
+
# @return [void]
|
|
17
|
+
#
|
|
18
|
+
# @example Lookup by a constant
|
|
19
|
+
#
|
|
20
|
+
# module Faraday
|
|
21
|
+
# class Whatever < Middleware
|
|
22
|
+
# # Middleware looked up by :foo returns Faraday::Whatever::Foo.
|
|
23
|
+
# register_middleware(foo: Whatever)
|
|
24
|
+
# end
|
|
25
|
+
# end
|
|
26
|
+
def register_middleware(**mappings)
|
|
27
|
+
middleware_mutex do
|
|
28
|
+
registered_middleware.update(mappings)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Unregister a previously registered middleware class.
|
|
33
|
+
#
|
|
34
|
+
# @param key [Symbol] key for the registered middleware.
|
|
35
|
+
def unregister_middleware(key)
|
|
36
|
+
registered_middleware.delete(key)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Lookup middleware class with a registered Symbol shortcut.
|
|
40
|
+
#
|
|
41
|
+
# @param key [Symbol] key for the registered middleware.
|
|
42
|
+
# @return [Class] a middleware Class.
|
|
43
|
+
# @raise [Faraday::Error] if given key is not registered
|
|
44
|
+
#
|
|
45
|
+
# @example
|
|
46
|
+
#
|
|
47
|
+
# module Faraday
|
|
48
|
+
# class Whatever < Middleware
|
|
49
|
+
# register_middleware(foo: Whatever)
|
|
50
|
+
# end
|
|
51
|
+
# end
|
|
52
|
+
#
|
|
53
|
+
# Faraday::Middleware.lookup_middleware(:foo)
|
|
54
|
+
# # => Faraday::Whatever
|
|
55
|
+
def lookup_middleware(key)
|
|
56
|
+
load_middleware(key) ||
|
|
57
|
+
raise(Faraday::Error, "#{key.inspect} is not registered on #{self}")
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
private
|
|
61
|
+
|
|
62
|
+
def middleware_mutex(&block)
|
|
63
|
+
@middleware_mutex ||= Monitor.new
|
|
64
|
+
@middleware_mutex.synchronize(&block)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def load_middleware(key)
|
|
68
|
+
value = registered_middleware[key]
|
|
69
|
+
case value
|
|
70
|
+
when Module
|
|
71
|
+
value
|
|
72
|
+
when Symbol, String
|
|
73
|
+
middleware_mutex do
|
|
74
|
+
@registered_middleware[key] = const_get(value)
|
|
75
|
+
end
|
|
76
|
+
when Proc
|
|
77
|
+
middleware_mutex do
|
|
78
|
+
@registered_middleware[key] = value.call
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Faraday
|
|
4
|
+
# @!parse
|
|
5
|
+
# # ConnectionOptions contains the configurable properties for a Faraday
|
|
6
|
+
# # connection object.
|
|
7
|
+
# class ConnectionOptions < Options; end
|
|
8
|
+
ConnectionOptions = Options.new(:request, :proxy, :ssl, :builder, :url,
|
|
9
|
+
:parallel_manager, :params, :headers,
|
|
10
|
+
:builder_class) do
|
|
11
|
+
options request: RequestOptions, ssl: SSLOptions
|
|
12
|
+
|
|
13
|
+
memoized(:request) { self.class.options_for(:request).new }
|
|
14
|
+
|
|
15
|
+
memoized(:ssl) { self.class.options_for(:ssl).new }
|
|
16
|
+
|
|
17
|
+
memoized(:builder_class) { RackBuilder }
|
|
18
|
+
|
|
19
|
+
def new_builder(block)
|
|
20
|
+
builder_class.new(&block)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|