iron_admin 0.4.1 → 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/README.md +66 -30
- 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/installation.md +113 -27
- 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 +68 -10
- data/docs/reference/routes.md +10 -0
- data/lib/generators/iron_admin/install/install_generator.rb +49 -4
- data/lib/generators/iron_admin/install/templates/dashboard.rb.tt +5 -1
- data/lib/generators/iron_admin/install_audit/install_audit_generator.rb +26 -10
- data/lib/generators/iron_admin/resource/resource_generator.rb +1 -1
- data/lib/generators/iron_admin/resource/templates/resource.rb.tt +6 -2
- 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 +35 -22
- 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 +149 -91
- 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 +46 -10
- 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
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WebMock
|
|
4
|
+
|
|
5
|
+
module RSpecMatcherDetector
|
|
6
|
+
def rSpecHashIncludingMatcher?(matcher)
|
|
7
|
+
matcher.class.name =~ /R?Spec::Mocks::ArgumentMatchers::HashIncludingMatcher/
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def rSpecHashExcludingMatcher?(matcher)
|
|
11
|
+
matcher.class.name =~ /R?Spec::Mocks::ArgumentMatchers::HashExcludingMatcher/
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class RequestPattern
|
|
16
|
+
|
|
17
|
+
attr_reader :method_pattern, :uri_pattern, :body_pattern, :headers_pattern
|
|
18
|
+
|
|
19
|
+
def initialize(method, uri, options = {})
|
|
20
|
+
@method_pattern = MethodPattern.new(method)
|
|
21
|
+
@uri_pattern = create_uri_pattern(uri)
|
|
22
|
+
@body_pattern = nil
|
|
23
|
+
@headers_pattern = nil
|
|
24
|
+
@with_block = nil
|
|
25
|
+
assign_options(options)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def with(options = {}, &block)
|
|
29
|
+
raise ArgumentError.new('#with method invoked with no arguments. Either options hash or block must be specified. Created a block with do..end? Try creating it with curly braces {} instead.') if options.empty? && !block_given?
|
|
30
|
+
assign_options(options)
|
|
31
|
+
@with_block = block
|
|
32
|
+
self
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def matches?(request_signature)
|
|
36
|
+
content_type = request_signature.headers['Content-Type'] if request_signature.headers
|
|
37
|
+
content_type = content_type.split(';').first if content_type
|
|
38
|
+
@method_pattern.matches?(request_signature.method) &&
|
|
39
|
+
@uri_pattern.matches?(request_signature.uri) &&
|
|
40
|
+
(@body_pattern.nil? || @body_pattern.matches?(request_signature.body, content_type || "")) &&
|
|
41
|
+
(@headers_pattern.nil? || @headers_pattern.matches?(request_signature.headers)) &&
|
|
42
|
+
(@with_block.nil? || @with_block.call(request_signature))
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def to_s
|
|
46
|
+
string = "#{@method_pattern.to_s.upcase}".dup
|
|
47
|
+
string << " #{@uri_pattern.to_s}"
|
|
48
|
+
string << " with body #{@body_pattern.to_s}" if @body_pattern
|
|
49
|
+
string << " with headers #{@headers_pattern.to_s}" if @headers_pattern
|
|
50
|
+
string << " with given block" if @with_block
|
|
51
|
+
string
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def assign_options(options)
|
|
58
|
+
options = WebMock::Util::HashKeysStringifier.stringify_keys!(options, deep: true)
|
|
59
|
+
HashValidator.new(options).validate_keys('body', 'headers', 'query', 'basic_auth')
|
|
60
|
+
set_basic_auth_as_headers!(options)
|
|
61
|
+
@body_pattern = BodyPattern.new(options['body']) if options.has_key?('body')
|
|
62
|
+
@headers_pattern = HeadersPattern.new(options['headers']) if options.has_key?('headers')
|
|
63
|
+
@uri_pattern.add_query_params(options['query']) if options.has_key?('query')
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def set_basic_auth_as_headers!(options)
|
|
67
|
+
if basic_auth = options.delete('basic_auth')
|
|
68
|
+
validate_basic_auth!(basic_auth)
|
|
69
|
+
options['headers'] ||= {}
|
|
70
|
+
options['headers']['Authorization'] = WebMock::Util::Headers.basic_auth_header(basic_auth[0],basic_auth[1])
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def validate_basic_auth!(basic_auth)
|
|
75
|
+
if !basic_auth.is_a?(Array) || basic_auth.map{|e| e.is_a?(String)}.uniq != [true]
|
|
76
|
+
raise "The basic_auth option value should be an array which contains 2 strings: username and password"
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def create_uri_pattern(uri)
|
|
81
|
+
if uri.is_a?(Regexp)
|
|
82
|
+
URIRegexpPattern.new(uri)
|
|
83
|
+
elsif uri.is_a?(Addressable::Template)
|
|
84
|
+
URIAddressablePattern.new(uri)
|
|
85
|
+
elsif uri.respond_to?(:call)
|
|
86
|
+
URICallablePattern.new(uri)
|
|
87
|
+
elsif uri.is_a?(::URI::Generic)
|
|
88
|
+
URIStringPattern.new(uri.to_s)
|
|
89
|
+
elsif uri.respond_to?(:to_str)
|
|
90
|
+
URIStringPattern.new(uri.to_str)
|
|
91
|
+
else
|
|
92
|
+
raise ArgumentError.new("URI should be a String, Regexp, Addressable::Template, a callable object, or respond to #to_str. Got: #{uri.class}")
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class MethodPattern
|
|
99
|
+
def initialize(pattern)
|
|
100
|
+
@pattern = pattern
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def matches?(method)
|
|
104
|
+
@pattern == method || @pattern == :any
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def to_s
|
|
108
|
+
@pattern.to_s
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class URIPattern
|
|
114
|
+
include RSpecMatcherDetector
|
|
115
|
+
|
|
116
|
+
def initialize(pattern)
|
|
117
|
+
@pattern = if pattern.is_a?(Addressable::URI) \
|
|
118
|
+
|| pattern.is_a?(Addressable::Template)
|
|
119
|
+
pattern
|
|
120
|
+
elsif pattern.respond_to?(:call)
|
|
121
|
+
pattern
|
|
122
|
+
else
|
|
123
|
+
WebMock::Util::URI.normalize_uri(pattern)
|
|
124
|
+
end
|
|
125
|
+
@query_params = nil
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def add_query_params(query_params)
|
|
129
|
+
@query_params = if query_params.is_a?(Hash)
|
|
130
|
+
query_params
|
|
131
|
+
elsif query_params.is_a?(WebMock::Matchers::HashIncludingMatcher) \
|
|
132
|
+
|| query_params.is_a?(WebMock::Matchers::HashExcludingMatcher)
|
|
133
|
+
query_params
|
|
134
|
+
elsif rSpecHashIncludingMatcher?(query_params)
|
|
135
|
+
WebMock::Matchers::HashIncludingMatcher.from_rspec_matcher(query_params)
|
|
136
|
+
elsif rSpecHashExcludingMatcher?(query_params)
|
|
137
|
+
WebMock::Matchers::HashExcludingMatcher.from_rspec_matcher(query_params)
|
|
138
|
+
else
|
|
139
|
+
WebMock::Util::QueryMapper.query_to_values(query_params, notation: Config.instance.query_values_notation)
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def matches?(uri)
|
|
144
|
+
pattern_matches?(uri) && query_params_matches?(uri)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def to_s
|
|
148
|
+
str = pattern_inspect
|
|
149
|
+
str += " with query params #{@query_params.inspect}" if @query_params
|
|
150
|
+
str
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
private
|
|
154
|
+
|
|
155
|
+
def pattern_inspect
|
|
156
|
+
@pattern.inspect
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def query_params_matches?(uri)
|
|
160
|
+
@query_params.nil? || @query_params == WebMock::Util::QueryMapper.query_to_values(uri.query, notation: Config.instance.query_values_notation)
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
class URICallablePattern < URIPattern
|
|
165
|
+
private
|
|
166
|
+
|
|
167
|
+
def pattern_matches?(uri)
|
|
168
|
+
@pattern.call(uri)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
class URIRegexpPattern < URIPattern
|
|
173
|
+
private
|
|
174
|
+
|
|
175
|
+
def pattern_matches?(uri)
|
|
176
|
+
WebMock::Util::URI.variations_of_uri_as_strings(uri).any? { |u| u.match(@pattern) }
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
class URIAddressablePattern < URIPattern
|
|
181
|
+
def add_query_params(query_params)
|
|
182
|
+
@@add_query_params_warned ||= false
|
|
183
|
+
if not @@add_query_params_warned
|
|
184
|
+
@@add_query_params_warned = true
|
|
185
|
+
warn "WebMock warning: ignoring query params in RFC 6570 template and checking them with WebMock"
|
|
186
|
+
end
|
|
187
|
+
super(query_params)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
private
|
|
191
|
+
|
|
192
|
+
def pattern_matches?(uri)
|
|
193
|
+
if @query_params.nil?
|
|
194
|
+
# Let Addressable check the whole URI
|
|
195
|
+
matches_with_variations?(uri)
|
|
196
|
+
else
|
|
197
|
+
# WebMock checks the query, Addressable checks everything else
|
|
198
|
+
matches_with_variations?(uri.omit(:query))
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
def pattern_inspect
|
|
203
|
+
@pattern.pattern.inspect
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
def matches_with_variations?(uri)
|
|
207
|
+
template =
|
|
208
|
+
begin
|
|
209
|
+
Addressable::Template.new(WebMock::Util::URI.heuristic_parse(@pattern.pattern))
|
|
210
|
+
rescue Addressable::URI::InvalidURIError
|
|
211
|
+
Addressable::Template.new(@pattern.pattern)
|
|
212
|
+
end
|
|
213
|
+
WebMock::Util::URI.variations_of_uri_as_strings(uri).any? { |u|
|
|
214
|
+
template_matches_uri?(template, u)
|
|
215
|
+
}
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def template_matches_uri?(template, uri)
|
|
219
|
+
template.match(uri)
|
|
220
|
+
rescue Addressable::URI::InvalidURIError
|
|
221
|
+
false
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
class URIStringPattern < URIPattern
|
|
226
|
+
def add_query_params(query_params)
|
|
227
|
+
super
|
|
228
|
+
if @query_params.is_a?(Hash) || @query_params.is_a?(String)
|
|
229
|
+
query_hash = (WebMock::Util::QueryMapper.query_to_values(@pattern.query, notation: Config.instance.query_values_notation) || {}).merge(@query_params)
|
|
230
|
+
@pattern.query = WebMock::Util::QueryMapper.values_to_query(query_hash, notation: WebMock::Config.instance.query_values_notation)
|
|
231
|
+
@query_params = nil
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
private
|
|
236
|
+
|
|
237
|
+
def pattern_matches?(uri)
|
|
238
|
+
if @pattern.is_a?(Addressable::URI)
|
|
239
|
+
if @query_params
|
|
240
|
+
uri.omit(:query) === @pattern
|
|
241
|
+
else
|
|
242
|
+
uri === @pattern
|
|
243
|
+
end
|
|
244
|
+
else
|
|
245
|
+
false
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
def pattern_inspect
|
|
250
|
+
WebMock::Util::URI.strip_default_port_from_uri_string(@pattern.to_s)
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class BodyPattern
|
|
256
|
+
include RSpecMatcherDetector
|
|
257
|
+
|
|
258
|
+
BODY_FORMATS = {
|
|
259
|
+
'text/xml' => :xml,
|
|
260
|
+
'application/xml' => :xml,
|
|
261
|
+
'application/json' => :json,
|
|
262
|
+
'text/json' => :json,
|
|
263
|
+
'application/javascript' => :json,
|
|
264
|
+
'text/javascript' => :json,
|
|
265
|
+
'text/html' => :html,
|
|
266
|
+
'application/x-yaml' => :yaml,
|
|
267
|
+
'text/yaml' => :yaml,
|
|
268
|
+
'text/plain' => :plain
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
attr_reader :pattern
|
|
272
|
+
|
|
273
|
+
def initialize(pattern)
|
|
274
|
+
@pattern = if pattern.is_a?(Hash)
|
|
275
|
+
normalize_hash(pattern)
|
|
276
|
+
elsif rSpecHashIncludingMatcher?(pattern)
|
|
277
|
+
WebMock::Matchers::HashIncludingMatcher.from_rspec_matcher(pattern)
|
|
278
|
+
else
|
|
279
|
+
pattern
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
def matches?(body, content_type = "")
|
|
284
|
+
assert_non_multipart_body(content_type)
|
|
285
|
+
|
|
286
|
+
if (@pattern).is_a?(Hash)
|
|
287
|
+
return true if @pattern.empty?
|
|
288
|
+
matching_body_hashes?(body_as_hash(body, content_type), @pattern, content_type)
|
|
289
|
+
elsif (@pattern).is_a?(Array)
|
|
290
|
+
matching_body_array?(body_as_hash(body, content_type), @pattern, content_type)
|
|
291
|
+
elsif (@pattern).is_a?(WebMock::Matchers::HashArgumentMatcher)
|
|
292
|
+
@pattern == body_as_hash(body, content_type)
|
|
293
|
+
else
|
|
294
|
+
empty_string?(@pattern) && empty_string?(body) ||
|
|
295
|
+
@pattern == body ||
|
|
296
|
+
@pattern === body
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def to_s
|
|
301
|
+
@pattern.inspect
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
private
|
|
305
|
+
|
|
306
|
+
def body_as_hash(body, content_type)
|
|
307
|
+
case body_format(content_type)
|
|
308
|
+
when :json then
|
|
309
|
+
WebMock::Util::Parsers::JSON.parse(body)
|
|
310
|
+
when :xml then
|
|
311
|
+
WebMock::Util::Parsers::XML.parse(body)
|
|
312
|
+
else
|
|
313
|
+
WebMock::Util::QueryMapper.query_to_values(body, notation: Config.instance.query_values_notation)
|
|
314
|
+
end
|
|
315
|
+
rescue WebMock::Util::Parsers::ParseError
|
|
316
|
+
nil
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
def body_format(content_type)
|
|
320
|
+
normalized_content_type = content_type.sub(/\A(application\/)[a-zA-Z0-9.-]+\+(json|xml)\Z/,'\1\2')
|
|
321
|
+
BODY_FORMATS[normalized_content_type]
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
def assert_non_multipart_body(content_type)
|
|
325
|
+
if content_type =~ %r{^multipart/form-data}
|
|
326
|
+
raise ArgumentError.new("WebMock does not support matching body for multipart/form-data requests yet :(")
|
|
327
|
+
end
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
# Compare two hashes for equality
|
|
331
|
+
#
|
|
332
|
+
# For two hashes to match they must have the same length and all
|
|
333
|
+
# values must match when compared using `#===`.
|
|
334
|
+
#
|
|
335
|
+
# The following hashes are examples of matches:
|
|
336
|
+
#
|
|
337
|
+
# {a: /\d+/} and {a: '123'}
|
|
338
|
+
#
|
|
339
|
+
# {a: '123'} and {a: '123'}
|
|
340
|
+
#
|
|
341
|
+
# {a: {b: /\d+/}} and {a: {b: '123'}}
|
|
342
|
+
#
|
|
343
|
+
# {a: {b: 'wow'}} and {a: {b: 'wow'}}
|
|
344
|
+
#
|
|
345
|
+
# @param [Hash] query_parameters typically the result of parsing
|
|
346
|
+
# JSON, XML or URL encoded parameters.
|
|
347
|
+
#
|
|
348
|
+
# @param [Hash] pattern which contains keys with a string, hash or
|
|
349
|
+
# regular expression value to use for comparison.
|
|
350
|
+
#
|
|
351
|
+
# @return [Boolean] true if the paramaters match the comparison
|
|
352
|
+
# hash, false if not.
|
|
353
|
+
def matching_body_hashes?(query_parameters, pattern, content_type)
|
|
354
|
+
return false unless query_parameters.is_a?(Hash)
|
|
355
|
+
return false unless query_parameters.keys.sort == pattern.keys.sort
|
|
356
|
+
|
|
357
|
+
query_parameters.all? do |key, actual|
|
|
358
|
+
expected = pattern[key]
|
|
359
|
+
matching_values(actual, expected, content_type)
|
|
360
|
+
end
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
def matching_body_array?(query_parameters, pattern, content_type)
|
|
364
|
+
return false unless query_parameters.is_a?(Array)
|
|
365
|
+
return false unless query_parameters.length == pattern.length
|
|
366
|
+
|
|
367
|
+
query_parameters.each_with_index do |actual, index|
|
|
368
|
+
expected = pattern[index]
|
|
369
|
+
return false unless matching_values(actual, expected, content_type)
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
true
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
def matching_values(actual, expected, content_type)
|
|
376
|
+
return matching_body_hashes?(actual, expected, content_type) if actual.is_a?(Hash) && expected.is_a?(Hash)
|
|
377
|
+
return matching_body_array?(actual, expected, content_type) if actual.is_a?(Array) && expected.is_a?(Array)
|
|
378
|
+
|
|
379
|
+
expected = WebMock::Util::ValuesStringifier.stringify_values(expected) if url_encoded_body?(content_type)
|
|
380
|
+
expected === actual
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
def empty_string?(string)
|
|
384
|
+
string.nil? || string == ""
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
def normalize_hash(hash)
|
|
388
|
+
Hash[WebMock::Util::HashKeysStringifier.stringify_keys!(hash, deep: true).sort]
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
def url_encoded_body?(content_type)
|
|
392
|
+
content_type =~ %r{^application/x-www-form-urlencoded}
|
|
393
|
+
end
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
class HeadersPattern
|
|
397
|
+
def initialize(pattern)
|
|
398
|
+
@pattern = WebMock::Util::Headers.normalize_headers(pattern) || {}
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
def matches?(headers)
|
|
402
|
+
if empty_headers?(@pattern)
|
|
403
|
+
empty_headers?(headers)
|
|
404
|
+
else
|
|
405
|
+
return false if empty_headers?(headers)
|
|
406
|
+
@pattern.each do |key, value|
|
|
407
|
+
return false unless headers.has_key?(key) && value === headers[key]
|
|
408
|
+
end
|
|
409
|
+
true
|
|
410
|
+
end
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
def to_s
|
|
414
|
+
WebMock::Util::Headers.sorted_headers_string(@pattern)
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
def pp_to_s
|
|
418
|
+
WebMock::Util::Headers.pp_headers_string(@pattern)
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
private
|
|
422
|
+
|
|
423
|
+
def empty_headers?(headers)
|
|
424
|
+
headers.nil? || headers == {}
|
|
425
|
+
end
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WebMock
|
|
4
|
+
|
|
5
|
+
class RequestRegistry
|
|
6
|
+
include Singleton
|
|
7
|
+
|
|
8
|
+
attr_accessor :requested_signatures
|
|
9
|
+
|
|
10
|
+
def initialize
|
|
11
|
+
reset!
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def reset!
|
|
15
|
+
self.requested_signatures = Util::HashCounter.new
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def times_executed(request_pattern)
|
|
19
|
+
self.requested_signatures.select do |request_signature|
|
|
20
|
+
request_pattern.matches?(request_signature)
|
|
21
|
+
end.inject(0) { |sum, (_, times_executed)| sum + times_executed }
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def to_s
|
|
25
|
+
if requested_signatures.hash.empty?
|
|
26
|
+
"No requests were made."
|
|
27
|
+
else
|
|
28
|
+
text = "".dup
|
|
29
|
+
self.requested_signatures.each do |request_signature, times_executed|
|
|
30
|
+
text << "#{request_signature} was made #{times_executed} time#{times_executed == 1 ? '' : 's' }\n"
|
|
31
|
+
end
|
|
32
|
+
text
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WebMock
|
|
4
|
+
|
|
5
|
+
class RequestSignature
|
|
6
|
+
|
|
7
|
+
attr_accessor :method, :uri, :body
|
|
8
|
+
attr_reader :headers
|
|
9
|
+
|
|
10
|
+
def initialize(method, uri, options = {})
|
|
11
|
+
self.method = method.to_sym
|
|
12
|
+
self.uri = uri.is_a?(Addressable::URI) ? uri : WebMock::Util::URI.normalize_uri(uri)
|
|
13
|
+
assign_options(options)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def to_s
|
|
17
|
+
string = "#{self.method.to_s.upcase}".dup
|
|
18
|
+
string << " #{WebMock::Util::URI.strip_default_port_from_uri_string(self.uri.to_s)}"
|
|
19
|
+
string << " with body '#{body.to_s}'" if body && body.to_s != ''
|
|
20
|
+
if headers && !headers.empty?
|
|
21
|
+
string << " with headers #{WebMock::Util::Headers.sorted_headers_string(headers)}"
|
|
22
|
+
end
|
|
23
|
+
string
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def headers=(headers)
|
|
27
|
+
@headers = WebMock::Util::Headers.normalize_headers(headers)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def hash
|
|
31
|
+
self.to_s.hash
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def eql?(other)
|
|
35
|
+
self.to_s == other.to_s
|
|
36
|
+
end
|
|
37
|
+
alias == eql?
|
|
38
|
+
|
|
39
|
+
def url_encoded?
|
|
40
|
+
!!(headers&.fetch('Content-Type', nil)&.start_with?('application/x-www-form-urlencoded'))
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def json_headers?
|
|
44
|
+
!!(headers&.fetch('Content-Type', nil)&.start_with?('application/json'))
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def assign_options(options)
|
|
50
|
+
self.body = options[:body] if options.has_key?(:body)
|
|
51
|
+
self.headers = options[:headers] if options.has_key?(:headers)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "pp"
|
|
4
|
+
|
|
5
|
+
module WebMock
|
|
6
|
+
class RequestSignatureSnippet
|
|
7
|
+
|
|
8
|
+
attr_reader :request_signature, :request_stub
|
|
9
|
+
|
|
10
|
+
def initialize(request_signature)
|
|
11
|
+
@request_signature = request_signature
|
|
12
|
+
@request_stub = RequestStub.from_request_signature(request_signature)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def stubbing_instructions
|
|
16
|
+
return unless WebMock.show_stubbing_instructions?
|
|
17
|
+
|
|
18
|
+
"You can stub this request with the following snippet:\n\n" +
|
|
19
|
+
WebMock::StubRequestSnippet.new(request_stub).to_s
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def request_stubs
|
|
23
|
+
return if WebMock::StubRegistry.instance.request_stubs.empty?
|
|
24
|
+
|
|
25
|
+
text = "registered request stubs:\n".dup
|
|
26
|
+
WebMock::StubRegistry.instance.request_stubs.each do |stub|
|
|
27
|
+
text << "\n#{WebMock::StubRequestSnippet.new(stub).to_s(false)}"
|
|
28
|
+
add_body_diff(stub, text) if WebMock.show_body_diff?
|
|
29
|
+
end
|
|
30
|
+
text
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def add_body_diff(stub, text)
|
|
36
|
+
body_diff_str = signature_stub_body_diff(stub)
|
|
37
|
+
text << "\n\n#{body_diff_str}" unless body_diff_str.empty?
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def signature_stub_body_diff(stub)
|
|
41
|
+
diff = RequestBodyDiff.new(request_signature, stub).body_diff
|
|
42
|
+
diff.empty? ? "" : "Body diff:\n #{pretty_print_to_string(diff)}"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def request_params
|
|
46
|
+
@request_params ||=
|
|
47
|
+
if request_signature.json_headers?
|
|
48
|
+
JSON.parse(request_signature.body)
|
|
49
|
+
else
|
|
50
|
+
""
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def pretty_print_to_string(string_to_print)
|
|
55
|
+
StringIO.open("".dup) do |stream|
|
|
56
|
+
PP.pp(string_to_print, stream)
|
|
57
|
+
stream.rewind
|
|
58
|
+
stream.read
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
end
|