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,446 @@
|
|
|
1
|
+
# frozen_string_literal: false
|
|
2
|
+
module REXML
|
|
3
|
+
# If you add a method, keep in mind two things:
|
|
4
|
+
# (1) the first argument will always be a list of nodes from which to
|
|
5
|
+
# filter. In the case of context methods (such as position), the function
|
|
6
|
+
# should return an array with a value for each child in the array.
|
|
7
|
+
# (2) all method calls from XML will have "-" replaced with "_".
|
|
8
|
+
# Therefore, in XML, "local-name()" is identical (and actually becomes)
|
|
9
|
+
# "local_name()"
|
|
10
|
+
module Functions
|
|
11
|
+
@@available_functions = {}
|
|
12
|
+
@@context = nil
|
|
13
|
+
@@namespace_context = {}
|
|
14
|
+
@@variables = {}
|
|
15
|
+
|
|
16
|
+
INTERNAL_METHODS = [
|
|
17
|
+
:namespace_context,
|
|
18
|
+
:namespace_context=,
|
|
19
|
+
:variables,
|
|
20
|
+
:variables=,
|
|
21
|
+
:context=,
|
|
22
|
+
:get_namespace,
|
|
23
|
+
:send,
|
|
24
|
+
]
|
|
25
|
+
class << self
|
|
26
|
+
def singleton_method_added(name)
|
|
27
|
+
unless INTERNAL_METHODS.include?(name)
|
|
28
|
+
@@available_functions[name] = true
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def Functions::namespace_context=(x) ; @@namespace_context=x ; end
|
|
34
|
+
def Functions::variables=(x) ; @@variables=x ; end
|
|
35
|
+
def Functions::namespace_context ; @@namespace_context ; end
|
|
36
|
+
def Functions::variables ; @@variables ; end
|
|
37
|
+
|
|
38
|
+
def Functions::context=(value); @@context = value; end
|
|
39
|
+
|
|
40
|
+
def Functions::text( )
|
|
41
|
+
if @@context[:node].node_type == :element
|
|
42
|
+
@@context[:node].find_all{|n| n.node_type == :text}.collect{|n| n.value}
|
|
43
|
+
elsif @@context[:node].node_type == :text
|
|
44
|
+
@@context[:node].value
|
|
45
|
+
else
|
|
46
|
+
false
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Returns the last node of the given list of nodes.
|
|
51
|
+
def Functions::last( )
|
|
52
|
+
@@context[:size]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def Functions::position( )
|
|
56
|
+
@@context[:index]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Returns the size of the given list of nodes.
|
|
60
|
+
def Functions::count( node_set )
|
|
61
|
+
node_set.size
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Since REXML is non-validating, this method is not implemented as it
|
|
65
|
+
# requires a DTD
|
|
66
|
+
def Functions::id( object )
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def Functions::local_name(node_set=nil)
|
|
70
|
+
get_namespace(node_set) do |node|
|
|
71
|
+
return node.local_name
|
|
72
|
+
end
|
|
73
|
+
""
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def Functions::namespace_uri( node_set=nil )
|
|
77
|
+
get_namespace( node_set ) {|node| node.namespace}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def Functions::name( node_set=nil )
|
|
81
|
+
get_namespace( node_set ) do |node|
|
|
82
|
+
node.expanded_name
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Helper method.
|
|
87
|
+
def Functions::get_namespace( node_set = nil )
|
|
88
|
+
if node_set == nil
|
|
89
|
+
yield @@context[:node] if @@context[:node].respond_to?(:namespace)
|
|
90
|
+
else
|
|
91
|
+
if node_set.respond_to? :each
|
|
92
|
+
result = []
|
|
93
|
+
node_set.each do |node|
|
|
94
|
+
result << yield(node) if node.respond_to?(:namespace)
|
|
95
|
+
end
|
|
96
|
+
result
|
|
97
|
+
elsif node_set.respond_to? :namespace
|
|
98
|
+
yield node_set
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# A node-set is converted to a string by returning the string-value of the
|
|
104
|
+
# node in the node-set that is first in document order. If the node-set is
|
|
105
|
+
# empty, an empty string is returned.
|
|
106
|
+
#
|
|
107
|
+
# A number is converted to a string as follows
|
|
108
|
+
#
|
|
109
|
+
# NaN is converted to the string NaN
|
|
110
|
+
#
|
|
111
|
+
# positive zero is converted to the string 0
|
|
112
|
+
#
|
|
113
|
+
# negative zero is converted to the string 0
|
|
114
|
+
#
|
|
115
|
+
# positive infinity is converted to the string Infinity
|
|
116
|
+
#
|
|
117
|
+
# negative infinity is converted to the string -Infinity
|
|
118
|
+
#
|
|
119
|
+
# if the number is an integer, the number is represented in decimal form
|
|
120
|
+
# as a Number with no decimal point and no leading zeros, preceded by a
|
|
121
|
+
# minus sign (-) if the number is negative
|
|
122
|
+
#
|
|
123
|
+
# otherwise, the number is represented in decimal form as a Number
|
|
124
|
+
# including a decimal point with at least one digit before the decimal
|
|
125
|
+
# point and at least one digit after the decimal point, preceded by a
|
|
126
|
+
# minus sign (-) if the number is negative; there must be no leading zeros
|
|
127
|
+
# before the decimal point apart possibly from the one required digit
|
|
128
|
+
# immediately before the decimal point; beyond the one required digit
|
|
129
|
+
# after the decimal point there must be as many, but only as many, more
|
|
130
|
+
# digits as are needed to uniquely distinguish the number from all other
|
|
131
|
+
# IEEE 754 numeric values.
|
|
132
|
+
#
|
|
133
|
+
# The boolean false value is converted to the string false. The boolean
|
|
134
|
+
# true value is converted to the string true.
|
|
135
|
+
#
|
|
136
|
+
# An object of a type other than the four basic types is converted to a
|
|
137
|
+
# string in a way that is dependent on that type.
|
|
138
|
+
def Functions::string( object=@@context[:node] )
|
|
139
|
+
if object.respond_to?(:node_type)
|
|
140
|
+
case object.node_type
|
|
141
|
+
when :attribute
|
|
142
|
+
object.value
|
|
143
|
+
when :element
|
|
144
|
+
string_value(object)
|
|
145
|
+
when :document
|
|
146
|
+
string_value(object.root)
|
|
147
|
+
when :processing_instruction
|
|
148
|
+
object.content
|
|
149
|
+
else
|
|
150
|
+
object.to_s
|
|
151
|
+
end
|
|
152
|
+
else
|
|
153
|
+
case object
|
|
154
|
+
when Array
|
|
155
|
+
string(object[0])
|
|
156
|
+
when Float
|
|
157
|
+
if object.nan?
|
|
158
|
+
"NaN"
|
|
159
|
+
else
|
|
160
|
+
integer = object.to_i
|
|
161
|
+
if object == integer
|
|
162
|
+
"%d" % integer
|
|
163
|
+
else
|
|
164
|
+
object.to_s
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
else
|
|
168
|
+
object.to_s
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# A node-set is converted to a string by
|
|
174
|
+
# returning the concatenation of the string-value
|
|
175
|
+
# of each of the children of the node in the
|
|
176
|
+
# node-set that is first in document order.
|
|
177
|
+
# If the node-set is empty, an empty string is returned.
|
|
178
|
+
def Functions::string_value( o )
|
|
179
|
+
rv = ""
|
|
180
|
+
o.children.each { |e|
|
|
181
|
+
if e.node_type == :text
|
|
182
|
+
rv << e.to_s
|
|
183
|
+
elsif e.node_type == :element
|
|
184
|
+
rv << string_value( e )
|
|
185
|
+
end
|
|
186
|
+
}
|
|
187
|
+
rv
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def Functions::concat( *objects )
|
|
191
|
+
concatenated = ""
|
|
192
|
+
objects.each do |object|
|
|
193
|
+
concatenated << string(object)
|
|
194
|
+
end
|
|
195
|
+
concatenated
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Fixed by Mike Stok
|
|
199
|
+
def Functions::starts_with( string, test )
|
|
200
|
+
string(string).index(string(test)) == 0
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Fixed by Mike Stok
|
|
204
|
+
def Functions::contains( string, test )
|
|
205
|
+
string(string).include?(string(test))
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Kouhei fixed this
|
|
209
|
+
def Functions::substring_before( string, test )
|
|
210
|
+
ruby_string = string(string)
|
|
211
|
+
ruby_index = ruby_string.index(string(test))
|
|
212
|
+
if ruby_index.nil?
|
|
213
|
+
""
|
|
214
|
+
else
|
|
215
|
+
ruby_string[ 0...ruby_index ]
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Kouhei fixed this too
|
|
220
|
+
def Functions::substring_after( string, test )
|
|
221
|
+
ruby_string = string(string)
|
|
222
|
+
return $1 if ruby_string =~ /#{test}(.*)/
|
|
223
|
+
""
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Take equal portions of Mike Stok and Sean Russell; mix
|
|
227
|
+
# vigorously, and pour into a tall, chilled glass. Serves 10,000.
|
|
228
|
+
def Functions::substring( string, start, length=nil )
|
|
229
|
+
ruby_string = string(string)
|
|
230
|
+
ruby_length = if length.nil?
|
|
231
|
+
ruby_string.length.to_f
|
|
232
|
+
else
|
|
233
|
+
number(length)
|
|
234
|
+
end
|
|
235
|
+
ruby_start = number(start)
|
|
236
|
+
|
|
237
|
+
# Handle the special cases
|
|
238
|
+
return '' if (
|
|
239
|
+
ruby_length.nan? or
|
|
240
|
+
ruby_start.nan? or
|
|
241
|
+
ruby_start.infinite?
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
infinite_length = ruby_length.infinite? == 1
|
|
245
|
+
ruby_length = ruby_string.length if infinite_length
|
|
246
|
+
|
|
247
|
+
# Now, get the bounds. The XPath bounds are 1..length; the ruby bounds
|
|
248
|
+
# are 0..length. Therefore, we have to offset the bounds by one.
|
|
249
|
+
ruby_start = round(ruby_start) - 1
|
|
250
|
+
ruby_length = round(ruby_length)
|
|
251
|
+
|
|
252
|
+
if ruby_start < 0
|
|
253
|
+
ruby_length += ruby_start unless infinite_length
|
|
254
|
+
ruby_start = 0
|
|
255
|
+
end
|
|
256
|
+
return '' if ruby_length <= 0
|
|
257
|
+
ruby_string[ruby_start,ruby_length]
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# UNTESTED
|
|
261
|
+
def Functions::string_length( string )
|
|
262
|
+
string(string).length
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
def Functions::normalize_space( string=nil )
|
|
266
|
+
string = string(@@context[:node]) if string.nil?
|
|
267
|
+
if string.kind_of? Array
|
|
268
|
+
string.collect{|x| x.to_s.strip.gsub(/\s+/um, ' ') if x}
|
|
269
|
+
else
|
|
270
|
+
string.to_s.strip.gsub(/\s+/um, ' ')
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# This is entirely Mike Stok's beast
|
|
275
|
+
def Functions::translate( string, tr1, tr2 )
|
|
276
|
+
from = string(tr1)
|
|
277
|
+
to = string(tr2)
|
|
278
|
+
|
|
279
|
+
# the map is our translation table.
|
|
280
|
+
#
|
|
281
|
+
# if a character occurs more than once in the
|
|
282
|
+
# from string then we ignore the second &
|
|
283
|
+
# subsequent mappings
|
|
284
|
+
#
|
|
285
|
+
# if a character maps to nil then we delete it
|
|
286
|
+
# in the output. This happens if the from
|
|
287
|
+
# string is longer than the to string
|
|
288
|
+
#
|
|
289
|
+
# there's nothing about - or ^ being special in
|
|
290
|
+
# http://www.w3.org/TR/xpath#function-translate
|
|
291
|
+
# so we don't build ranges or negated classes
|
|
292
|
+
|
|
293
|
+
map = Hash.new
|
|
294
|
+
0.upto(from.length - 1) { |pos|
|
|
295
|
+
from_char = from[pos]
|
|
296
|
+
unless map.has_key? from_char
|
|
297
|
+
map[from_char] =
|
|
298
|
+
if pos < to.length
|
|
299
|
+
to[pos]
|
|
300
|
+
else
|
|
301
|
+
nil
|
|
302
|
+
end
|
|
303
|
+
end
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if ''.respond_to? :chars
|
|
307
|
+
string(string).chars.collect { |c|
|
|
308
|
+
if map.has_key? c then map[c] else c end
|
|
309
|
+
}.compact.join
|
|
310
|
+
else
|
|
311
|
+
string(string).unpack('U*').collect { |c|
|
|
312
|
+
if map.has_key? c then map[c] else c end
|
|
313
|
+
}.compact.pack('U*')
|
|
314
|
+
end
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
def Functions::boolean(object=@@context[:node])
|
|
318
|
+
case object
|
|
319
|
+
when true, false
|
|
320
|
+
object
|
|
321
|
+
when Float
|
|
322
|
+
return false if object.zero?
|
|
323
|
+
return false if object.nan?
|
|
324
|
+
true
|
|
325
|
+
when Numeric
|
|
326
|
+
not object.zero?
|
|
327
|
+
when String
|
|
328
|
+
not object.empty?
|
|
329
|
+
when Array
|
|
330
|
+
not object.empty?
|
|
331
|
+
else
|
|
332
|
+
object ? true : false
|
|
333
|
+
end
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# UNTESTED
|
|
337
|
+
def Functions::not( object )
|
|
338
|
+
not boolean( object )
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
# UNTESTED
|
|
342
|
+
def Functions::true( )
|
|
343
|
+
true
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# UNTESTED
|
|
347
|
+
def Functions::false( )
|
|
348
|
+
false
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
# UNTESTED
|
|
352
|
+
def Functions::lang( language )
|
|
353
|
+
lang = false
|
|
354
|
+
node = @@context[:node]
|
|
355
|
+
attr = nil
|
|
356
|
+
until node.nil?
|
|
357
|
+
if node.node_type == :element
|
|
358
|
+
attr = node.attributes["xml:lang"]
|
|
359
|
+
unless attr.nil?
|
|
360
|
+
lang = compare_language(string(language), attr)
|
|
361
|
+
break
|
|
362
|
+
else
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
node = node.parent
|
|
366
|
+
end
|
|
367
|
+
lang
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
def Functions::compare_language lang1, lang2
|
|
371
|
+
lang2.downcase.index(lang1.downcase) == 0
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# a string that consists of optional whitespace followed by an optional
|
|
375
|
+
# minus sign followed by a Number followed by whitespace is converted to
|
|
376
|
+
# the IEEE 754 number that is nearest (according to the IEEE 754
|
|
377
|
+
# round-to-nearest rule) to the mathematical value represented by the
|
|
378
|
+
# string; any other string is converted to NaN
|
|
379
|
+
#
|
|
380
|
+
# boolean true is converted to 1; boolean false is converted to 0
|
|
381
|
+
#
|
|
382
|
+
# a node-set is first converted to a string as if by a call to the string
|
|
383
|
+
# function and then converted in the same way as a string argument
|
|
384
|
+
#
|
|
385
|
+
# an object of a type other than the four basic types is converted to a
|
|
386
|
+
# number in a way that is dependent on that type
|
|
387
|
+
def Functions::number(object=@@context[:node])
|
|
388
|
+
case object
|
|
389
|
+
when true
|
|
390
|
+
Float(1)
|
|
391
|
+
when false
|
|
392
|
+
Float(0)
|
|
393
|
+
when Array
|
|
394
|
+
number(string(object))
|
|
395
|
+
when Numeric
|
|
396
|
+
object.to_f
|
|
397
|
+
else
|
|
398
|
+
str = string(object)
|
|
399
|
+
case str.strip
|
|
400
|
+
when /\A\s*(-?(?:\d+(?:\.\d*)?|\.\d+))\s*\z/
|
|
401
|
+
$1.to_f
|
|
402
|
+
else
|
|
403
|
+
Float::NAN
|
|
404
|
+
end
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
def Functions::sum( nodes )
|
|
409
|
+
nodes = [nodes] unless nodes.kind_of? Array
|
|
410
|
+
nodes.inject(0) { |r,n| r + number(string(n)) }
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
def Functions::floor( number )
|
|
414
|
+
number(number).floor
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
def Functions::ceiling( number )
|
|
418
|
+
number(number).ceil
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
def Functions::round( number )
|
|
422
|
+
number = number(number)
|
|
423
|
+
begin
|
|
424
|
+
neg = number.negative?
|
|
425
|
+
number = number.abs.round
|
|
426
|
+
neg ? -number : number
|
|
427
|
+
rescue FloatDomainError
|
|
428
|
+
number
|
|
429
|
+
end
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
def Functions::processing_instruction( node )
|
|
433
|
+
node.node_type == :processing_instruction
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
def Functions::send(name, *args)
|
|
437
|
+
if @@available_functions[name.to_sym]
|
|
438
|
+
super
|
|
439
|
+
else
|
|
440
|
+
# TODO: Maybe, this is not XPath spec behavior.
|
|
441
|
+
# This behavior must be reconsidered.
|
|
442
|
+
XPath.match(@@context[:node], name.to_s)
|
|
443
|
+
end
|
|
444
|
+
end
|
|
445
|
+
end
|
|
446
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# frozen_string_literal: false
|
|
2
|
+
|
|
3
|
+
require_relative "child"
|
|
4
|
+
require_relative "source"
|
|
5
|
+
|
|
6
|
+
module REXML
|
|
7
|
+
# Represents an XML Instruction; IE, <? ... ?>
|
|
8
|
+
# TODO: Add parent arg (3rd arg) to constructor
|
|
9
|
+
class Instruction < Child
|
|
10
|
+
START = "<?"
|
|
11
|
+
STOP = "?>"
|
|
12
|
+
|
|
13
|
+
# target is the "name" of the Instruction; IE, the "tag" in <?tag ...?>
|
|
14
|
+
# content is everything else.
|
|
15
|
+
attr_accessor :target, :content
|
|
16
|
+
|
|
17
|
+
# Constructs a new Instruction
|
|
18
|
+
# @param target can be one of a number of things. If String, then
|
|
19
|
+
# the target of this instruction is set to this. If an Instruction,
|
|
20
|
+
# then the Instruction is shallowly cloned (target and content are
|
|
21
|
+
# copied).
|
|
22
|
+
# @param content Must be either a String, or a Parent. Can only
|
|
23
|
+
# be a Parent if the target argument is a Source. Otherwise, this
|
|
24
|
+
# String is set as the content of this instruction.
|
|
25
|
+
def initialize(target, content=nil)
|
|
26
|
+
case target
|
|
27
|
+
when String
|
|
28
|
+
super()
|
|
29
|
+
@target = target
|
|
30
|
+
@content = content
|
|
31
|
+
when Instruction
|
|
32
|
+
super(content)
|
|
33
|
+
@target = target.target
|
|
34
|
+
@content = target.content
|
|
35
|
+
else
|
|
36
|
+
message =
|
|
37
|
+
"processing instruction target must be String or REXML::Instruction: "
|
|
38
|
+
message << "<#{target.inspect}>"
|
|
39
|
+
raise ArgumentError, message
|
|
40
|
+
end
|
|
41
|
+
@content.strip! if @content
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def clone
|
|
45
|
+
Instruction.new self
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# == DEPRECATED
|
|
49
|
+
# See the rexml/formatters package
|
|
50
|
+
#
|
|
51
|
+
def write writer, indent=-1, transitive=false, ie_hack=false
|
|
52
|
+
Kernel.warn( "#{self.class.name}#write is deprecated", uplevel: 1)
|
|
53
|
+
indent(writer, indent)
|
|
54
|
+
writer << START
|
|
55
|
+
writer << @target
|
|
56
|
+
if @content
|
|
57
|
+
writer << ' '
|
|
58
|
+
writer << @content
|
|
59
|
+
end
|
|
60
|
+
writer << STOP
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# @return true if other is an Instruction, and the content and target
|
|
64
|
+
# of the other matches the target and content of this object.
|
|
65
|
+
def ==( other )
|
|
66
|
+
other.kind_of? Instruction and
|
|
67
|
+
other.target == @target and
|
|
68
|
+
other.content == @content
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def node_type
|
|
72
|
+
:processing_instruction
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def inspect
|
|
76
|
+
"<?p-i #{target} ...?>"
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# frozen_string_literal: false
|
|
2
|
+
require_relative '../xmltokens'
|
|
3
|
+
|
|
4
|
+
module REXML
|
|
5
|
+
module Light
|
|
6
|
+
# Represents a tagged XML element. Elements are characterized by
|
|
7
|
+
# having children, attributes, and names, and can themselves be
|
|
8
|
+
# children.
|
|
9
|
+
class Node
|
|
10
|
+
NAMESPLIT = /^(?:(#{XMLTokens::NCNAME_STR}):)?(#{XMLTokens::NCNAME_STR})/u
|
|
11
|
+
PARENTS = [ :element, :document, :doctype ]
|
|
12
|
+
# Create a new element.
|
|
13
|
+
def initialize node=nil
|
|
14
|
+
@node = node
|
|
15
|
+
if node.kind_of? String
|
|
16
|
+
node = [ :text, node ]
|
|
17
|
+
elsif node.nil?
|
|
18
|
+
node = [ :document, nil, nil ]
|
|
19
|
+
elsif node[0] == :start_element
|
|
20
|
+
node[0] = :element
|
|
21
|
+
elsif node[0] == :start_doctype
|
|
22
|
+
node[0] = :doctype
|
|
23
|
+
elsif node[0] == :start_document
|
|
24
|
+
node[0] = :document
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def size
|
|
29
|
+
if PARENTS.include? @node[0]
|
|
30
|
+
@node[-1].size
|
|
31
|
+
else
|
|
32
|
+
0
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def each
|
|
37
|
+
size.times { |x| yield( at(x+4) ) }
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def name
|
|
41
|
+
at(2)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def name=( name_str, ns=nil )
|
|
45
|
+
pfx = ''
|
|
46
|
+
pfx = "#{prefix(ns)}:" if ns
|
|
47
|
+
_old_put(2, "#{pfx}#{name_str}")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def parent=( node )
|
|
51
|
+
_old_put(1,node)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def local_name
|
|
55
|
+
namesplit
|
|
56
|
+
@name
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def local_name=( name_str )
|
|
60
|
+
_old_put( 1, "#@prefix:#{name_str}" )
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def prefix( namespace=nil )
|
|
64
|
+
prefix_of( self, namespace )
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def namespace( prefix=prefix() )
|
|
68
|
+
namespace_of( self, prefix )
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def namespace=( namespace )
|
|
72
|
+
@prefix = prefix( namespace )
|
|
73
|
+
pfx = ''
|
|
74
|
+
pfx = "#@prefix:" if @prefix.size > 0
|
|
75
|
+
_old_put(1, "#{pfx}#@name")
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def []( reference, ns=nil )
|
|
79
|
+
if reference.kind_of? String
|
|
80
|
+
pfx = ''
|
|
81
|
+
pfx = "#{prefix(ns)}:" if ns
|
|
82
|
+
at(3)["#{pfx}#{reference}"]
|
|
83
|
+
elsif reference.kind_of? Range
|
|
84
|
+
_old_get( Range.new(4+reference.begin, reference.end, reference.exclude_end?) )
|
|
85
|
+
else
|
|
86
|
+
_old_get( 4+reference )
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def =~( path )
|
|
91
|
+
XPath.match( self, path )
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Doesn't handle namespaces yet
|
|
95
|
+
def []=( reference, ns, value=nil )
|
|
96
|
+
if reference.kind_of? String
|
|
97
|
+
value = ns unless value
|
|
98
|
+
at( 3 )[reference] = value
|
|
99
|
+
elsif reference.kind_of? Range
|
|
100
|
+
_old_put( Range.new(3+reference.begin, reference.end, reference.exclude_end?), ns )
|
|
101
|
+
else
|
|
102
|
+
if value
|
|
103
|
+
_old_put( 4+reference, ns, value )
|
|
104
|
+
else
|
|
105
|
+
_old_put( 4+reference, ns )
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Append a child to this element, optionally under a provided namespace.
|
|
111
|
+
# The namespace argument is ignored if the element argument is an Element
|
|
112
|
+
# object. Otherwise, the element argument is a string, the namespace (if
|
|
113
|
+
# provided) is the namespace the element is created in.
|
|
114
|
+
def << element
|
|
115
|
+
if node_type() == :text
|
|
116
|
+
at(-1) << element
|
|
117
|
+
else
|
|
118
|
+
newnode = Node.new( element )
|
|
119
|
+
newnode.parent = self
|
|
120
|
+
self.push( newnode )
|
|
121
|
+
end
|
|
122
|
+
at(-1)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def node_type
|
|
126
|
+
_old_get(0)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def text=( foo )
|
|
130
|
+
replace = at(4).kind_of?(String)? 1 : 0
|
|
131
|
+
self._old_put(4,replace, normalizefoo)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def root
|
|
135
|
+
context = self
|
|
136
|
+
context = context.at(1) while context.at(1)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def has_name?( name, namespace = '' )
|
|
140
|
+
at(3) == name and namespace() == namespace
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def children
|
|
144
|
+
self
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def parent
|
|
148
|
+
at(1)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def to_s
|
|
152
|
+
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
private
|
|
156
|
+
|
|
157
|
+
def namesplit
|
|
158
|
+
return if @name.defined?
|
|
159
|
+
at(2) =~ NAMESPLIT
|
|
160
|
+
@prefix = '' || $1
|
|
161
|
+
@name = $2
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def namespace_of( node, prefix=nil )
|
|
165
|
+
if not prefix
|
|
166
|
+
name = at(2)
|
|
167
|
+
name =~ NAMESPLIT
|
|
168
|
+
prefix = $1
|
|
169
|
+
end
|
|
170
|
+
to_find = 'xmlns'
|
|
171
|
+
to_find = "xmlns:#{prefix}" if not prefix.nil?
|
|
172
|
+
ns = at(3)[ to_find ]
|
|
173
|
+
ns ? ns : namespace_of( @node[0], prefix )
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
def prefix_of( node, namespace=nil )
|
|
177
|
+
if not namespace
|
|
178
|
+
name = node.name
|
|
179
|
+
name =~ NAMESPLIT
|
|
180
|
+
$1
|
|
181
|
+
else
|
|
182
|
+
ns = at(3).find { |k,v| v == namespace }
|
|
183
|
+
ns ? ns : prefix_of( node.parent, namespace )
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|