iron_admin 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/iron_admin_manifest.js +12 -0
  3. data/app/components/iron_admin/dashboards/metric_card_component.html.haml +8 -3
  4. data/app/components/iron_admin/dashboards/metric_card_component.rb +21 -1
  5. data/app/components/iron_admin/form/belongs_to_component.rb +60 -6
  6. data/app/components/iron_admin/form/nested_form_component.html.haml +28 -0
  7. data/app/components/iron_admin/form/nested_form_component.rb +81 -0
  8. data/app/components/iron_admin/resources/data_table_component.html.haml +1 -1
  9. data/app/components/iron_admin/resources/data_table_component.rb +6 -0
  10. data/app/components/iron_admin/resources/show_field_component.rb +2 -0
  11. data/app/controllers/iron_admin/application_controller.rb +32 -1
  12. data/app/controllers/iron_admin/concerns/action_executable.rb +44 -0
  13. data/app/controllers/iron_admin/concerns/filterable.rb +84 -0
  14. data/app/controllers/iron_admin/concerns/json_params_coercion.rb +67 -0
  15. data/app/controllers/iron_admin/concerns/nested_permittable.rb +36 -0
  16. data/app/controllers/iron_admin/concerns/scopeable.rb +84 -0
  17. data/app/controllers/iron_admin/concerns/searchable.rb +13 -16
  18. data/app/controllers/iron_admin/exports_controller.rb +15 -11
  19. data/app/controllers/iron_admin/imports_controller.rb +83 -0
  20. data/app/controllers/iron_admin/live_controller.rb +12 -0
  21. data/app/controllers/iron_admin/resources_controller.rb +118 -117
  22. data/app/controllers/iron_admin/search_controller.rb +5 -5
  23. data/app/controllers/iron_admin/tools_controller.rb +63 -4
  24. data/app/helpers/iron_admin/application_helper.rb +33 -14
  25. data/app/helpers/iron_admin/field_display_helper.rb +160 -1
  26. data/app/javascript/iron_admin/controllers/cp_nested_form_controller.js +113 -0
  27. data/app/javascript/iron_admin/controllers/filter_operator_controller.js +10 -0
  28. data/app/javascript/iron_admin/index.js +4 -0
  29. data/app/views/iron_admin/dashboard/index.html.haml +7 -2
  30. data/app/views/iron_admin/form/_nested_row.html.haml +70 -0
  31. data/app/views/iron_admin/imports/new.html.haml +27 -0
  32. data/app/views/iron_admin/imports/preview.html.haml +31 -0
  33. data/app/views/iron_admin/resources/_form.html.haml +81 -5
  34. data/app/views/iron_admin/resources/action_form.html.haml +62 -0
  35. data/app/views/iron_admin/resources/bulk_action_form.html.haml +62 -0
  36. data/app/views/iron_admin/resources/index.html.haml +60 -18
  37. data/app/views/iron_admin/tools/action_form.html.haml +57 -0
  38. data/app/views/iron_admin/tools/show.html.haml +20 -1
  39. data/config/importmap.rb +2 -0
  40. data/config/locales/en.yml +36 -0
  41. data/config/routes.rb +7 -0
  42. data/docs/components/filter-components.md +60 -0
  43. data/docs/getting-started/quick-start.md +17 -1
  44. data/docs/guides/authentication.md +7 -6
  45. data/docs/guides/custom-adapters.md +628 -0
  46. data/docs/guides/extending.md +132 -3
  47. data/docs/guides/fields.md +1 -1
  48. data/docs/guides/resources.md +78 -2
  49. data/docs/guides/troubleshooting.md +29 -0
  50. data/docs/reference/routes.md +10 -0
  51. data/lib/generators/iron_admin/install/install_generator.rb +28 -4
  52. data/lib/generators/iron_admin/install_audit/install_audit_generator.rb +26 -10
  53. data/lib/iron_admin/action_field.rb +56 -0
  54. data/lib/iron_admin/adapters/active_record.rb +237 -0
  55. data/lib/iron_admin/adapters/base.rb +340 -0
  56. data/lib/iron_admin/adapters/http/column_descriptor.rb +10 -0
  57. data/lib/iron_admin/adapters/http/configuration.rb +27 -0
  58. data/lib/iron_admin/adapters/http/connection.rb +117 -0
  59. data/lib/iron_admin/adapters/http/model_proxy.rb +75 -0
  60. data/lib/iron_admin/adapters/http/query.rb +111 -0
  61. data/lib/iron_admin/adapters/http/record.rb +83 -0
  62. data/lib/iron_admin/adapters/http/type_inferrer.rb +51 -0
  63. data/lib/iron_admin/adapters/http.rb +241 -0
  64. data/lib/iron_admin/adapters/mongoid/association_wrapper.rb +74 -0
  65. data/lib/iron_admin/adapters/mongoid/column_descriptor.rb +10 -0
  66. data/lib/iron_admin/adapters/mongoid.rb +284 -0
  67. data/lib/iron_admin/adapters/registry.rb +44 -0
  68. data/lib/iron_admin/concerns/importable.rb +81 -0
  69. data/lib/iron_admin/concerns/live_updatable.rb +38 -0
  70. data/lib/iron_admin/concerns/nestable.rb +69 -0
  71. data/lib/iron_admin/concerns/soft_deletable.rb +61 -0
  72. data/lib/iron_admin/configuration.rb +20 -0
  73. data/lib/iron_admin/dashboard.rb +15 -20
  74. data/lib/iron_admin/engine.rb +28 -1
  75. data/lib/iron_admin/errors.rb +29 -0
  76. data/lib/iron_admin/field_inferrer.rb +61 -22
  77. data/lib/iron_admin/filters/active_record_query_builder.rb +63 -0
  78. data/lib/iron_admin/filters/base_query_builder.rb +55 -0
  79. data/lib/iron_admin/filters/http_query_builder.rb +39 -0
  80. data/lib/iron_admin/filters/mongoid_query_builder.rb +58 -0
  81. data/lib/iron_admin/filters/query_builder.rb +12 -0
  82. data/lib/iron_admin/import/column_mapper.rb +42 -0
  83. data/lib/iron_admin/import/import_preview.rb +10 -0
  84. data/lib/iron_admin/import/import_result.rb +10 -0
  85. data/lib/iron_admin/import/importer.rb +231 -0
  86. data/lib/iron_admin/import/parser/csv.rb +34 -0
  87. data/lib/iron_admin/import/parser/json.rb +36 -0
  88. data/lib/iron_admin/import/type_caster.rb +47 -0
  89. data/lib/iron_admin/live/broadcaster.rb +43 -0
  90. data/lib/iron_admin/live/poll_cache.rb +28 -0
  91. data/lib/iron_admin/live.rb +29 -0
  92. data/lib/iron_admin/nested_association.rb +15 -0
  93. data/lib/iron_admin/nested_attributes_validator.rb +25 -0
  94. data/lib/iron_admin/policy.rb +72 -13
  95. data/lib/iron_admin/resource.rb +148 -90
  96. data/lib/iron_admin/resource_registry.rb +77 -4
  97. data/lib/iron_admin/tool.rb +50 -0
  98. data/lib/iron_admin/tool_action.rb +73 -0
  99. data/lib/iron_admin/tool_context.rb +49 -0
  100. data/lib/iron_admin/version.rb +1 -1
  101. data/lib/iron_admin.rb +28 -0
  102. data/vendor/bundle/ruby/3.2.0/cache/addressable-2.9.0.gem +0 -0
  103. data/vendor/bundle/ruby/3.2.0/cache/crack-1.0.1.gem +0 -0
  104. data/vendor/bundle/ruby/3.2.0/cache/faraday-2.14.1.gem +0 -0
  105. data/vendor/bundle/ruby/3.2.0/cache/faraday-net_http-3.4.2.gem +0 -0
  106. data/vendor/bundle/ruby/3.2.0/cache/hashdiff-1.2.1.gem +0 -0
  107. data/vendor/bundle/ruby/3.2.0/cache/net-http-0.9.1.gem +0 -0
  108. data/vendor/bundle/ruby/3.2.0/cache/public_suffix-7.0.5.gem +0 -0
  109. data/vendor/bundle/ruby/3.2.0/cache/rexml-3.4.4.gem +0 -0
  110. data/vendor/bundle/ruby/3.2.0/cache/webmock-3.26.2.gem +0 -0
  111. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/bigdecimal.so +0 -0
  112. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/gem_make.out +6 -6
  113. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/mkmf.log +25 -25
  114. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/date_core.so +0 -0
  115. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +6 -6
  116. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/mkmf.log +4 -4
  117. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/erb/escape.so +0 -0
  118. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/gem_make.out +6 -6
  119. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/mkmf.log +2 -2
  120. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/gem_make.out +6 -6
  121. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/io/console.so +0 -0
  122. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/mkmf.log +22 -22
  123. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/gem_make.out +6 -6
  124. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/generator.so +0 -0
  125. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/parser.so +0 -0
  126. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/mkmf.log +9 -9
  127. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/gem_make.out +6 -6
  128. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/mkmf.log +12 -12
  129. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/nio4r_ext.so +0 -0
  130. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/gem_make.out +6 -6
  131. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/mkmf.log +6 -6
  132. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/prism/prism.so +0 -0
  133. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/gem_make.out +6 -6
  134. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/mkmf.log +7 -7
  135. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/psych.so +0 -0
  136. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +6 -6
  137. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/racc/cparse.so +0 -0
  138. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/gem_make.out +6 -6
  139. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/redcarpet.so +0 -0
  140. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +6 -6
  141. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/mkmf.log +2 -2
  142. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/stringio.so +0 -0
  143. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/gem_make.out +6 -6
  144. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/websocket_mask.so +0 -0
  145. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/CHANGELOG.md +326 -0
  146. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/LICENSE.txt +202 -0
  147. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/README.md +121 -0
  148. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/native.rb +66 -0
  149. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/pure.rb +4710 -0
  150. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna.rb +26 -0
  151. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/template.rb +1040 -0
  152. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/uri.rb +2602 -0
  153. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/version.rb +31 -0
  154. data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable.rb +4 -0
  155. data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/ext/bigdecimal/Makefile +3 -3
  156. data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/lib/bigdecimal.so +0 -0
  157. data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/History +58 -0
  158. data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/LICENSE +20 -0
  159. data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/README.md +43 -0
  160. data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/json.rb +113 -0
  161. data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/util.rb +17 -0
  162. data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/version.rb +3 -0
  163. data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/xml.rb +240 -0
  164. data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack.rb +8 -0
  165. data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/ext/date/Makefile +3 -3
  166. data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/lib/date_core.so +0 -0
  167. data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/ext/erb/escape/Makefile +3 -3
  168. data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/lib/erb/escape.so +0 -0
  169. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/CHANGELOG.md +574 -0
  170. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/LICENSE.md +20 -0
  171. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/README.md +67 -0
  172. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/Rakefile +12 -0
  173. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_spec.rb +119 -0
  174. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_test.rb +144 -0
  175. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter/test.rb +311 -0
  176. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter.rb +101 -0
  177. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter_registry.rb +30 -0
  178. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/connection.rb +565 -0
  179. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/flat_params_encoder.rb +105 -0
  180. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/nested_params_encoder.rb +183 -0
  181. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/error.rb +202 -0
  182. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/logging/formatter.rb +118 -0
  183. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/methods.rb +6 -0
  184. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware.rb +72 -0
  185. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware_registry.rb +83 -0
  186. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/connection_options.rb +23 -0
  187. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/env.rb +204 -0
  188. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/proxy_options.rb +38 -0
  189. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/request_options.rb +23 -0
  190. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/ssl_options.rb +76 -0
  191. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options.rb +219 -0
  192. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/parameters.rb +5 -0
  193. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/rack_builder.rb +248 -0
  194. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/authorization.rb +54 -0
  195. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/instrumentation.rb +58 -0
  196. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/json.rb +70 -0
  197. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/url_encoded.rb +60 -0
  198. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request.rb +139 -0
  199. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/json.rb +74 -0
  200. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/logger.rb +39 -0
  201. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/raise_error.rb +83 -0
  202. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response.rb +95 -0
  203. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/headers.rb +150 -0
  204. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/params_hash.rb +61 -0
  205. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils.rb +121 -0
  206. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/version.rb +5 -0
  207. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday.rb +158 -0
  208. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/external_adapters/faraday_specs_setup.rb +14 -0
  209. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter/test_spec.rb +442 -0
  210. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_registry_spec.rb +28 -0
  211. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_spec.rb +55 -0
  212. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/connection_spec.rb +841 -0
  213. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/error_spec.rb +175 -0
  214. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_registry_spec.rb +31 -0
  215. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_spec.rb +213 -0
  216. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/env_spec.rb +76 -0
  217. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/options_spec.rb +297 -0
  218. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/proxy_options_spec.rb +79 -0
  219. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/request_options_spec.rb +19 -0
  220. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/flat_spec.rb +42 -0
  221. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/nested_spec.rb +151 -0
  222. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/rack_builder_spec.rb +317 -0
  223. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/authorization_spec.rb +118 -0
  224. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/instrumentation_spec.rb +74 -0
  225. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/json_spec.rb +199 -0
  226. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/url_encoded_spec.rb +93 -0
  227. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request_spec.rb +110 -0
  228. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/json_spec.rb +206 -0
  229. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/logger_spec.rb +299 -0
  230. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/raise_error_spec.rb +286 -0
  231. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response_spec.rb +84 -0
  232. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils/headers_spec.rb +109 -0
  233. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils_spec.rb +120 -0
  234. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday_spec.rb +43 -0
  235. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/spec_helper.rb +133 -0
  236. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/disabling_stub.rb +14 -0
  237. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/fake_safe_buffer.rb +15 -0
  238. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/faraday_middleware_subclasses.rb +18 -0
  239. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/helper_methods.rb +96 -0
  240. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/adapter.rb +105 -0
  241. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/params_encoder.rb +18 -0
  242. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/request_method.rb +263 -0
  243. data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/streaming_response_checker.rb +35 -0
  244. data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/LICENSE.md +21 -0
  245. data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/README.md +57 -0
  246. data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/adapter/net_http.rb +206 -0
  247. data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http/version.rb +7 -0
  248. data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http.rb +10 -0
  249. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Gemfile +8 -0
  250. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/LICENSE +19 -0
  251. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/README.md +323 -0
  252. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Rakefile +18 -0
  253. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/changelog.md +127 -0
  254. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/hashdiff.gemspec +39 -0
  255. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/compare_hashes.rb +101 -0
  256. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/diff.rb +185 -0
  257. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs.rb +66 -0
  258. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs_compare_arrays.rb +32 -0
  259. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/linear_compare_array.rb +159 -0
  260. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/patch.rb +88 -0
  261. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/util.rb +155 -0
  262. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/version.rb +5 -0
  263. data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff.rb +10 -0
  264. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/ext/io/console/Makefile +3 -3
  265. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/lib/io/console.so +0 -0
  266. data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/generator/Makefile +3 -3
  267. data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/parser/Makefile +3 -3
  268. data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/generator.so +0 -0
  269. data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/parser.so +0 -0
  270. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/BSDL +22 -0
  271. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/COPYING +56 -0
  272. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/README.md +93 -0
  273. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/examples.rdoc +31 -0
  274. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/included_getters.rdoc +3 -0
  275. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/exceptions.rb +35 -0
  276. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/generic_request.rb +429 -0
  277. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/header.rb +985 -0
  278. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/proxy_delta.rb +17 -0
  279. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/request.rb +88 -0
  280. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/requests.rb +444 -0
  281. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/response.rb +739 -0
  282. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/responses.rb +1242 -0
  283. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/status.rb +84 -0
  284. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http.rb +2608 -0
  285. data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/https.rb +23 -0
  286. data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/ext/nio4r/Makefile +3 -3
  287. data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/lib/nio4r_ext.so +0 -0
  288. data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/ext/prism/Makefile +3 -3
  289. data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/lib/prism/prism.so +0 -0
  290. data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/ext/psych/Makefile +3 -3
  291. data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/lib/psych.so +0 -0
  292. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/CHANGELOG.md +649 -0
  293. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/Gemfile +16 -0
  294. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/LICENSE.txt +22 -0
  295. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/README.md +231 -0
  296. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/SECURITY.md +24 -0
  297. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/data/list.txt +16298 -0
  298. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/domain.rb +235 -0
  299. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/errors.rb +41 -0
  300. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/list.rb +247 -0
  301. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/rule.rb +350 -0
  302. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/version.rb +14 -0
  303. data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix.rb +177 -0
  304. data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +3 -3
  305. data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
  306. data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/ext/redcarpet/Makefile +3 -3
  307. data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/lib/redcarpet.so +0 -0
  308. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/LICENSE.txt +22 -0
  309. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/NEWS.md +843 -0
  310. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/README.md +57 -0
  311. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/context.rdoc +143 -0
  312. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/child.rdoc +87 -0
  313. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/document.rdoc +276 -0
  314. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/element.rdoc +602 -0
  315. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/node.rdoc +97 -0
  316. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
  317. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
  318. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
  319. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
  320. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
  321. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
  322. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
  323. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tutorial.rdoc +1358 -0
  324. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attlistdecl.rb +63 -0
  325. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attribute.rb +210 -0
  326. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/cdata.rb +68 -0
  327. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/child.rb +96 -0
  328. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/comment.rb +80 -0
  329. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/doctype.rb +306 -0
  330. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/document.rb +471 -0
  331. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/attlistdecl.rb +11 -0
  332. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/dtd.rb +47 -0
  333. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/elementdecl.rb +18 -0
  334. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/entitydecl.rb +57 -0
  335. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/notationdecl.rb +40 -0
  336. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/element.rb +2578 -0
  337. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/encoding.rb +48 -0
  338. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/entity.rb +142 -0
  339. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/default.rb +116 -0
  340. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/pretty.rb +142 -0
  341. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/transitive.rb +58 -0
  342. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/functions.rb +446 -0
  343. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/instruction.rb +79 -0
  344. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/light/node.rb +188 -0
  345. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/namespace.rb +63 -0
  346. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/node.rb +80 -0
  347. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/output.rb +30 -0
  348. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parent.rb +166 -0
  349. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parseexception.rb +53 -0
  350. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/baseparser.rb +949 -0
  351. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/lightparser.rb +59 -0
  352. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/pullparser.rb +213 -0
  353. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/sax2parser.rb +270 -0
  354. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/streamparser.rb +67 -0
  355. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/treeparser.rb +89 -0
  356. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/ultralightparser.rb +57 -0
  357. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/xpathparser.rb +739 -0
  358. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/quickpath.rb +267 -0
  359. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/rexml.rb +39 -0
  360. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/sax2listener.rb +98 -0
  361. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/security.rb +28 -0
  362. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/source.rb +388 -0
  363. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/streamlistener.rb +93 -0
  364. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/text.rb +420 -0
  365. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/undefinednamespaceexception.rb +9 -0
  366. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/relaxng.rb +540 -0
  367. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validation.rb +144 -0
  368. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validationexception.rb +10 -0
  369. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmldecl.rb +130 -0
  370. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmltokens.rb +85 -0
  371. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath.rb +70 -0
  372. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath_parser.rb +980 -0
  373. data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml.rb +3 -0
  374. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/ext/stringio/Makefile +3 -3
  375. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/lib/stringio.so +0 -0
  376. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/CHANGELOG.md +2148 -0
  377. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/LICENSE +20 -0
  378. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/README.md +1229 -0
  379. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/api.rb +111 -0
  380. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/assertion_failure.rb +13 -0
  381. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/callback_registry.rb +37 -0
  382. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/config.rb +20 -0
  383. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/cucumber.rb +12 -0
  384. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/deprecation.rb +11 -0
  385. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/errors.rb +19 -0
  386. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +228 -0
  387. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/curb_adapter.rb +354 -0
  388. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +239 -0
  389. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/excon_adapter.rb +167 -0
  390. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter.rb +9 -0
  391. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +21 -0
  392. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
  393. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/request.rb +28 -0
  394. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/response.rb +95 -0
  395. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/streamer.rb +44 -0
  396. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/webmock.rb +77 -0
  397. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb_adapter.rb +39 -0
  398. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/httpclient_adapter.rb +260 -0
  399. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/manticore_adapter.rb +147 -0
  400. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http.rb +310 -0
  401. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http_response.rb +36 -0
  402. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/patron_adapter.rb +132 -0
  403. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +190 -0
  404. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/any_arg_matcher.rb +15 -0
  405. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_argument_matcher.rb +23 -0
  406. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_excluding_matcher.rb +17 -0
  407. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_including_matcher.rb +19 -0
  408. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/minitest.rb +43 -0
  409. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rack_response.rb +73 -0
  410. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_body_diff.rb +66 -0
  411. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_execution_verifier.rb +79 -0
  412. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_pattern.rb +428 -0
  413. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_registry.rb +37 -0
  414. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature.rb +56 -0
  415. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature_snippet.rb +63 -0
  416. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_stub.rb +134 -0
  417. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/response.rb +161 -0
  418. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/responses_sequence.rb +42 -0
  419. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/request_pattern_matcher.rb +80 -0
  420. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/webmock_matcher.rb +69 -0
  421. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers.rb +29 -0
  422. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec.rb +44 -0
  423. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_registry.rb +84 -0
  424. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_request_snippet.rb +40 -0
  425. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/test_unit.rb +22 -0
  426. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_counter.rb +45 -0
  427. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_keys_stringifier.rb +27 -0
  428. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_validator.rb +19 -0
  429. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/headers.rb +77 -0
  430. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/json.rb +72 -0
  431. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/parse_error.rb +7 -0
  432. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/xml.rb +16 -0
  433. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/query_mapper.rb +283 -0
  434. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/uri.rb +113 -0
  435. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/values_stringifier.rb +22 -0
  436. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/version_checker.rb +113 -0
  437. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/version.rb +5 -0
  438. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/webmock.rb +175 -0
  439. data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock.rb +61 -0
  440. data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/ext/websocket-driver/Makefile +3 -3
  441. data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/lib/websocket_mask.so +0 -0
  442. data/vendor/bundle/ruby/3.2.0/specifications/addressable-2.9.0.gemspec +29 -0
  443. data/vendor/bundle/ruby/3.2.0/specifications/crack-1.0.1.gemspec +27 -0
  444. data/vendor/bundle/ruby/3.2.0/specifications/faraday-2.14.1.gemspec +0 -0
  445. data/vendor/bundle/ruby/3.2.0/specifications/faraday-net_http-3.4.2.gemspec +26 -0
  446. data/vendor/bundle/ruby/3.2.0/specifications/hashdiff-1.2.1.gemspec +30 -0
  447. data/vendor/bundle/ruby/3.2.0/specifications/net-http-0.9.1.gemspec +27 -0
  448. data/vendor/bundle/ruby/3.2.0/specifications/public_suffix-7.0.5.gemspec +24 -0
  449. data/vendor/bundle/ruby/3.2.0/specifications/rexml-3.4.4.gemspec +25 -0
  450. data/vendor/bundle/ruby/3.2.0/specifications/webmock-3.26.2.gemspec +44 -0
  451. metadata +377 -2
@@ -0,0 +1,323 @@
1
+ # Hashdiff [![Build Status](https://github.com/liufengyun/hashdiff/workflows/ci/badge.svg)](https://github.com/liufengyun/hashdiff/actions?query=workflow%3Aci) [![Gem Version](https://badge.fury.io/rb/hashdiff.svg)](http://badge.fury.io/rb/hashdiff)
2
+
3
+ Hashdiff is a ruby library to compute the smallest difference between two hashes.
4
+
5
+ It also supports comparing two arrays.
6
+
7
+ Hashdiff does not monkey-patch any existing class. All features are contained inside the `Hashdiff` module.
8
+
9
+ **Docs**: [Documentation](http://rubydoc.info/gems/hashdiff)
10
+
11
+
12
+ __WARNING__: Don't use the library for comparing large arrays, say ~10K (see #49).
13
+
14
+ ## Why Hashdiff?
15
+
16
+ Given two Hashes A and B, sometimes you face the question: what's the smallest modification that can be made to change A into B?
17
+
18
+ An algorithm that responds to this question has to do following:
19
+
20
+ * Generate a list of additions, deletions and changes, so that `A + ChangeSet = B` and `B - ChangeSet = A`.
21
+ * Compute recursively -- Arrays and Hashes may be nested arbitrarily in A or B.
22
+ * Compute the smallest change -- it should recognize similar child Hashes or child Arrays between A and B.
23
+
24
+ Hashdiff answers the question above using an opinionated approach:
25
+
26
+ * Hash can be represented as a list of (dot-syntax-path, value) pairs. For example, `{a:[{c:2}]}` can be represented as `["a[0].c", 2]`.
27
+ * The change set can be represented using the dot-syntax representation. For example, `[['-', 'b.x', 3], ['~', 'b.z', 45, 30], ['+', 'b.y', 3]]`.
28
+ * It compares Arrays using the [LCS(longest common subsequence)](http://en.wikipedia.org/wiki/Longest_common_subsequence_problem) algorithm.
29
+ * It recognizes similar Hashes in an Array using a similarity value (0 < similarity <= 1).
30
+
31
+ ## Usage
32
+
33
+ To use the gem, add the following to your Gemfile:
34
+
35
+ ```Ruby
36
+ gem 'hashdiff'
37
+ ```
38
+
39
+ ## Quick Start
40
+
41
+ ### Diff
42
+
43
+ Two simple hashes:
44
+
45
+ ```ruby
46
+ a = {a:3, b:2}
47
+ b = {}
48
+
49
+ diff = Hashdiff.diff(a, b)
50
+ diff.should == [['-', 'a', 3], ['-', 'b', 2]]
51
+ ```
52
+
53
+ More complex hashes:
54
+
55
+ ```ruby
56
+ a = {a:{x:2, y:3, z:4}, b:{x:3, z:45}}
57
+ b = {a:{y:3}, b:{y:3, z:30}}
58
+
59
+ diff = Hashdiff.diff(a, b)
60
+ diff.should == [['-', 'a.x', 2], ['-', 'a.z', 4], ['-', 'b.x', 3], ['~', 'b.z', 45, 30], ['+', 'b.y', 3]]
61
+ ```
62
+
63
+ Arrays in hashes:
64
+
65
+ ```ruby
66
+ a = {a:[{x:2, y:3, z:4}, {x:11, y:22, z:33}], b:{x:3, z:45}}
67
+ b = {a:[{y:3}, {x:11, z:33}], b:{y:22}}
68
+
69
+ diff = Hashdiff.best_diff(a, b)
70
+ diff.should == [['-', 'a[0].x', 2], ['-', 'a[0].z', 4], ['-', 'a[1].y', 22], ['-', 'b.x', 3], ['-', 'b.z', 45], ['+', 'b.y', 22]]
71
+ ```
72
+
73
+ ### Patch
74
+
75
+ patch example:
76
+
77
+ ```ruby
78
+ a = {'a' => 3}
79
+ b = {'a' => {'a1' => 1, 'a2' => 2}}
80
+
81
+ diff = Hashdiff.diff(a, b)
82
+ Hashdiff.patch!(a, diff).should == b
83
+ ```
84
+
85
+ unpatch example:
86
+
87
+ ```ruby
88
+ a = [{'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5}, {'x' => 5, 'y' => 6, 'z' => 3}, 1]
89
+ b = [1, {'a' => 1, 'b' => 2, 'c' => 3, 'e' => 5}]
90
+
91
+ diff = Hashdiff.diff(a, b) # diff two array is OK
92
+ Hashdiff.unpatch!(b, diff).should == a
93
+ ```
94
+
95
+ ### Options
96
+
97
+ The following options are available: `:delimiter`, `:similarity`, `:strict`, `:ignore_keys`,
98
+ `:indifferent`, `:numeric_tolerance`, `:strip`, `:case_insensitive`, `:array_path`,
99
+ `:use_lcs`, and `:preserve_key_order`
100
+
101
+ #### `:delimiter`
102
+
103
+ You can specify `:delimiter` to be something other than the default dot. For example:
104
+
105
+ ```ruby
106
+ a = {a:{x:2, y:3, z:4}, b:{x:3, z:45}}
107
+ b = {a:{y:3}, b:{y:3, z:30}}
108
+
109
+ diff = Hashdiff.diff(a, b, delimiter: '\t')
110
+ diff.should == [['-', 'a\tx', 2], ['-', 'a\tz', 4], ['-', 'b\tx', 3], ['~', 'b\tz', 45, 30], ['+', 'b\ty', 3]]
111
+ ```
112
+
113
+ #### `:similarity`
114
+
115
+ In cases where you have similar hash objects in arrays, you can pass a custom value for `:similarity` instead of the default `0.8`. This is interpreted as a ratio of similarity (default is 80% similar, whereas `:similarity => 0.5` would look for at least a 50% similarity).
116
+
117
+ #### `:strict`
118
+
119
+ The `:strict` option, which defaults to `true`, specifies whether numeric types are compared on type as well as value. By default, an Integer will never be equal to a Float (e.g. 4 != 4.0). Setting `:strict` to false makes the comparison looser (e.g. 4 == 4.0).
120
+
121
+ #### `:ignore_keys`
122
+
123
+ The `:ignore_keys` option allows you to specify one or more keys to ignore, which defaults to `[]` (none). Ignored keys are ignored at all levels in both hashes. For example:
124
+
125
+ ```ruby
126
+ a = { a: 4, g: 0, b: { a: 5, c: 6, e: 1 } }
127
+ b = { b: { a: 7, c: 3, f: 1 }, d: 8 }
128
+ diff = Hashdiff.diff(a, b, ignore_keys: %i[a f])
129
+ diff.should == [['-', 'g', 0], ['-', 'b.e', 1], ['~', 'b.c', 6, 3], ['+', 'd', 8]]
130
+ ```
131
+ If you wish instead to ignore keys at a particlar level you should
132
+ use a [custom comparison method](https://github.com/liufengyun/hashdiff#specifying-a-custom-comparison-method) instead. For example to diff only at the 2nd level of both hashes:
133
+
134
+ ```ruby
135
+ a = { a: 4, g: 0, b: { a: 5, c: 6, e: 1 } }
136
+ b = { b: { a: 7, c: 3, f: 1 }, d: 8 }
137
+ diff = Hashdiff.diff(a, b) do |path, _e, _a|
138
+ arr = path.split('.')
139
+ true if %w[a f].include?(arr.last) && arr.size == 2 # note '.' is the default delimiter
140
+ end
141
+ diff.should == [['-', 'a', 4], ['-', 'g', 0], ['-', 'b.e', 1], ['~', 'b.c', 6, 3], ['+', 'd', 8]]
142
+ ```
143
+
144
+ #### `:indifferent`
145
+
146
+ The `:indifferent` option, which defaults to `false`, specifies whether to treat hash keys indifferently. Setting `:indifferent` to true has the effect of ignoring differences between symbol keys (ie. {a: 1} ~= {'a' => 1})
147
+
148
+ #### `:numeric_tolerance`
149
+
150
+ The :numeric_tolerance option allows for a small numeric tolerance.
151
+
152
+ ```ruby
153
+ a = {x:5, y:3.75, z:7}
154
+ b = {x:6, y:3.76, z:7}
155
+
156
+ diff = Hashdiff.diff(a, b, numeric_tolerance: 0.1)
157
+ diff.should == [["~", "x", 5, 6]]
158
+ ```
159
+
160
+ #### `:strip`
161
+
162
+ The :strip option strips all strings before comparing.
163
+
164
+ ```ruby
165
+ a = {x:5, s:'foo '}
166
+ b = {x:6, s:'foo'}
167
+
168
+ diff = Hashdiff.diff(a, b, numeric_tolerance: 0.1, strip: true)
169
+ diff.should == [["~", "x", 5, 6]]
170
+ ```
171
+
172
+ #### `:case_insensitive`
173
+
174
+ The :case_insensitive option makes string comparisons ignore case.
175
+
176
+ ```ruby
177
+ a = {x:5, s:'FooBar'}
178
+ b = {x:6, s:'foobar'}
179
+
180
+ diff = Hashdiff.diff(a, b, numeric_tolerance: 0.1, case_insensitive: true)
181
+ diff.should == [["~", "x", 5, 6]]
182
+ ```
183
+
184
+ #### `:array_path`
185
+
186
+ The :array_path option represents the path of the diff in an array rather than
187
+ a string. This can be used to show differences in between hash key types and
188
+ is useful for `patch!` when used on hashes without string keys.
189
+
190
+ ```ruby
191
+ a = {x:5}
192
+ b = {'x'=>6}
193
+
194
+ diff = Hashdiff.diff(a, b, array_path: true)
195
+ diff.should == [['-', [:x], 5], ['+', ['x'], 6]]
196
+ ```
197
+
198
+ For cases where there are arrays in paths their index will be added to the path.
199
+ ```ruby
200
+ a = {x:[0,1]}
201
+ b = {x:[0,2]}
202
+
203
+ diff = Hashdiff.diff(a, b, array_path: true)
204
+ diff.should == [["-", [:x, 1], 1], ["+", [:x, 1], 2]]
205
+ ```
206
+
207
+ This shouldn't cause problems if you are comparing an array with a hash:
208
+
209
+ ```ruby
210
+ a = {x:{0=>1}}
211
+ b = {x:[1]}
212
+
213
+ diff = Hashdiff.diff(a, b, array_path: true)
214
+ diff.should == [["~", [:x], {0=>1}, [1]]]
215
+ ```
216
+
217
+ #### `:use_lcs`
218
+
219
+ The :use_lcs option is used to specify whether a
220
+ [Longest common subsequence](https://en.wikipedia.org/wiki/Longest_common_subsequence_problem)
221
+ (LCS) algorithm is used to determine differences in arrays. This defaults to
222
+ `true` but can be changed to `false` for significantly faster array comparisons
223
+ (O(n) complexity rather than O(n<sup>2</sup>) for LCS).
224
+
225
+ When :use_lcs is false the results of array comparisons have a tendency to
226
+ show changes at indexes rather than additions and subtractions when :use_lcs is
227
+ true.
228
+
229
+ Note, currently the :similarity option has no effect when :use_lcs is false.
230
+
231
+ ```ruby
232
+ a = {x: [0, 1, 2]}
233
+ b = {x: [0, 2, 2, 3]}
234
+
235
+ diff = Hashdiff.diff(a, b, use_lcs: false)
236
+ diff.should == [["~", "x[1]", 1, 2], ["+", "x[3]", 3]]
237
+ ```
238
+
239
+ #### `:preserve_key_order`
240
+
241
+ By default, the change set is ordered by operation type: deletions (-) first, then updates (~), and finally additions (+).
242
+ Within each operation group, keys are sorted alphabetically:
243
+
244
+ ```ruby
245
+ a = {d: 1, c: 1, a: 1}
246
+ b = {d: 2, b: 2, a: 2}
247
+
248
+ diff = Hashdiff.diff(a, b)
249
+ diff.should == [["-", "c", 1], ["~", "a", 1, 2], ["~", "d", 1, 2], ["+", "b", 2]]
250
+ ```
251
+
252
+ Setting :preserve_key_order to true processes keys in the order they appear in the first hash.
253
+ Keys that only exist in the second hash are appended in their original order:
254
+
255
+ ```ruby
256
+ a = {d: 1, c: 1, a: 1}
257
+ b = {d: 2, b: 2, a: 2}
258
+
259
+ diff = Hashdiff.diff(a, b, preserve_key_order: true)
260
+ diff.should == [["~", "d", 1, 2], ["-", "c", 1], ["~", "a", 1, 2], ["+", "b", 2]]
261
+ ```
262
+
263
+ #### Specifying a custom comparison method
264
+
265
+ It's possible to specify how the values of a key should be compared.
266
+
267
+ ```ruby
268
+ a = {a:'car', b:'boat', c:'plane'}
269
+ b = {a:'bus', b:'truck', c:' plan'}
270
+
271
+ diff = Hashdiff.diff(a, b) do |path, obj1, obj2|
272
+ case path
273
+ when /a|b|c/
274
+ obj1.length == obj2.length
275
+ end
276
+ end
277
+
278
+ diff.should == [['~', 'b', 'boat', 'truck']]
279
+ ```
280
+
281
+ The yielded params of the comparison block is `|path, obj1, obj2|`, in which path is the key (or delimited compound key) to the value being compared. When comparing elements in array, the path is with the format `array[*]`. For example:
282
+
283
+ ```ruby
284
+ a = {a:'car', b:['boat', 'plane'] }
285
+ b = {a:'bus', b:['truck', ' plan'] }
286
+
287
+ diff = Hashdiff.diff(a, b) do |path, obj1, obj2|
288
+ case path
289
+ when 'b[*]'
290
+ obj1.length == obj2.length
291
+ end
292
+ end
293
+
294
+ diff.should == [["~", "a", "car", "bus"], ["~", "b[1]", "plane", " plan"], ["-", "b[0]", "boat"], ["+", "b[0]", "truck"]]
295
+ ```
296
+
297
+ When a comparison block is given, it'll be given priority over other specified options. If the block returns value other than `true` or `false`, then the two values will be compared with other specified options.
298
+
299
+ When used in conjunction with the `array_path` option, the path passed in as an argument will be an array. When determining the ordering of an array a key of `"*"` will be used in place of the `key[*]` field. It is possible, if you have hashes with integer or `"*"` keys, to have problems distinguishing between arrays and hashes - although this shouldn't be an issue unless your data is very difficult to predict and/or your custom rules are very specific.
300
+
301
+ #### Sorting arrays before comparison
302
+
303
+ An order difference alone between two arrays can create too many diffs to be useful. Consider sorting them prior to diffing.
304
+
305
+ ```ruby
306
+ a = {a:'car', b:['boat', 'plane'] }
307
+ b = {a:'car', b:['plane', 'boat'] }
308
+
309
+ Hashdiff.diff(a, b).should == [["+", "b[0]", "plane"], ["-", "b[2]", "plane"]]
310
+
311
+ b[:b].sort!
312
+
313
+ Hashdiff.diff(a, b).should == []
314
+ ```
315
+
316
+ ## Maintainers
317
+
318
+ - Krzysztof Rybka ([@krzysiek1507](https://github.com/krzysiek1507))
319
+ - Fengyun Liu ([@liufengyun](https://github.com/liufengyun))
320
+
321
+ ## License
322
+
323
+ Hashdiff is distributed under the MIT-LICENSE.
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
+
5
+ require 'rubocop/rake_task'
6
+
7
+ require 'bundler'
8
+ Bundler::GemHelper.install_tasks
9
+
10
+ require 'rspec/core/rake_task'
11
+
12
+ RuboCop::RakeTask.new
13
+
14
+ task default: %w[spec rubocop]
15
+
16
+ RSpec::Core::RakeTask.new(:spec) do |spec|
17
+ spec.pattern = './spec/**/*_spec.rb'
18
+ end
@@ -0,0 +1,127 @@
1
+ # Change Log
2
+
3
+ ## v1.2.1 2025-09-06
4
+
5
+ * Use HTTPS for the source in the Gemfile [#101](https://github.com/liufengyun/hashdiff/issues/101) ([@krzysiek1507](https://github.com/krzysiek1507))
6
+
7
+ ## v1.2.0 2025-5-20
8
+
9
+ * Added :preserve_key_order option to maintain original hash key order [#99](https://github.com/liufengyun/hashdiff/issues/99) ([@robkiessling](https://github.com/robkiessling))
10
+
11
+ ## v1.1.2 2024-11-12
12
+
13
+ * Fix bundler cache [#96](https://github.com/liufengyun/hashdiff/issues/96) ([@olleolleolle](https://github.com/olleolleolle))
14
+ * Quote the '3.0' in YAML [#95](https://github.com/liufengyun/hashdiff/issues/95) ([@olleolleolle](https://github.com/olleolleolle))
15
+ * Fix version in source code [#97](https://github.com/liufengyun/hashdiff/issues/97) ([@liufengyun](https://github.com/liufengyun))
16
+
17
+ ## v1.1.1 2024-08-02
18
+
19
+ * Fix bug in ignore_keys option [#88](https://github.com/liufengyun/hashdiff/issues/88) ([@Matzfan](https://github.com/Matzfan))
20
+ * Exclude spec files from gem package [#94](https://github.com/liufengyun/hashdiff/issues/94) ([@amatsuda](https://github.com/amatsuda))
21
+
22
+ ## v1.1.0 2023-12-14
23
+
24
+ * Add ignore_keys option ([#86](https://github.com/liufengyun/hashdiff/issues/86) [@Matzfan](https://github.com/Matzfan))
25
+ * Remove pinned version of rake < 11
26
+ * Bump rspec dep ~> 3.5
27
+ * Bump rubocop dep >= 1.52.1
28
+ * Bump rubocop-rspec dep > 1.16.0
29
+
30
+ ## v1.0.1 2020-02-25
31
+
32
+ * Add indifferent option
33
+
34
+ ## v1.0.0 2019-06-06
35
+
36
+ * Fix typo in readme ([#72](https://github.com/liufengyun/hashdiff/issues/72) [@koic](https://github.com/koic))
37
+ * Fix Rubocop offence ([#73](https://github.com/liufengyun/hashdiff/issues/73) [@koic](https://github.com/koic))
38
+ * Bumps version to v1.0.0 ([#74](https://github.com/liufengyun/hashdiff/issues/74) [@jfelchner](https://github.com/jfelchner))
39
+
40
+ ## v1.0.0.beta1 2019-06-06
41
+
42
+ * fix warnings in ci ([#69](https://github.com/liufengyun/hashdiff/issues/69) [@y-yagi](https://github.com/y-yagi))
43
+ * drop warnings of the constant change ([#70](https://github.com/liufengyun/hashdiff/issues/70) [@jfelchner](https://github.com/jfelchner))
44
+
45
+ ## v0.4.0 2019-05-28
46
+
47
+ * refactoring ([#56](https://github.com/liufengyun/hashdiff/issues/56) [#57](https://github.com/liufengyun/hashdiff/issues/57) [#59](https://github.com/liufengyun/hashdiff/issues/59) [#61](https://github.com/liufengyun/hashdiff/issues/61) [@krzysiek1507](https://github.com/krzysiek1507))
48
+ * fix typo in README ([#64](https://github.com/liufengyun/hashdiff/issues/64) [@pboling](https://github.com/pboling))
49
+ * change HashDiff to Hashdiff ([#65](https://github.com/liufengyun/hashdiff/issues/65) [@jfelchner](https://github.com/jfelchner))
50
+
51
+ ## v0.3.9 2019-04-22
52
+
53
+ * Performance tweak (thanks [@krzysiek1507](https://github.com/krzysiek1507): [#51](https://github.com/liufengyun/hashdiff/issues/51) [#52](https://github.com/liufengyun/hashdiff/issues/52) [#53](https://github.com/liufengyun/hashdiff/issues/53))
54
+
55
+ ## v0.3.8 2018-12-30
56
+
57
+ * Add Rubocop and drops Ruby 1.9 support [#47](https://github.com/liufengyun/hashdiff/issues/47)
58
+
59
+ ## v0.3.7 2017-10-08
60
+
61
+ * remove 1.8.7 support from gemspec [#39](https://github.com/liufengyun/hashdiff/issues/39)
62
+
63
+ ## v0.3.6 2017-08-22
64
+
65
+ * add option `use_lcs` [#35](https://github.com/liufengyun/hashdiff/issues/35)
66
+
67
+ ## v0.3.5 2017-08-06
68
+
69
+ * add option `array_path` [#34](https://github.com/liufengyun/hashdiff/issues/34)
70
+
71
+ ## v0.3.4 2017-05-01
72
+
73
+ * performance improvement of `#similar?` [#31](https://github.com/liufengyun/hashdiff/issues/31)
74
+
75
+ ## v0.3.2 2016-12-27
76
+
77
+ * replace `Fixnum` by `Integer` [#28](https://github.com/liufengyun/hashdiff/issues/28)
78
+
79
+ ## v0.3.1 2016-11-24
80
+
81
+ * fix an error when a hash has mixed types [#26](https://github.com/liufengyun/hashdiff/issues/26)
82
+
83
+ ## v0.3.0 2016-2-11
84
+
85
+ * support `:case_insensitive` option
86
+
87
+ ## v0.2.3 2015-11-5
88
+
89
+ * improve performance of LCS algorithm [#12](https://github.com/liufengyun/hashdiff/issues/12)
90
+
91
+ ## v0.2.2 2014-10-6
92
+
93
+ * make library 1.8.7 compatible
94
+
95
+ ## v0.2.1 2014-7-13
96
+
97
+ * yield added/deleted keys for custom comparison
98
+
99
+ ## v0.2.0 2014-3-29
100
+
101
+ * support custom comparison blocks
102
+ * support `:strip`, `:numeric_tolerance` and `:strict` options
103
+
104
+ ## v0.1.0 2013-8-25
105
+
106
+ * use options for parameters `:delimiter` and `:similarity` in interfaces
107
+
108
+ ## v0.0.6 2013-3-2
109
+
110
+ * Add parameter for custom property-path delimiter.
111
+
112
+ ## v0.0.5 2012-7-1
113
+
114
+ * fix a bug in judging whehter two objects are similiar.
115
+ * add more spec test for `.best_diff`
116
+
117
+ ## v0.0.4 2012-6-24
118
+
119
+ Main changes in this version is to output the whole object in addition & deletion, instead of recursely add/deletes the object.
120
+
121
+ For example, `diff({a:2, c:[4, 5]}, {a:2}) will generate following output:
122
+
123
+ [['-', 'c', [4, 5]]]
124
+
125
+ instead of following:
126
+
127
+ [['-', 'c[0]', 4], ['-', 'c[1]', 5], ['-', 'c', []]]
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH << File.expand_path('lib', __dir__)
4
+ require 'hashdiff/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'hashdiff'
8
+ s.version = Hashdiff::VERSION
9
+ s.license = 'MIT'
10
+ s.summary = ' Hashdiff is a diff lib to compute the smallest difference between two hashes. '
11
+ s.description = ' Hashdiff is a diff lib to compute the smallest difference between two hashes. '
12
+
13
+ s.files = `git ls-files`.split("\n").grep_v(%r{^spec/})
14
+ s.test_files = `git ls-files -- Appraisals {spec}/*`.split("\n")
15
+
16
+ s.require_paths = ['lib']
17
+ s.required_ruby_version = Gem::Requirement.new('>= 2.0.0')
18
+
19
+ s.authors = ['Liu Fengyun']
20
+ s.email = ['liufengyunchina@gmail.com']
21
+
22
+ s.homepage = 'https://github.com/liufengyun/hashdiff'
23
+
24
+ s.add_development_dependency('bluecloth')
25
+ s.add_development_dependency('rspec', '~> 3.5')
26
+ s.add_development_dependency('rubocop', '>= 1.52.1') # earliest version that works with Ruby 3.3
27
+ s.add_development_dependency('rubocop-rspec', '> 1.16.0') # https://github.com/rubocop/rubocop-rspec/issues/461
28
+ s.add_development_dependency('yard')
29
+
30
+ if s.respond_to?(:metadata)
31
+ s.metadata = {
32
+ 'bug_tracker_uri' => 'https://github.com/liufengyun/hashdiff/issues',
33
+ 'changelog_uri' => 'https://github.com/liufengyun/hashdiff/blob/master/changelog.md',
34
+ 'documentation_uri' => 'https://www.rubydoc.info/gems/hashdiff',
35
+ 'homepage_uri' => 'https://github.com/liufengyun/hashdiff',
36
+ 'source_code_uri' => 'https://github.com/liufengyun/hashdiff'
37
+ }
38
+ end
39
+ end
@@ -0,0 +1,101 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hashdiff
4
+ # @private
5
+ # Used to compare hashes
6
+ class CompareHashes
7
+ class << self
8
+ def call(obj1, obj2, opts = {})
9
+ return [] if obj1.empty? && obj2.empty?
10
+
11
+ obj1_keys = obj1.keys
12
+ obj2_keys = obj2.keys
13
+ obj1_lookup = {}
14
+ obj2_lookup = {}
15
+
16
+ if opts[:indifferent]
17
+ obj1_lookup = obj1_keys.each_with_object({}) { |k, h| h[k.to_s] = k }
18
+ obj2_lookup = obj2_keys.each_with_object({}) { |k, h| h[k.to_s] = k }
19
+ obj1_keys = obj1_keys.map { |k| k.is_a?(Symbol) ? k.to_s : k }
20
+ obj2_keys = obj2_keys.map { |k| k.is_a?(Symbol) ? k.to_s : k }
21
+ end
22
+
23
+ added_keys = obj2_keys - obj1_keys
24
+ common_keys = obj1_keys & obj2_keys
25
+ deleted_keys = obj1_keys - obj2_keys
26
+
27
+ result = []
28
+
29
+ opts[:ignore_keys].each do |k|
30
+ added_keys.delete k
31
+ common_keys.delete k
32
+ deleted_keys.delete k
33
+ end
34
+
35
+ handle_key = lambda do |k, type|
36
+ case type
37
+ when :deleted
38
+ # add deleted properties
39
+ k = opts[:indifferent] ? obj1_lookup[k] : k
40
+ change_key = Hashdiff.prefix_append_key(opts[:prefix], k, opts)
41
+ custom_result = Hashdiff.custom_compare(opts[:comparison], change_key, obj1[k], nil)
42
+
43
+ if custom_result
44
+ result.concat(custom_result)
45
+ else
46
+ result << ['-', change_key, obj1[k]]
47
+ end
48
+ when :common
49
+ # recursive comparison for common keys
50
+ prefix = Hashdiff.prefix_append_key(opts[:prefix], k, opts)
51
+
52
+ k1 = opts[:indifferent] ? obj1_lookup[k] : k
53
+ k2 = opts[:indifferent] ? obj2_lookup[k] : k
54
+ result.concat(Hashdiff.diff(obj1[k1], obj2[k2], opts.merge(prefix: prefix)))
55
+ when :added
56
+ # added properties
57
+ change_key = Hashdiff.prefix_append_key(opts[:prefix], k, opts)
58
+
59
+ k = opts[:indifferent] ? obj2_lookup[k] : k
60
+ custom_result = Hashdiff.custom_compare(opts[:comparison], change_key, nil, obj2[k])
61
+
62
+ if custom_result
63
+ result.concat(custom_result)
64
+ else
65
+ result << ['+', change_key, obj2[k]]
66
+ end
67
+ else
68
+ raise "Invalid type: #{type}"
69
+ end
70
+ end
71
+
72
+ if opts[:preserve_key_order]
73
+ # Building lookups to speed up key classification
74
+ added_keys_lookup = added_keys.each_with_object({}) { |k, h| h[k] = true }
75
+ common_keys_lookup = common_keys.each_with_object({}) { |k, h| h[k] = true }
76
+ deleted_keys_lookup = deleted_keys.each_with_object({}) { |k, h| h[k] = true }
77
+
78
+ # Iterate through all keys, preserving obj1's key order and appending any new keys from obj2. Shared keys
79
+ # (found in both obj1 and obj2) follow obj1's order since uniq only keeps the first occurrence.
80
+ (obj1_keys + obj2_keys).uniq.each do |k|
81
+ if added_keys_lookup[k]
82
+ handle_key.call(k, :added)
83
+ elsif common_keys_lookup[k]
84
+ handle_key.call(k, :common)
85
+ elsif deleted_keys_lookup[k]
86
+ handle_key.call(k, :deleted)
87
+ end
88
+ end
89
+ else
90
+ # Keys are first grouped by operation type (deletions first, then changes, then additions), and then sorted
91
+ # alphabetically within each group.
92
+ deleted_keys.sort_by(&:to_s).each { |k| handle_key.call(k, :deleted) }
93
+ common_keys.sort_by(&:to_s).each { |k| handle_key.call(k, :common) }
94
+ added_keys.sort_by(&:to_s).each { |k| handle_key.call(k, :added) }
95
+ end
96
+
97
+ result
98
+ end
99
+ end
100
+ end
101
+ end