acfs 1.7.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +144 -116
- data/README.md +19 -24
- data/acfs.gemspec +7 -10
- data/lib/acfs/collections/paginatable.rb +11 -11
- data/lib/acfs/configuration.rb +1 -1
- data/lib/acfs/errors.rb +6 -6
- data/lib/acfs/global.rb +2 -2
- data/lib/acfs/location.rb +1 -1
- data/lib/acfs/resource/attributes/uuid.rb +1 -1
- data/lib/acfs/resource/attributes.rb +1 -1
- data/lib/acfs/resource/dirty.rb +1 -1
- data/lib/acfs/resource/operational.rb +4 -4
- data/lib/acfs/resource/query_methods.rb +3 -3
- data/lib/acfs/response/status.rb +1 -1
- data/lib/acfs/service/middleware.rb +2 -2
- data/lib/acfs/singleton_resource.rb +2 -2
- data/lib/acfs/stub.rb +1 -1
- data/lib/acfs/version.rb +2 -2
- data/lib/acfs/yard.rb +1 -0
- data/spec/acfs/adapter/typhoeus_spec.rb +3 -3
- data/spec/acfs/configuration_spec.rb +1 -1
- data/spec/acfs/global_spec.rb +5 -5
- data/spec/acfs/location_spec.rb +1 -1
- data/spec/acfs/middleware/json_spec.rb +1 -1
- data/spec/acfs/middleware/message_pack_spec.rb +1 -1
- data/spec/acfs/operation_spec.rb +1 -1
- data/spec/acfs/resource/attributes/boolean_spec.rb +31 -31
- data/spec/acfs/resource/attributes/date_time_spec.rb +9 -9
- data/spec/acfs/resource/attributes/dict_spec.rb +10 -10
- data/spec/acfs/resource/attributes/float_spec.rb +11 -11
- data/spec/acfs/resource/attributes/integer_spec.rb +6 -6
- data/spec/acfs/resource/attributes/list_spec.rb +1 -1
- data/spec/acfs/resource/attributes/uuid_spec.rb +8 -8
- data/spec/acfs/resource/attributes_spec.rb +8 -8
- data/spec/acfs/resource/dirty_spec.rb +1 -1
- data/spec/acfs/resource/persistence_spec.rb +7 -7
- data/spec/acfs/resource/query_methods_spec.rb +1 -1
- data/spec/acfs/runner_spec.rb +12 -12
- data/spec/acfs/stub_spec.rb +13 -18
- data/spec/acfs_spec.rb +4 -4
- data/spec/spec_helper.rb +9 -5
- data/spec/support/hash.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/README.md +23 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/rubocop-config.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/CHANGELOG.md +205 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/README.rdoc +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/CHANGELOG.md +67 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/README.rdoc +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/CHANGELOG.md +110 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/activemodel-8.0.1/README.rdoc +266 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/CHANGELOG.md +157 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/README.rdoc +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/CHANGELOG.md +301 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/README.md +121 -0
- data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/addressable.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/README.md +243 -0
- data/vendor/bundle/ruby/3.4.0/gems/appraisal-2.5.0/appraisal.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/README.md +48 -0
- data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/README.md +138 -0
- data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/benchmark.gemspec +32 -0
- data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/LICENSE +56 -0
- data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/bigdecimal.gemspec +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/README.md +258 -0
- data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/builder.gemspec +49 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/CHANGELOG.md +603 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/LICENSE.txt +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/README.md +407 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/README.md +167 -0
- data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/connection_pool.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/crack-1.0.0/README.md +43 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/LICENSE +18 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/README.md +192 -0
- data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/crass.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/License.md +41 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/README.rdoc +84 -0
- data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/drb.gemspec +41 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/CHANGELOG +111 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/README.rdoc +151 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/CHANGELOG.md +375 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/README.md +118 -0
- data/vendor/bundle/ruby/3.4.0/gems/ethon-0.16.0/ethon.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/CHANGELOG.md +465 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/LICENSE.SPECS +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/README.md +137 -0
- data/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.1-x86_64-linux-gnu/ffi.gemspec +42 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/LICENSE +19 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/README.md +298 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/changelog.md +119 -0
- data/vendor/bundle/ruby/3.4.0/gems/hashdiff-1.1.2/hashdiff.gemspec +39 -0
- data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.6/README.md +127 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/README.md +195 -0
- data/vendor/bundle/ruby/3.4.0/gems/json-2.9.1/json.gemspec +64 -0
- data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/README.md +104 -0
- data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/logger.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/CHANGELOG.md +591 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/MIT-LICENSE.txt +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/README.md +410 -0
- data/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.4/README.rdoc +835 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/CHANGELOG.md +275 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/multi_json-1.15.0/README.md +121 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE-DEPENDENCIES.md +2224 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/LICENSE.md +9 -0
- data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.1-x86_64-linux-gnu/README.md +293 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/CHANGELOG.md +491 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/README.md +222 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/ChangeLog +846 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
- data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/CHANGELOG.md +998 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.8/README.md +328 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/license.md +72 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-session-2.1.0/readme.md +47 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/MIT-LICENSE.txt +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/README.md +139 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/MIT-LICENSE +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/README.md +91 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/CHANGELOG.md +255 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/MIT-LICENSE +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/README.md +267 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/README.rdoc +155 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/rake.gemspec +101 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/LICENSE +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/README.md +107 -0
- data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/rake-release.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/rexml-3.4.0/README.md +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/LICENSE.md +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/README.md +47 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/Changelog.md +68 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/README.md +76 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-collection_matchers-1.2.1/rspec-collection_matchers.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/Changelog.md +2415 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/LICENSE.md +26 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/README.md +389 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/Changelog.md +1352 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/LICENSE.md +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/README.md +326 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/Changelog.md +73 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/LICENSE.txt +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/README.md +104 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-its-2.0.0/rspec-its.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/Changelog.md +1299 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/LICENSE.md +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/README.md +465 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/Changelog.md +408 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/LICENSE.md +23 -0
- data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/README.md +40 -0
- data/vendor/bundle/ruby/3.4.0/gems/securerandom-0.4.1/README.md +72 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/README.md +45 -0
- data/vendor/bundle/ruby/3.4.0/gems/thor-1.3.2/thor.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/CHANGELOG.md +410 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/LICENSE +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/README.md +588 -0
- data/vendor/bundle/ruby/3.4.0/gems/typhoeus-1.4.1/typhoeus.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/LICENSE +19 -0
- data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/README.md +406 -0
- data/vendor/bundle/ruby/3.4.0/gems/uri-1.0.2/README.md +55 -0
- data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/README.md +42 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/CHANGELOG.md +2104 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/LICENSE +20 -0
- data/vendor/bundle/ruby/3.4.0/gems/webmock-3.24.0/README.md +1222 -0
- data/vendor/bundle/ruby/3.4.0/specifications/actionpack-8.0.1.gemspec +36 -0
- data/vendor/bundle/ruby/3.4.0/specifications/actionview-8.0.1.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/activemodel-8.0.1.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/activesupport-8.0.1.gemspec +38 -0
- data/vendor/bundle/ruby/3.4.0/specifications/addressable-2.8.7.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/appraisal-2.5.0.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/base64-0.2.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/benchmark-0.4.0.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/bigdecimal-3.1.9.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/builder-3.3.0.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/concurrent-ruby-1.3.5.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/connection_pool-2.5.0.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/crack-1.0.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/crass-1.0.6.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/diff-lcs-1.5.1.gemspec +37 -0
- data/vendor/bundle/ruby/3.4.0/specifications/drb-2.2.1.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/erubi-1.13.1.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/ethon-0.16.0.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/ffi-1.17.1-x86_64-linux-gnu.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/hashdiff-1.1.2.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/i18n-1.14.6.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/json-2.9.1.gemspec +0 -0
- data/vendor/bundle/ruby/3.4.0/specifications/logger-1.6.5.gemspec +22 -0
- data/vendor/bundle/ruby/3.4.0/specifications/loofah-2.24.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/minitest-5.25.4.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/multi_json-1.15.0.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/nokogiri-1.18.1-x86_64-linux-gnu.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/public_suffix-6.0.1.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-3.1.8.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-session-2.1.0.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rack-test-2.2.0.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rails-dom-testing-2.2.0.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rails-html-sanitizer-1.6.2.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rake-13.2.1.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rake-release-1.3.0.gemspec +26 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rexml-3.4.0.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-3.13.0.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-collection_matchers-1.2.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-core-3.13.2.gemspec +39 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-expectations-3.13.3.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-its-2.0.0.gemspec +27 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-mocks-3.13.2.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-support-3.13.2.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/securerandom-0.4.1.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/thor-1.3.2.gemspec +28 -0
- data/vendor/bundle/ruby/3.4.0/specifications/typhoeus-1.4.1.gemspec +24 -0
- data/vendor/bundle/ruby/3.4.0/specifications/tzinfo-2.0.6.gemspec +30 -0
- data/vendor/bundle/ruby/3.4.0/specifications/uri-1.0.2.gemspec +23 -0
- data/vendor/bundle/ruby/3.4.0/specifications/useragent-0.16.11.gemspec +25 -0
- data/vendor/bundle/ruby/3.4.0/specifications/webmock-3.24.0.gemspec +45 -0
- metadata +204 -67
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2012 Liu Fengyun
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
@@ -0,0 +1,298 @@
|
|
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` and `:use_lcs`
|
99
|
+
|
100
|
+
#### `:delimiter`
|
101
|
+
|
102
|
+
You can specify `:delimiter` to be something other than the default dot. For example:
|
103
|
+
|
104
|
+
```ruby
|
105
|
+
a = {a:{x:2, y:3, z:4}, b:{x:3, z:45}}
|
106
|
+
b = {a:{y:3}, b:{y:3, z:30}}
|
107
|
+
|
108
|
+
diff = Hashdiff.diff(a, b, delimiter: '\t')
|
109
|
+
diff.should == [['-', 'a\tx', 2], ['-', 'a\tz', 4], ['-', 'b\tx', 3], ['~', 'b\tz', 45, 30], ['+', 'b\ty', 3]]
|
110
|
+
```
|
111
|
+
|
112
|
+
#### `:similarity`
|
113
|
+
|
114
|
+
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).
|
115
|
+
|
116
|
+
#### `:strict`
|
117
|
+
|
118
|
+
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).
|
119
|
+
|
120
|
+
#### `:ignore_keys`
|
121
|
+
|
122
|
+
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:
|
123
|
+
|
124
|
+
```ruby
|
125
|
+
a = { a: 4, g: 0, b: { a: 5, c: 6, e: 1 } }
|
126
|
+
b = { b: { a: 7, c: 3, f: 1 }, d: 8 }
|
127
|
+
diff = Hashdiff.diff(a, b, ignore_keys: %i[a f])
|
128
|
+
diff.should == [['-', 'g', 0], ['-', 'b.e', 1], ['~', 'b.c', 6, 3], ['+', 'd', 8]]
|
129
|
+
```
|
130
|
+
If you wish instead to ignore keys at a particlar level you should
|
131
|
+
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:
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
a = { a: 4, g: 0, b: { a: 5, c: 6, e: 1 } }
|
135
|
+
b = { b: { a: 7, c: 3, f: 1 }, d: 8 }
|
136
|
+
diff = Hashdiff.diff(a, b) do |path, _e, _a|
|
137
|
+
arr = path.split('.')
|
138
|
+
true if %w[a f].include?(arr.last) && arr.size == 2 # note '.' is the default delimiter
|
139
|
+
end
|
140
|
+
diff.should == [['-', 'a', 4], ['-', 'g', 0], ['-', 'b.e', 1], ['~', 'b.c', 6, 3], ['+', 'd', 8]]
|
141
|
+
```
|
142
|
+
|
143
|
+
#### `:indifferent`
|
144
|
+
|
145
|
+
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})
|
146
|
+
|
147
|
+
#### `:numeric_tolerance`
|
148
|
+
|
149
|
+
The :numeric_tolerance option allows for a small numeric tolerance.
|
150
|
+
|
151
|
+
```ruby
|
152
|
+
a = {x:5, y:3.75, z:7}
|
153
|
+
b = {x:6, y:3.76, z:7}
|
154
|
+
|
155
|
+
diff = Hashdiff.diff(a, b, numeric_tolerance: 0.1)
|
156
|
+
diff.should == [["~", "x", 5, 6]]
|
157
|
+
```
|
158
|
+
|
159
|
+
#### `:strip`
|
160
|
+
|
161
|
+
The :strip option strips all strings before comparing.
|
162
|
+
|
163
|
+
```ruby
|
164
|
+
a = {x:5, s:'foo '}
|
165
|
+
b = {x:6, s:'foo'}
|
166
|
+
|
167
|
+
diff = Hashdiff.diff(a, b, numeric_tolerance: 0.1, strip: true)
|
168
|
+
diff.should == [["~", "x", 5, 6]]
|
169
|
+
```
|
170
|
+
|
171
|
+
#### `:case_insensitive`
|
172
|
+
|
173
|
+
The :case_insensitive option makes string comparisons ignore case.
|
174
|
+
|
175
|
+
```ruby
|
176
|
+
a = {x:5, s:'FooBar'}
|
177
|
+
b = {x:6, s:'foobar'}
|
178
|
+
|
179
|
+
diff = Hashdiff.diff(a, b, numeric_tolerance: 0.1, case_insensitive: true)
|
180
|
+
diff.should == [["~", "x", 5, 6]]
|
181
|
+
```
|
182
|
+
|
183
|
+
#### `:array_path`
|
184
|
+
|
185
|
+
The :array_path option represents the path of the diff in an array rather than
|
186
|
+
a string. This can be used to show differences in between hash key types and
|
187
|
+
is useful for `patch!` when used on hashes without string keys.
|
188
|
+
|
189
|
+
```ruby
|
190
|
+
a = {x:5}
|
191
|
+
b = {'x'=>6}
|
192
|
+
|
193
|
+
diff = Hashdiff.diff(a, b, array_path: true)
|
194
|
+
diff.should == [['-', [:x], 5], ['+', ['x'], 6]]
|
195
|
+
```
|
196
|
+
|
197
|
+
For cases where there are arrays in paths their index will be added to the path.
|
198
|
+
```ruby
|
199
|
+
a = {x:[0,1]}
|
200
|
+
b = {x:[0,2]}
|
201
|
+
|
202
|
+
diff = Hashdiff.diff(a, b, array_path: true)
|
203
|
+
diff.should == [["-", [:x, 1], 1], ["+", [:x, 1], 2]]
|
204
|
+
```
|
205
|
+
|
206
|
+
This shouldn't cause problems if you are comparing an array with a hash:
|
207
|
+
|
208
|
+
```ruby
|
209
|
+
a = {x:{0=>1}}
|
210
|
+
b = {x:[1]}
|
211
|
+
|
212
|
+
diff = Hashdiff.diff(a, b, array_path: true)
|
213
|
+
diff.should == [["~", [:x], {0=>1}, [1]]]
|
214
|
+
```
|
215
|
+
|
216
|
+
#### `:use_lcs`
|
217
|
+
|
218
|
+
The :use_lcs option is used to specify whether a
|
219
|
+
[Longest common subsequence](https://en.wikipedia.org/wiki/Longest_common_subsequence_problem)
|
220
|
+
(LCS) algorithm is used to determine differences in arrays. This defaults to
|
221
|
+
`true` but can be changed to `false` for significantly faster array comparisons
|
222
|
+
(O(n) complexity rather than O(n<sup>2</sup>) for LCS).
|
223
|
+
|
224
|
+
When :use_lcs is false the results of array comparisons have a tendency to
|
225
|
+
show changes at indexes rather than additions and subtractions when :use_lcs is
|
226
|
+
true.
|
227
|
+
|
228
|
+
Note, currently the :similarity option has no effect when :use_lcs is false.
|
229
|
+
|
230
|
+
```ruby
|
231
|
+
a = {x: [0, 1, 2]}
|
232
|
+
b = {x: [0, 2, 2, 3]}
|
233
|
+
|
234
|
+
diff = Hashdiff.diff(a, b, use_lcs: false)
|
235
|
+
diff.should == [["~", "x[1]", 1, 2], ["+", "x[3]", 3]]
|
236
|
+
```
|
237
|
+
|
238
|
+
#### Specifying a custom comparison method
|
239
|
+
|
240
|
+
It's possible to specify how the values of a key should be compared.
|
241
|
+
|
242
|
+
```ruby
|
243
|
+
a = {a:'car', b:'boat', c:'plane'}
|
244
|
+
b = {a:'bus', b:'truck', c:' plan'}
|
245
|
+
|
246
|
+
diff = Hashdiff.diff(a, b) do |path, obj1, obj2|
|
247
|
+
case path
|
248
|
+
when /a|b|c/
|
249
|
+
obj1.length == obj2.length
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
diff.should == [['~', 'b', 'boat', 'truck']]
|
254
|
+
```
|
255
|
+
|
256
|
+
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:
|
257
|
+
|
258
|
+
```ruby
|
259
|
+
a = {a:'car', b:['boat', 'plane'] }
|
260
|
+
b = {a:'bus', b:['truck', ' plan'] }
|
261
|
+
|
262
|
+
diff = Hashdiff.diff(a, b) do |path, obj1, obj2|
|
263
|
+
case path
|
264
|
+
when 'b[*]'
|
265
|
+
obj1.length == obj2.length
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
diff.should == [["~", "a", "car", "bus"], ["~", "b[1]", "plane", " plan"], ["-", "b[0]", "boat"], ["+", "b[0]", "truck"]]
|
270
|
+
```
|
271
|
+
|
272
|
+
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.
|
273
|
+
|
274
|
+
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.
|
275
|
+
|
276
|
+
#### Sorting arrays before comparison
|
277
|
+
|
278
|
+
An order difference alone between two arrays can create too many diffs to be useful. Consider sorting them prior to diffing.
|
279
|
+
|
280
|
+
```ruby
|
281
|
+
a = {a:'car', b:['boat', 'plane'] }
|
282
|
+
b = {a:'car', b:['plane', 'boat'] }
|
283
|
+
|
284
|
+
Hashdiff.diff(a, b).should == [["+", "b[0]", "plane"], ["-", "b[2]", "plane"]]
|
285
|
+
|
286
|
+
b[:b].sort!
|
287
|
+
|
288
|
+
Hashdiff.diff(a, b).should == []
|
289
|
+
```
|
290
|
+
|
291
|
+
## Maintainers
|
292
|
+
|
293
|
+
- Krzysztof Rybka ([@krzysiek1507](https://github.com/krzysiek1507))
|
294
|
+
- Fengyun Liu ([@liufengyun](https://github.com/liufengyun))
|
295
|
+
|
296
|
+
## License
|
297
|
+
|
298
|
+
Hashdiff is distributed under the MIT-LICENSE.
|
@@ -0,0 +1,119 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## v1.1.2 2024-11-12
|
4
|
+
|
5
|
+
* Fix bundler cache #96 (@olleolleolle)
|
6
|
+
* Quote the '3.0' in YAML #95 (@olleolleolle)
|
7
|
+
* Fix version in source code #97 (@liufengyun)
|
8
|
+
|
9
|
+
## v1.1.1 2024-08-02
|
10
|
+
|
11
|
+
* Fix bug in ignore_keys option #88 (@Matzfan)
|
12
|
+
* Exclude spec files from gem package #94 (@amatsuda)
|
13
|
+
|
14
|
+
## v1.1.0 2023-12-14
|
15
|
+
|
16
|
+
* Add ignore_keys option (#86 @Matzfan)
|
17
|
+
* Remove pinned version of rake < 11
|
18
|
+
* Bump rspec dep ~> 3.5
|
19
|
+
* Bump rubocop dep >= 1.52.1
|
20
|
+
* Bump rubocop-rspec dep > 1.16.0
|
21
|
+
|
22
|
+
## v1.0.1 2020-02-25
|
23
|
+
|
24
|
+
* Add indifferent option
|
25
|
+
|
26
|
+
## v1.0.0 2019-06-06
|
27
|
+
|
28
|
+
* Fix typo in readme (#72 @koic)
|
29
|
+
* Fix Rubocop offence (#73 @koic)
|
30
|
+
* Bumps version to v1.0.0 (#74 @jfelchner)
|
31
|
+
|
32
|
+
## v1.0.0.beta1 2019-06-06
|
33
|
+
|
34
|
+
* fix warnings in ci (#69 @y-yagi)
|
35
|
+
* drop warnings of the constant change (#70 @jfelchner)
|
36
|
+
|
37
|
+
## v0.4.0 2019-05-28
|
38
|
+
|
39
|
+
* refactoring (#56 #57 #59 #61 krzysiek1507)
|
40
|
+
* fix typo in README (#64 @pboling)
|
41
|
+
* change HashDiff to Hashdiff (#65 @jfelchner)
|
42
|
+
|
43
|
+
## v0.3.9 2019-04-22
|
44
|
+
|
45
|
+
* Performance tweak (thanks @krzysiek1507: #51 #52 #53)
|
46
|
+
|
47
|
+
## v0.3.8 2018-12-30
|
48
|
+
|
49
|
+
* Add Rubocop and drops Ruby 1.9 support #47
|
50
|
+
|
51
|
+
## v0.3.7 2017-10-08
|
52
|
+
|
53
|
+
* remove 1.8.7 support from gemspec #39
|
54
|
+
|
55
|
+
## v0.3.6 2017-08-22
|
56
|
+
|
57
|
+
* add option `use_lcs` #35
|
58
|
+
|
59
|
+
## v0.3.5 2017-08-06
|
60
|
+
|
61
|
+
* add option `array_path` #34
|
62
|
+
|
63
|
+
## v0.3.4 2017-05-01
|
64
|
+
|
65
|
+
* performance improvement of `#similar?` #31
|
66
|
+
|
67
|
+
## v0.3.2 2016-12-27
|
68
|
+
|
69
|
+
* replace `Fixnum` by `Integer` #28
|
70
|
+
|
71
|
+
## v0.3.1 2016-11-24
|
72
|
+
|
73
|
+
* fix an error when a hash has mixed types #26
|
74
|
+
|
75
|
+
## v0.3.0 2016-2-11
|
76
|
+
|
77
|
+
* support `:case_insensitive` option
|
78
|
+
|
79
|
+
## v0.2.3 2015-11-5
|
80
|
+
|
81
|
+
* improve performance of LCS algorithm #12
|
82
|
+
|
83
|
+
## v0.2.2 2014-10-6
|
84
|
+
|
85
|
+
* make library 1.8.7 compatible
|
86
|
+
|
87
|
+
## v0.2.1 2014-7-13
|
88
|
+
|
89
|
+
* yield added/deleted keys for custom comparison
|
90
|
+
|
91
|
+
## v0.2.0 2014-3-29
|
92
|
+
|
93
|
+
* support custom comparison blocks
|
94
|
+
* support `:strip`, `:numeric_tolerance` and `:strict` options
|
95
|
+
|
96
|
+
## v0.1.0 2013-8-25
|
97
|
+
|
98
|
+
* use options for parameters `:delimiter` and `:similarity` in interfaces
|
99
|
+
|
100
|
+
## v0.0.6 2013-3-2
|
101
|
+
|
102
|
+
* Add parameter for custom property-path delimiter.
|
103
|
+
|
104
|
+
## v0.0.5 2012-7-1
|
105
|
+
|
106
|
+
* fix a bug in judging whehter two objects are similiar.
|
107
|
+
* add more spec test for `.best_diff`
|
108
|
+
|
109
|
+
## v0.0.4 2012-6-24
|
110
|
+
|
111
|
+
Main changes in this version is to output the whole object in addition & deletion, instead of recursely add/deletes the object.
|
112
|
+
|
113
|
+
For example, `diff({a:2, c:[4, 5]}, {a:2}) will generate following output:
|
114
|
+
|
115
|
+
[['-', 'c', [4, 5]]]
|
116
|
+
|
117
|
+
instead of following:
|
118
|
+
|
119
|
+
[['-', '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,20 @@
|
|
1
|
+
Copyright (c) 2008 The Ruby I18n team
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# Ruby I18n
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/i18n.svg)](https://badge.fury.io/rb/i18n)
|
4
|
+
[![Build Status](https://github.com/ruby-i18n/i18n/workflows/Ruby/badge.svg)](https://github.com/ruby-i18n/i18n/actions?query=workflow%3ARuby)
|
5
|
+
|
6
|
+
Ruby internationalization and localization (i18n) solution.
|
7
|
+
|
8
|
+
Currently maintained by @radar.
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
### Rails
|
13
|
+
|
14
|
+
You will most commonly use this library within a Rails app.
|
15
|
+
|
16
|
+
We support Rails versions from 6.0 and up.
|
17
|
+
|
18
|
+
[See the Rails Guide](https://guides.rubyonrails.org/i18n.html) for an example of its usage.
|
19
|
+
|
20
|
+
### Ruby (without Rails)
|
21
|
+
|
22
|
+
We support Ruby versions from 3.0 and up.
|
23
|
+
|
24
|
+
If you want to use this library without Rails, you can simply add `i18n` to your `Gemfile`:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
gem 'i18n'
|
28
|
+
```
|
29
|
+
|
30
|
+
Then configure I18n with some translations, and a default locale:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
I18n.load_path += Dir[File.expand_path("config/locales") + "/*.yml"]
|
34
|
+
I18n.default_locale = :en # (note that `en` is already the default!)
|
35
|
+
```
|
36
|
+
|
37
|
+
A simple translation file in your project might live at `config/locales/en.yml` and look like:
|
38
|
+
|
39
|
+
```yml
|
40
|
+
en:
|
41
|
+
test: "This is a test"
|
42
|
+
```
|
43
|
+
|
44
|
+
You can then access this translation by doing:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
I18n.t(:test)
|
48
|
+
```
|
49
|
+
|
50
|
+
You can switch locales in your project by setting `I18n.locale` to a different value:
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
I18n.locale = :de
|
54
|
+
I18n.t(:test) # => "Dies ist ein Test"
|
55
|
+
```
|
56
|
+
|
57
|
+
## Features
|
58
|
+
|
59
|
+
* Translation and localization
|
60
|
+
* Interpolation of values to translations
|
61
|
+
* Pluralization (CLDR compatible)
|
62
|
+
* Customizable transliteration to ASCII
|
63
|
+
* Flexible defaults
|
64
|
+
* Bulk lookup
|
65
|
+
* Lambdas as translation data
|
66
|
+
* Custom key/scope separator
|
67
|
+
* Custom exception handlers
|
68
|
+
* Extensible architecture with a swappable backend
|
69
|
+
|
70
|
+
## Pluggable Features
|
71
|
+
|
72
|
+
* Cache
|
73
|
+
* Pluralization: lambda pluralizers stored as translation data
|
74
|
+
* Locale fallbacks, RFC4647 compliant (optionally: RFC4646 locale validation)
|
75
|
+
* [Gettext support](https://github.com/ruby-i18n/i18n/wiki/Gettext)
|
76
|
+
* Translation metadata
|
77
|
+
|
78
|
+
## Alternative Backend
|
79
|
+
|
80
|
+
* Chain
|
81
|
+
* ActiveRecord (optionally: ActiveRecord::Missing and ActiveRecord::StoreProcs)
|
82
|
+
* KeyValue (uses active_support/json and cannot store procs)
|
83
|
+
|
84
|
+
For more information and lots of resources see [the 'Resources' page on the wiki](https://github.com/ruby-i18n/i18n/wiki/Resources).
|
85
|
+
|
86
|
+
## Tests
|
87
|
+
|
88
|
+
You can run tests both with
|
89
|
+
|
90
|
+
* `rake test` or just `rake`
|
91
|
+
* run any test file directly, e.g. `ruby -Ilib:test test/api/simple_test.rb`
|
92
|
+
|
93
|
+
You can run all tests against all Gemfiles with
|
94
|
+
|
95
|
+
* `ruby test/run_all.rb`
|
96
|
+
|
97
|
+
The structure of the test suite is a bit unusual as it uses modules to reuse
|
98
|
+
particular tests in different test cases.
|
99
|
+
|
100
|
+
The reason for this is that we need to enforce the I18n API across various
|
101
|
+
combinations of extensions. E.g. the Simple backend alone needs to support
|
102
|
+
the same API as any combination of feature and/or optimization modules included
|
103
|
+
to the Simple backend. We test this by reusing the same API definition (implemented
|
104
|
+
as test methods) in test cases with different setups.
|
105
|
+
|
106
|
+
You can find the test cases that enforce the API in test/api. And you can find
|
107
|
+
the API definition test methods in test/api/tests.
|
108
|
+
|
109
|
+
All other test cases (e.g. as defined in test/backend, test/core_ext) etc.
|
110
|
+
follow the usual test setup and should be easy to grok.
|
111
|
+
|
112
|
+
## More Documentation
|
113
|
+
|
114
|
+
Additional documentation can be found here: https://github.com/ruby-i18n/i18n/wiki
|
115
|
+
|
116
|
+
## Contributors
|
117
|
+
|
118
|
+
* @radar
|
119
|
+
* @carlosantoniodasilva
|
120
|
+
* @josevalim
|
121
|
+
* @knapo
|
122
|
+
* @tigrish
|
123
|
+
* [and many more](https://github.com/ruby-i18n/i18n/graphs/contributors)
|
124
|
+
|
125
|
+
## License
|
126
|
+
|
127
|
+
MIT License. See the included MIT-LICENSE file.
|