cloudsmith-api 0.51.37 → 0.52.79
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +12 -5
- data/build.json +1 -1
- data/docs/AlpinePackageUpload.md +63 -0
- data/docs/ConanPackageUpload.md +1 -0
- data/docs/EntitlementsCreate.md +1 -1
- data/docs/EntitlementsPartialUpdate.md +1 -1
- data/docs/EntitlementsRefresh.md +1 -1
- data/docs/EntitlmentTokenMetric.md +9 -0
- data/docs/MavenPackageUpload.md +1 -0
- data/docs/MetricsApi.md +83 -0
- data/docs/Package.md +2 -0
- data/docs/PackageCopy.md +2 -0
- data/docs/PackageMove.md +2 -0
- data/docs/PackagesApi.md +107 -41
- data/docs/PackagesCopy.md +1 -1
- data/docs/PackagesMove.md +0 -1
- data/docs/PackagesTag.md +10 -0
- data/docs/PackagesUploadAlpine.md +1 -0
- data/docs/PackagesUploadCargo.md +1 -0
- data/docs/PackagesUploadCocoapods.md +1 -0
- data/docs/PackagesUploadComposer.md +1 -0
- data/docs/PackagesUploadConan.md +3 -0
- data/docs/PackagesUploadCran.md +1 -0
- data/docs/PackagesUploadDart.md +1 -0
- data/docs/PackagesUploadDeb.md +3 -0
- data/docs/PackagesUploadDocker.md +1 -0
- data/docs/PackagesUploadGo.md +1 -0
- data/docs/PackagesUploadHelm.md +1 -0
- data/docs/PackagesUploadLuarocks.md +1 -0
- data/docs/PackagesUploadMaven.md +1 -0
- data/docs/PackagesUploadNpm.md +1 -0
- data/docs/PackagesUploadNuget.md +1 -0
- data/docs/PackagesUploadPython.md +1 -0
- data/docs/PackagesUploadRaw.md +1 -0
- data/docs/PackagesUploadRpm.md +1 -0
- data/docs/PackagesUploadRuby.md +1 -0
- data/docs/PackagesUploadTerraform.md +1 -0
- data/docs/PackagesUploadVagrant.md +1 -0
- data/docs/PackagesValidateuploadAlpine.md +1 -0
- data/docs/PackagesValidateuploadCargo.md +1 -0
- data/docs/PackagesValidateuploadCocoapods.md +1 -0
- data/docs/PackagesValidateuploadComposer.md +1 -0
- data/docs/PackagesValidateuploadConan.md +3 -0
- data/docs/PackagesValidateuploadCran.md +1 -0
- data/docs/PackagesValidateuploadDart.md +1 -0
- data/docs/PackagesValidateuploadDeb.md +3 -0
- data/docs/PackagesValidateuploadDocker.md +1 -0
- data/docs/PackagesValidateuploadGo.md +1 -0
- data/docs/PackagesValidateuploadHelm.md +1 -0
- data/docs/PackagesValidateuploadLuarocks.md +1 -0
- data/docs/PackagesValidateuploadMaven.md +1 -0
- data/docs/PackagesValidateuploadNpm.md +1 -0
- data/docs/PackagesValidateuploadNuget.md +1 -0
- data/docs/PackagesValidateuploadPython.md +1 -0
- data/docs/PackagesValidateuploadRaw.md +1 -0
- data/docs/PackagesValidateuploadRpm.md +1 -0
- data/docs/PackagesValidateuploadRuby.md +1 -0
- data/docs/PackagesValidateuploadTerraform.md +1 -0
- data/docs/PackagesValidateuploadVagrant.md +1 -0
- data/docs/RawPackageUpload.md +1 -0
- data/docs/ReposCreate.md +4 -7
- data/docs/ReposPartialUpdate.md +3 -7
- data/docs/Repository.md +11 -10
- data/docs/RepositoryToken.md +4 -3
- data/docs/RepositoryTokenRefresh.md +4 -3
- data/docs/RepositoryTokenSyncTokens.md +4 -3
- data/docs/RepositoryWebhook.md +1 -0
- data/docs/StorageRegion.md +9 -0
- data/docs/StorageregionsApi.md +122 -0
- data/docs/VagrantPackageUpload.md +1 -0
- data/docs/WebhooksCreate.md +1 -0
- data/docs/WebhooksPartialUpdate.md +1 -0
- data/lib/cloudsmith-api.rb +6 -1
- data/lib/cloudsmith-api/api/metrics_api.rb +95 -0
- data/lib/cloudsmith-api/api/packages_api.rb +119 -56
- data/lib/cloudsmith-api/api/storageregions_api.rb +119 -0
- data/lib/cloudsmith-api/models/alpine_package_upload.rb +743 -0
- data/lib/cloudsmith-api/models/conan_package_upload.rb +11 -1
- data/lib/cloudsmith-api/models/entitlements_create.rb +1 -1
- data/lib/cloudsmith-api/models/entitlements_partial_update.rb +1 -1
- data/lib/cloudsmith-api/models/entitlements_refresh.rb +1 -1
- data/lib/cloudsmith-api/models/entitlment_token_metric.rb +209 -0
- data/lib/cloudsmith-api/models/maven_package_upload.rb +11 -1
- data/lib/cloudsmith-api/models/package.rb +21 -1
- data/lib/cloudsmith-api/models/package_copy.rb +21 -1
- data/lib/cloudsmith-api/models/package_move.rb +21 -1
- data/lib/cloudsmith-api/models/packages_copy.rb +1 -1
- data/lib/cloudsmith-api/models/packages_move.rb +4 -14
- data/lib/cloudsmith-api/models/packages_tag.rb +211 -0
- data/lib/cloudsmith-api/models/packages_upload_alpine.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_cargo.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_cocoapods.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_composer.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_conan.rb +34 -4
- data/lib/cloudsmith-api/models/packages_upload_cran.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_dart.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_deb.rb +34 -4
- data/lib/cloudsmith-api/models/packages_upload_docker.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_go.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_helm.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_luarocks.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_maven.rb +11 -1
- data/lib/cloudsmith-api/models/packages_upload_npm.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_nuget.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_python.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_raw.rb +11 -1
- data/lib/cloudsmith-api/models/packages_upload_rpm.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_ruby.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_terraform.rb +14 -4
- data/lib/cloudsmith-api/models/packages_upload_vagrant.rb +11 -1
- data/lib/cloudsmith-api/models/packages_validateupload_alpine.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_cargo.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_cocoapods.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_composer.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_conan.rb +34 -4
- data/lib/cloudsmith-api/models/packages_validateupload_cran.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_dart.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_deb.rb +34 -4
- data/lib/cloudsmith-api/models/packages_validateupload_docker.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_go.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_helm.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_luarocks.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_maven.rb +11 -1
- data/lib/cloudsmith-api/models/packages_validateupload_npm.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_nuget.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_python.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_raw.rb +11 -1
- data/lib/cloudsmith-api/models/packages_validateupload_rpm.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_ruby.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_terraform.rb +14 -4
- data/lib/cloudsmith-api/models/packages_validateupload_vagrant.rb +11 -1
- data/lib/cloudsmith-api/models/raw_package_upload.rb +11 -1
- data/lib/cloudsmith-api/models/repos_create.rb +17 -57
- data/lib/cloudsmith-api/models/repos_partial_update.rb +4 -44
- data/lib/cloudsmith-api/models/repository.rb +24 -24
- data/lib/cloudsmith-api/models/repository_token.rb +14 -4
- data/lib/cloudsmith-api/models/repository_token_refresh.rb +14 -4
- data/lib/cloudsmith-api/models/repository_token_sync_tokens.rb +14 -4
- data/lib/cloudsmith-api/models/repository_webhook.rb +11 -1
- data/lib/cloudsmith-api/models/{packages_resync.rb → storage_region.rb} +29 -9
- data/lib/cloudsmith-api/models/vagrant_package_upload.rb +11 -1
- data/lib/cloudsmith-api/models/webhooks_create.rb +11 -1
- data/lib/cloudsmith-api/models/webhooks_partial_update.rb +11 -1
- data/lib/cloudsmith-api/version.rb +1 -1
- data/spec/api/metrics_api_spec.rb +53 -0
- data/spec/api/packages_api_spec.rb +32 -18
- data/spec/api/storageregions_api_spec.rb +58 -0
- data/spec/models/alpine_package_upload_spec.rb +372 -0
- data/spec/models/conan_package_upload_spec.rb +6 -0
- data/spec/models/entitlment_token_metric_spec.rb +48 -0
- data/spec/models/maven_package_upload_spec.rb +6 -0
- data/spec/models/package_copy_spec.rb +12 -0
- data/spec/models/package_move_spec.rb +12 -0
- data/spec/models/package_spec.rb +12 -0
- data/spec/models/packages_move_spec.rb +0 -6
- data/spec/models/packages_tag_spec.rb +54 -0
- data/spec/models/packages_upload_alpine_spec.rb +6 -0
- data/spec/models/packages_upload_cargo_spec.rb +6 -0
- data/spec/models/packages_upload_cocoapods_spec.rb +6 -0
- data/spec/models/packages_upload_composer_spec.rb +6 -0
- data/spec/models/packages_upload_conan_spec.rb +18 -0
- data/spec/models/packages_upload_cran_spec.rb +6 -0
- data/spec/models/packages_upload_dart_spec.rb +6 -0
- data/spec/models/packages_upload_deb_spec.rb +18 -0
- data/spec/models/packages_upload_docker_spec.rb +6 -0
- data/spec/models/packages_upload_go_spec.rb +6 -0
- data/spec/models/packages_upload_helm_spec.rb +6 -0
- data/spec/models/packages_upload_luarocks_spec.rb +6 -0
- data/spec/models/packages_upload_maven_spec.rb +6 -0
- data/spec/models/packages_upload_npm_spec.rb +6 -0
- data/spec/models/packages_upload_nuget_spec.rb +6 -0
- data/spec/models/packages_upload_python_spec.rb +6 -0
- data/spec/models/packages_upload_raw_spec.rb +6 -0
- data/spec/models/packages_upload_rpm_spec.rb +6 -0
- data/spec/models/packages_upload_ruby_spec.rb +6 -0
- data/spec/models/packages_upload_terraform_spec.rb +6 -0
- data/spec/models/packages_upload_vagrant_spec.rb +6 -0
- data/spec/models/packages_validateupload_alpine_spec.rb +6 -0
- data/spec/models/packages_validateupload_cargo_spec.rb +6 -0
- data/spec/models/packages_validateupload_cocoapods_spec.rb +6 -0
- data/spec/models/packages_validateupload_composer_spec.rb +6 -0
- data/spec/models/packages_validateupload_conan_spec.rb +18 -0
- data/spec/models/packages_validateupload_cran_spec.rb +6 -0
- data/spec/models/packages_validateupload_dart_spec.rb +6 -0
- data/spec/models/packages_validateupload_deb_spec.rb +18 -0
- data/spec/models/packages_validateupload_docker_spec.rb +6 -0
- data/spec/models/packages_validateupload_go_spec.rb +6 -0
- data/spec/models/packages_validateupload_helm_spec.rb +6 -0
- data/spec/models/packages_validateupload_luarocks_spec.rb +6 -0
- data/spec/models/packages_validateupload_maven_spec.rb +6 -0
- data/spec/models/packages_validateupload_npm_spec.rb +6 -0
- data/spec/models/packages_validateupload_nuget_spec.rb +6 -0
- data/spec/models/packages_validateupload_python_spec.rb +6 -0
- data/spec/models/packages_validateupload_raw_spec.rb +6 -0
- data/spec/models/packages_validateupload_rpm_spec.rb +6 -0
- data/spec/models/packages_validateupload_ruby_spec.rb +6 -0
- data/spec/models/packages_validateupload_terraform_spec.rb +6 -0
- data/spec/models/packages_validateupload_vagrant_spec.rb +6 -0
- data/spec/models/raw_package_upload_spec.rb +6 -0
- data/spec/models/repos_create_spec.rb +3 -21
- data/spec/models/repos_partial_update_spec.rb +0 -24
- data/spec/models/repository_spec.rb +6 -0
- data/spec/models/repository_token_refresh_spec.rb +6 -0
- data/spec/models/repository_token_spec.rb +6 -0
- data/spec/models/repository_token_sync_tokens_spec.rb +6 -0
- data/spec/models/repository_webhook_spec.rb +6 -0
- data/spec/models/{packages_resync_spec.rb → storage_region_spec.rb} +13 -7
- data/spec/models/vagrant_package_upload_spec.rb +6 -0
- data/spec/models/webhooks_create_spec.rb +6 -0
- data/spec/models/webhooks_partial_update_spec.rb +6 -0
- data/vendor/bundle/ruby/2.6.0/cache/diff-lcs-1.4.4.gem +0 -0
- data/vendor/bundle/ruby/2.6.0/cache/json-2.3.1.gem +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.2.17/gem_make.out +1 -1
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.13.1/gem_make.out +2 -2
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/{json-2.3.0 → json-2.3.1}/gem.build_complete +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/{json-2.3.0 → json-2.3.1}/gem_make.out +5 -5
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.3.1/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.3.1/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/{json-2.3.0 → json-2.3.1}/mkmf.log +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/.rspec +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/Code-of-Conduct.md +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/Contributing.md +118 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/History.md +319 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/License.md +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/Manifest.txt +8 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/README.rdoc +10 -10
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/Rakefile +39 -22
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/autotest/discover.rb +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/bin/htmldiff +7 -4
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/bin/ldiff +4 -1
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/docs/COPYING.txt +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/docs/artistic.txt +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/lib/diff-lcs.rb +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs.rb +184 -170
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs/array.rb +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/lib/diff/lcs/backports.rb +9 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs/block.rb +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs/callbacks.rb +15 -12
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs/change.rb +30 -37
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs/htmldiff.rb +17 -16
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs/hunk.rb +156 -74
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs/internals.rb +36 -39
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs/ldiff.rb +46 -42
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/lib/diff/lcs/string.rb +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/spec/change_spec.rb +31 -7
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3/spec/ldiff_spec.rb → diff-lcs-1.4.4/spec/diff_spec.rb} +15 -11
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/fixtures/aX +1 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/fixtures/bXaX +1 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/spec/fixtures/ds1.csv +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/spec/fixtures/ds2.csv +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff +4 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff-c +7 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff-e +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff-f +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/fixtures/ldiff/output.diff-u +5 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/hunk_spec.rb +83 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/issues_spec.rb +154 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/spec/lcs_spec.rb +10 -10
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/ldiff_spec.rb +87 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/spec/patch_spec.rb +93 -99
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/sdiff_spec.rb +214 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/spec/spec_helper.rb +118 -64
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.4.4/spec/traverse_balanced_spec.rb +310 -0
- data/vendor/bundle/ruby/2.6.0/gems/{diff-lcs-1.3 → diff-lcs-1.4.4}/spec/traverse_sequences_spec.rb +28 -28
- data/vendor/bundle/ruby/2.6.0/gems/ffi-1.13.1/ext/ffi_c/Makefile +3 -3
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/.gitignore +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/.travis.yml +2 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/CHANGES.md +33 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/Gemfile +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/README-json-jruby.md +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/README.md +16 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/Rakefile +8 -87
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.1/VERSION +1 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/diagrams/.keep +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/fbuffer/fbuffer.h +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/generator/.sitearchdir.-.json.-.ext.time +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/generator/depend +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/generator/extconf.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/generator/generator.c +71 -1
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/generator/generator.h +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.1/ext/json/ext/generator/generator.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/parser/.sitearchdir.-.json.-.ext.time +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/parser/depend +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/parser/extconf.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/parser/parser.c +71 -70
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/parser/parser.h +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/ext/parser/parser.rl +1 -0
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.1/ext/json/ext/parser/parser.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/ext/json/extconf.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/install.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/ByteListTranscoder.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/Generator.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/GeneratorMethods.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/GeneratorService.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/GeneratorState.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/OptionsReader.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/Parser.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/Parser.rl +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/ParserService.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/RuntimeInfo.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/StringDecoder.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/StringEncoder.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/java/src/json/ext/Utils.java +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/json-java.gemspec +3 -3
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.1/json.gemspec +139 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/json_pure.gemspec +8 -13
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.1/lib/json.rb +412 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/bigdecimal.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/complex.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/core.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/date.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/date_time.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/exception.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/ostruct.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/range.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/rational.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/regexp.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/set.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/struct.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/symbol.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/add/time.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.1/lib/json/common.rb +691 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/ext.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/ext/.keep +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.1/lib/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.1/lib/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/generic_object.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/pure.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/pure/generator.rb +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/pure/parser.rb +2 -2
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/lib/json/version.rb +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/references/rfc7159.txt +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail10.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail11.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail12.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail13.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail14.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail18.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail19.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail2.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail20.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail21.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail22.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail23.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail24.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail25.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail27.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail28.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail3.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail4.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail5.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail6.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail7.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail8.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/fail9.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/obsolete_fail1.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/pass1.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/pass15.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/pass16.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/pass17.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/pass2.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/pass26.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/fixtures/pass3.json +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/json_addition_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/json_common_interface_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/json_encoding_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/json_ext_parser_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/json_fixtures_test.rb +6 -1
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/json_generator_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/json_generic_object_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/json_parser_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/json_string_matching_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tests/test_helper.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tools/diff.sh +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tools/fuzz.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{json-2.3.0 → json-2.3.1}/tools/server.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/specifications/{diff-lcs-1.3.gemspec → diff-lcs-1.4.4.gemspec} +11 -13
- data/vendor/bundle/ruby/2.6.0/specifications/{json-2.3.0.gemspec → json-2.3.1.gemspec} +0 -0
- data/vendor/bundle/ruby/2.6.0/specifications/sys-uname-1.2.1.gemspec +1 -1
- metadata +277 -250
- data/docs/PackagesResync.md +0 -8
- data/vendor/bundle/ruby/2.6.0/cache/diff-lcs-1.3.gem +0 -0
- data/vendor/bundle/ruby/2.6.0/cache/json-2.3.0.gem +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.3.0/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.3.0/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/Contributing.md +0 -83
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/History.md +0 -220
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/autotest/discover.rb +0 -1
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/lib/diff-lcs.rb +0 -3
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/diff_spec.rb +0 -47
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/hunk_spec.rb +0 -72
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/issues_spec.rb +0 -49
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/sdiff_spec.rb +0 -214
- data/vendor/bundle/ruby/2.6.0/gems/diff-lcs-1.3/spec/traverse_balanced_spec.rb +0 -310
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.0/LICENSE +0 -56
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.0/VERSION +0 -1
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.0/ext/json/ext/generator/generator.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.0/ext/json/ext/parser/parser.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.0/json.gemspec +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.0/lib/json.rb +0 -63
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.0/lib/json/common.rb +0 -456
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.0/lib/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/json-2.3.0/lib/json/ext/parser.so +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
aX
|
@@ -0,0 +1 @@
|
|
1
|
+
bXaX
|
File without changes
|
File without changes
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
if String.method_defined?(:encoding)
|
6
|
+
require 'diff/lcs/hunk'
|
7
|
+
|
8
|
+
describe Diff::LCS::Hunk do
|
9
|
+
let(:old_data) { ['Tu a un carté avec {count} itéms'.encode('UTF-16LE')] }
|
10
|
+
let(:new_data) { ['Tu a un carte avec {count} items'.encode('UTF-16LE')] }
|
11
|
+
let(:pieces) { Diff::LCS.diff old_data, new_data }
|
12
|
+
let(:hunk) { Diff::LCS::Hunk.new(old_data, new_data, pieces[0], 3, 0) }
|
13
|
+
|
14
|
+
it 'produces a unified diff from the two pieces' do
|
15
|
+
expected = <<-EXPECTED.gsub(/^\s+/, '').encode('UTF-16LE').chomp
|
16
|
+
@@ -1 +1 @@
|
17
|
+
-Tu a un carté avec {count} itéms
|
18
|
+
+Tu a un carte avec {count} items
|
19
|
+
EXPECTED
|
20
|
+
|
21
|
+
expect(hunk.diff(:unified)).to eq(expected)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'produces a unified diff from the two pieces (last entry)' do
|
25
|
+
expected = <<-EXPECTED.gsub(/^\s+/, '').encode('UTF-16LE').chomp
|
26
|
+
@@ -1 +1 @@
|
27
|
+
-Tu a un carté avec {count} itéms
|
28
|
+
+Tu a un carte avec {count} items
|
29
|
+
\
|
30
|
+
EXPECTED
|
31
|
+
|
32
|
+
expect(hunk.diff(:unified, true)).to eq(expected)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'produces a context diff from the two pieces' do
|
36
|
+
expected = <<-EXPECTED.gsub(/^\s+/, '').encode('UTF-16LE').chomp
|
37
|
+
***************
|
38
|
+
*** 1 ****
|
39
|
+
! Tu a un carté avec {count} itéms
|
40
|
+
--- 1 ----
|
41
|
+
! Tu a un carte avec {count} items
|
42
|
+
EXPECTED
|
43
|
+
|
44
|
+
expect(hunk.diff(:context)).to eq(expected)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'produces an old diff from the two pieces' do
|
48
|
+
expected = <<-EXPECTED.gsub(/^ +/, '').encode('UTF-16LE').chomp
|
49
|
+
1c1
|
50
|
+
< Tu a un carté avec {count} itéms
|
51
|
+
---
|
52
|
+
> Tu a un carte avec {count} items
|
53
|
+
|
54
|
+
EXPECTED
|
55
|
+
|
56
|
+
expect(hunk.diff(:old)).to eq(expected)
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'produces a reverse ed diff from the two pieces' do
|
60
|
+
expected = <<-EXPECTED.gsub(/^ +/, '').encode('UTF-16LE').chomp
|
61
|
+
c1
|
62
|
+
Tu a un carte avec {count} items
|
63
|
+
.
|
64
|
+
|
65
|
+
EXPECTED
|
66
|
+
|
67
|
+
expect(hunk.diff(:reverse_ed)).to eq(expected)
|
68
|
+
end
|
69
|
+
|
70
|
+
context 'with empty first data set' do
|
71
|
+
let(:old_data) { [] }
|
72
|
+
|
73
|
+
it 'produces a unified diff' do
|
74
|
+
expected = <<-EXPECTED.gsub(/^\s+/, '').encode('UTF-16LE').chomp
|
75
|
+
@@ -1 +1,2 @@
|
76
|
+
+Tu a un carte avec {count} items
|
77
|
+
EXPECTED
|
78
|
+
|
79
|
+
expect(hunk.diff(:unified)).to eq(expected)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,154 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'diff/lcs/hunk'
|
5
|
+
|
6
|
+
describe 'Diff::LCS Issues' do
|
7
|
+
include Diff::LCS::SpecHelper::Matchers
|
8
|
+
|
9
|
+
describe 'issue #1' do
|
10
|
+
shared_examples 'handles simple diffs' do |s1, s2, forward_diff|
|
11
|
+
before do
|
12
|
+
@diff_s1_s2 = Diff::LCS.diff(s1, s2)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'creates the correct diff' do
|
16
|
+
expect(change_diff(forward_diff)).to eq(@diff_s1_s2)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'creates the correct patch s1->s2' do
|
20
|
+
expect(Diff::LCS.patch(s1, @diff_s1_s2)).to eq(s2)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'creates the correct patch s2->s1' do
|
24
|
+
expect(Diff::LCS.patch(s2, @diff_s1_s2)).to eq(s1)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe 'string' do
|
29
|
+
it_has_behavior 'handles simple diffs', 'aX', 'bXaX', [
|
30
|
+
[
|
31
|
+
['+', 0, 'b'],
|
32
|
+
['+', 1, 'X']
|
33
|
+
]
|
34
|
+
]
|
35
|
+
it_has_behavior 'handles simple diffs', 'bXaX', 'aX', [
|
36
|
+
[
|
37
|
+
['-', 0, 'b'],
|
38
|
+
['-', 1, 'X']
|
39
|
+
]
|
40
|
+
]
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'array' do
|
44
|
+
it_has_behavior 'handles simple diffs', %w(a X), %w(b X a X), [
|
45
|
+
[
|
46
|
+
['+', 0, 'b'],
|
47
|
+
['+', 1, 'X']
|
48
|
+
]
|
49
|
+
]
|
50
|
+
it_has_behavior 'handles simple diffs', %w(b X a X), %w(a X), [
|
51
|
+
[
|
52
|
+
['-', 0, 'b'],
|
53
|
+
['-', 1, 'X']
|
54
|
+
]
|
55
|
+
]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'issue #57' do
|
60
|
+
it 'should fail with a correct error' do
|
61
|
+
expect {
|
62
|
+
actual = { :category => 'app.rack.request' }
|
63
|
+
expected = { :category => 'rack.middleware', :title => 'Anonymous Middleware' }
|
64
|
+
expect(actual).to eq(expected)
|
65
|
+
}.to raise_error(RSpec::Expectations::ExpectationNotMetError)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
describe 'issue #60' do
|
70
|
+
it 'should produce unified output with correct context' do
|
71
|
+
old_data = <<-DATA_OLD.strip.split("\n").map(&:chomp)
|
72
|
+
{
|
73
|
+
"name": "x",
|
74
|
+
"description": "hi"
|
75
|
+
}
|
76
|
+
DATA_OLD
|
77
|
+
|
78
|
+
new_data = <<-DATA_NEW.strip.split("\n").map(&:chomp)
|
79
|
+
{
|
80
|
+
"name": "x",
|
81
|
+
"description": "lo"
|
82
|
+
}
|
83
|
+
DATA_NEW
|
84
|
+
|
85
|
+
diff = ::Diff::LCS.diff(old_data, new_data)
|
86
|
+
hunk = ::Diff::LCS::Hunk.new(old_data, new_data, diff.first, 3, 0)
|
87
|
+
|
88
|
+
expect(hunk.diff(:unified)).to eq(<<-EXPECTED.chomp)
|
89
|
+
@@ -1,5 +1,5 @@
|
90
|
+
{
|
91
|
+
"name": "x",
|
92
|
+
- "description": "hi"
|
93
|
+
+ "description": "lo"
|
94
|
+
}
|
95
|
+
EXPECTED
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
describe 'issue #65' do
|
100
|
+
def diff_lines(old_lines, new_lines)
|
101
|
+
file_length_difference = 0
|
102
|
+
previous_hunk = nil
|
103
|
+
output = []
|
104
|
+
|
105
|
+
Diff::LCS.diff(old_lines, new_lines).each do |piece|
|
106
|
+
hunk = Diff::LCS::Hunk.new(old_lines, new_lines, piece, 3, file_length_difference)
|
107
|
+
file_length_difference = hunk.file_length_difference
|
108
|
+
maybe_contiguous_hunks = (previous_hunk.nil? || hunk.merge(previous_hunk))
|
109
|
+
|
110
|
+
output << "#{previous_hunk.diff(:unified)}\n" unless maybe_contiguous_hunks
|
111
|
+
|
112
|
+
previous_hunk = hunk
|
113
|
+
end
|
114
|
+
output << "#{previous_hunk.diff(:unified, true)}\n" unless previous_hunk.nil?
|
115
|
+
output.join
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'should not misplace the new chunk' do
|
119
|
+
old_data = [
|
120
|
+
'recipe[a::default]', 'recipe[b::default]', 'recipe[c::default]',
|
121
|
+
'recipe[d::default]', 'recipe[e::default]', 'recipe[f::default]',
|
122
|
+
'recipe[g::default]', 'recipe[h::default]', 'recipe[i::default]',
|
123
|
+
'recipe[j::default]', 'recipe[k::default]', 'recipe[l::default]',
|
124
|
+
'recipe[m::default]', 'recipe[n::default]'
|
125
|
+
]
|
126
|
+
|
127
|
+
new_data = [
|
128
|
+
'recipe[a::default]', 'recipe[c::default]', 'recipe[d::default]',
|
129
|
+
'recipe[e::default]', 'recipe[f::default]', 'recipe[g::default]',
|
130
|
+
'recipe[h::default]', 'recipe[i::default]', 'recipe[j::default]',
|
131
|
+
'recipe[k::default]', 'recipe[l::default]', 'recipe[m::default]',
|
132
|
+
'recipe[n::default]', 'recipe[o::new]', 'recipe[p::new]',
|
133
|
+
'recipe[q::new]', 'recipe[r::new]'
|
134
|
+
]
|
135
|
+
|
136
|
+
expect(diff_lines(old_data, new_data)).to eq(<<-EODIFF)
|
137
|
+
@@ -1,5 +1,4 @@
|
138
|
+
recipe[a::default]
|
139
|
+
-recipe[b::default]
|
140
|
+
recipe[c::default]
|
141
|
+
recipe[d::default]
|
142
|
+
recipe[e::default]
|
143
|
+
@@ -12,3 +11,7 @@
|
144
|
+
recipe[l::default]
|
145
|
+
recipe[m::default]
|
146
|
+
recipe[n::default]
|
147
|
+
+recipe[o::new]
|
148
|
+
+recipe[p::new]
|
149
|
+
+recipe[q::new]
|
150
|
+
+recipe[r::new]
|
151
|
+
EODIFF
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe Diff::LCS::Internals,
|
5
|
+
describe Diff::LCS::Internals, '.lcs' do
|
6
6
|
include Diff::LCS::SpecHelper::Matchers
|
7
7
|
|
8
|
-
it
|
8
|
+
it 'returns a meaningful LCS array with (seq1, seq2)' do
|
9
9
|
res = Diff::LCS::Internals.lcs(seq1, seq2)
|
10
10
|
# The result of the LCS (less the +nil+ values) must be as long as the
|
11
11
|
# correct result.
|
@@ -20,37 +20,37 @@ describe Diff::LCS::Internals, ".lcs" do
|
|
20
20
|
expect(x_seq2).to eq(correct_lcs)
|
21
21
|
end
|
22
22
|
|
23
|
-
it
|
23
|
+
it 'returns all indexes with (hello, hello)' do
|
24
24
|
expect(Diff::LCS::Internals.lcs(hello, hello)).to \
|
25
25
|
eq((0...hello.size).to_a)
|
26
26
|
end
|
27
27
|
|
28
|
-
it
|
28
|
+
it 'returns all indexes with (hello_ary, hello_ary)' do
|
29
29
|
expect(Diff::LCS::Internals.lcs(hello_ary, hello_ary)).to \
|
30
30
|
eq((0...hello_ary.size).to_a)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
describe Diff::LCS,
|
34
|
+
describe Diff::LCS, '.LCS' do
|
35
35
|
include Diff::LCS::SpecHelper::Matchers
|
36
36
|
|
37
|
-
it
|
37
|
+
it 'returns the correct compacted values from Diff::LCS.LCS' do
|
38
38
|
res = Diff::LCS.LCS(seq1, seq2)
|
39
39
|
expect(res).to eq(correct_lcs)
|
40
40
|
expect(res.compact).to eq(res)
|
41
41
|
end
|
42
42
|
|
43
|
-
it
|
43
|
+
it 'is transitive' do
|
44
44
|
res = Diff::LCS.LCS(seq2, seq1)
|
45
45
|
expect(res).to eq(correct_lcs)
|
46
46
|
expect(res.compact).to eq(res)
|
47
47
|
end
|
48
48
|
|
49
|
-
it
|
49
|
+
it 'returns %W(h e l l o) with (hello, hello)' do
|
50
50
|
expect(Diff::LCS.LCS(hello, hello)).to eq(hello.split(//))
|
51
51
|
end
|
52
52
|
|
53
|
-
it
|
53
|
+
it 'returns hello_ary with (hello_ary, hello_ary)' do
|
54
54
|
expect(Diff::LCS.LCS(hello_ary, hello_ary)).to eq(hello_ary)
|
55
55
|
end
|
56
56
|
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe 'bin/ldiff' do
|
6
|
+
include CaptureSubprocessIO
|
7
|
+
|
8
|
+
fixtures = [
|
9
|
+
{ :name => 'output.diff', :left => 'aX', :right => 'bXaX' },
|
10
|
+
{ :name => 'output.diff.chef', :left => 'old-chef', :right => 'new-chef' },
|
11
|
+
{ :name => 'output.diff.chef2', :left => 'old-chef2', :right => 'new-chef2' }
|
12
|
+
].product([nil, '-e', '-f', '-c', '-u']).map { |(fixture, flag)|
|
13
|
+
fixture = fixture.dup
|
14
|
+
fixture[:flag] = flag
|
15
|
+
fixture
|
16
|
+
}
|
17
|
+
|
18
|
+
def self.test_ldiff(fixture)
|
19
|
+
desc = [
|
20
|
+
fixture[:flag],
|
21
|
+
"spec/fixtures/#{fixture[:left]}",
|
22
|
+
"spec/fixtures/#{fixture[:right]}",
|
23
|
+
'#',
|
24
|
+
'=>',
|
25
|
+
"spec/fixtures/ldiff/#{fixture[:name]}#{fixture[:flag]}"
|
26
|
+
].join(' ')
|
27
|
+
|
28
|
+
it desc do
|
29
|
+
expect(run_ldiff(fixture)).to eq(read_fixture(fixture))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
fixtures.each do |fixture|
|
34
|
+
test_ldiff(fixture)
|
35
|
+
end
|
36
|
+
|
37
|
+
def read_fixture(options)
|
38
|
+
fixture = options.fetch(:name)
|
39
|
+
flag = options.fetch(:flag)
|
40
|
+
name = "spec/fixtures/ldiff/#{fixture}#{flag}"
|
41
|
+
data = IO.__send__(IO.respond_to?(:binread) ? :binread : :read, name)
|
42
|
+
clean_data(data, flag)
|
43
|
+
end
|
44
|
+
|
45
|
+
def clean_data(data, flag)
|
46
|
+
data =
|
47
|
+
case flag
|
48
|
+
when '-c', '-u'
|
49
|
+
clean_output_timestamp(data)
|
50
|
+
else
|
51
|
+
data
|
52
|
+
end
|
53
|
+
data.gsub(/\r\n?/, "\n")
|
54
|
+
end
|
55
|
+
|
56
|
+
def clean_output_timestamp(data)
|
57
|
+
data.gsub(
|
58
|
+
%r{
|
59
|
+
^
|
60
|
+
[-+*]{3}
|
61
|
+
\s*
|
62
|
+
spec/fixtures/(\S+)
|
63
|
+
\s*
|
64
|
+
\d{4}-\d\d-\d\d
|
65
|
+
\s*
|
66
|
+
\d\d:\d\d:\d\d(?:\.\d+)
|
67
|
+
\s*
|
68
|
+
(?:[-+]\d{4}|Z)
|
69
|
+
}x,
|
70
|
+
'*** spec/fixtures/\1 0000-00-00 :00 =>:00 =>00.000000000 -0000'
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
def run_ldiff(options)
|
75
|
+
flag = options.fetch(:flag)
|
76
|
+
left = options.fetch(:left)
|
77
|
+
right = options.fetch(:right)
|
78
|
+
|
79
|
+
stdout, stderr = capture_subprocess_io do
|
80
|
+
system("ruby -Ilib bin/ldiff #{flag} spec/fixtures/#{left} spec/fixtures/#{right}")
|
81
|
+
end
|
82
|
+
|
83
|
+
expect(stderr).to be_empty if RUBY_VERSION >= '1.9'
|
84
|
+
expect(stdout).not_to be_empty
|
85
|
+
clean_data(stdout, flag)
|
86
|
+
end
|
87
|
+
end
|
@@ -1,54 +1,54 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe
|
5
|
+
describe 'Diff::LCS.patch' do
|
6
6
|
include Diff::LCS::SpecHelper::Matchers
|
7
7
|
|
8
|
-
shared_examples
|
9
|
-
it
|
8
|
+
shared_examples 'patch sequences correctly' do
|
9
|
+
it 'correctly patches left-to-right (patch autodiscovery)' do
|
10
10
|
expect(Diff::LCS.patch(s1, patch_set)).to eq(s2)
|
11
11
|
end
|
12
12
|
|
13
|
-
it
|
13
|
+
it 'correctly patches left-to-right (explicit patch)' do
|
14
14
|
expect(Diff::LCS.patch(s1, patch_set, :patch)).to eq(s2)
|
15
15
|
expect(Diff::LCS.patch!(s1, patch_set)).to eq(s2)
|
16
16
|
end
|
17
17
|
|
18
|
-
it
|
18
|
+
it 'correctly patches right-to-left (unpatch autodiscovery)' do
|
19
19
|
expect(Diff::LCS.patch(s2, patch_set)).to eq(s1)
|
20
20
|
end
|
21
21
|
|
22
|
-
it
|
22
|
+
it 'correctly patches right-to-left (explicit unpatch)' do
|
23
23
|
expect(Diff::LCS.patch(s2, patch_set, :unpatch)).to eq(s1)
|
24
24
|
expect(Diff::LCS.unpatch!(s2, patch_set)).to eq(s1)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
describe
|
29
|
-
describe
|
30
|
-
it
|
28
|
+
describe 'using a Diff::LCS.diff patchset' do
|
29
|
+
describe 'an empty patchset returns the source' do
|
30
|
+
it 'works on a string (hello)' do
|
31
31
|
diff = Diff::LCS.diff(hello, hello)
|
32
|
-
expect(Diff::LCS
|
32
|
+
expect(Diff::LCS.patch(hello, diff)).to eq(hello)
|
33
33
|
end
|
34
34
|
|
35
|
-
it
|
35
|
+
it 'works on an array %W(h e l l o)' do
|
36
36
|
diff = Diff::LCS.diff(hello_ary, hello_ary)
|
37
|
-
expect(Diff::LCS
|
37
|
+
expect(Diff::LCS.patch(hello_ary, diff)).to eq(hello_ary)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
describe
|
42
|
-
describe
|
43
|
-
it_has_behavior
|
41
|
+
describe 'with default diff callbacks (DiffCallbacks)' do
|
42
|
+
describe 'forward (s1 -> s2)' do
|
43
|
+
it_has_behavior 'patch sequences correctly' do
|
44
44
|
let(:s1) { seq1 }
|
45
45
|
let(:s2) { seq2 }
|
46
46
|
let(:patch_set) { Diff::LCS.diff(seq1, seq2) }
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
describe
|
51
|
-
it_has_behavior
|
50
|
+
describe 'reverse (s2 -> s1)' do
|
51
|
+
it_has_behavior 'patch sequences correctly' do
|
52
52
|
let(:s1) { seq2 }
|
53
53
|
let(:s2) { seq1 }
|
54
54
|
let(:patch_set) { Diff::LCS.diff(seq2, seq1) }
|
@@ -56,9 +56,9 @@ describe "Diff::LCS.patch" do
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
describe
|
60
|
-
describe
|
61
|
-
it_has_behavior
|
59
|
+
describe 'with context diff callbacks (ContextDiffCallbacks)' do
|
60
|
+
describe 'forward (s1 -> s2)' do
|
61
|
+
it_has_behavior 'patch sequences correctly' do
|
62
62
|
let(:s1) { seq1 }
|
63
63
|
let(:s2) { seq2 }
|
64
64
|
let(:patch_set) {
|
@@ -67,8 +67,8 @@ describe "Diff::LCS.patch" do
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
describe
|
71
|
-
it_has_behavior
|
70
|
+
describe 'reverse (s2 -> s1)' do
|
71
|
+
it_has_behavior 'patch sequences correctly' do
|
72
72
|
let(:s1) { seq2 }
|
73
73
|
let(:s2) { seq1 }
|
74
74
|
let(:patch_set) {
|
@@ -78,9 +78,9 @@ describe "Diff::LCS.patch" do
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
-
describe
|
82
|
-
describe
|
83
|
-
it_has_behavior
|
81
|
+
describe 'with sdiff callbacks (SDiffCallbacks)' do
|
82
|
+
describe 'forward (s1 -> s2)' do
|
83
|
+
it_has_behavior 'patch sequences correctly' do
|
84
84
|
let(:s1) { seq1 }
|
85
85
|
let(:s2) { seq2 }
|
86
86
|
let(:patch_set) {
|
@@ -89,8 +89,8 @@ describe "Diff::LCS.patch" do
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
describe
|
93
|
-
it_has_behavior
|
92
|
+
describe 'reverse (s2 -> s1)' do
|
93
|
+
it_has_behavior 'patch sequences correctly' do
|
94
94
|
let(:s1) { seq2 }
|
95
95
|
let(:s2) { seq1 }
|
96
96
|
let(:patch_set) {
|
@@ -101,20 +101,20 @@ describe "Diff::LCS.patch" do
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
-
describe
|
105
|
-
describe
|
106
|
-
it
|
107
|
-
expect(Diff::LCS
|
104
|
+
describe 'using a Diff::LCS.sdiff patchset' do
|
105
|
+
describe 'an empty patchset returns the source' do
|
106
|
+
it 'works on a string (hello)' do
|
107
|
+
expect(Diff::LCS.patch(hello, Diff::LCS.sdiff(hello, hello))).to eq(hello)
|
108
108
|
end
|
109
109
|
|
110
|
-
it
|
111
|
-
expect(Diff::LCS
|
110
|
+
it 'works on an array %W(h e l l o)' do
|
111
|
+
expect(Diff::LCS.patch(hello_ary, Diff::LCS.sdiff(hello_ary, hello_ary))).to eq(hello_ary)
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
describe
|
116
|
-
describe
|
117
|
-
it_has_behavior
|
115
|
+
describe 'with default diff callbacks (DiffCallbacks)' do
|
116
|
+
describe 'forward (s1 -> s2)' do
|
117
|
+
it_has_behavior 'patch sequences correctly' do
|
118
118
|
let(:s1) { seq1 }
|
119
119
|
let(:s2) { seq2 }
|
120
120
|
let(:patch_set) {
|
@@ -123,8 +123,8 @@ describe "Diff::LCS.patch" do
|
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
|
-
describe
|
127
|
-
it_has_behavior
|
126
|
+
describe 'reverse (s2 -> s1)' do
|
127
|
+
it_has_behavior 'patch sequences correctly' do
|
128
128
|
let(:s1) { seq2 }
|
129
129
|
let(:s2) { seq1 }
|
130
130
|
let(:patch_set) {
|
@@ -134,9 +134,9 @@ describe "Diff::LCS.patch" do
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
-
describe
|
138
|
-
describe
|
139
|
-
it_has_behavior
|
137
|
+
describe 'with context diff callbacks (DiffCallbacks)' do
|
138
|
+
describe 'forward (s1 -> s2)' do
|
139
|
+
it_has_behavior 'patch sequences correctly' do
|
140
140
|
let(:s1) { seq1 }
|
141
141
|
let(:s2) { seq2 }
|
142
142
|
let(:patch_set) {
|
@@ -145,8 +145,8 @@ describe "Diff::LCS.patch" do
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
|
-
describe
|
149
|
-
it_has_behavior
|
148
|
+
describe 'reverse (s2 -> s1)' do
|
149
|
+
it_has_behavior 'patch sequences correctly' do
|
150
150
|
let(:s1) { seq2 }
|
151
151
|
let(:s2) { seq1 }
|
152
152
|
let(:patch_set) {
|
@@ -156,17 +156,17 @@ describe "Diff::LCS.patch" do
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
-
describe
|
160
|
-
describe
|
161
|
-
it_has_behavior
|
159
|
+
describe 'with sdiff callbacks (SDiffCallbacks)' do
|
160
|
+
describe 'forward (s1 -> s2)' do
|
161
|
+
it_has_behavior 'patch sequences correctly' do
|
162
162
|
let(:s1) { seq1 }
|
163
163
|
let(:s2) { seq2 }
|
164
164
|
let(:patch_set) { Diff::LCS.sdiff(seq1, seq2) }
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
168
|
-
describe
|
169
|
-
it_has_behavior
|
168
|
+
describe 'reverse (s2 -> s1)' do
|
169
|
+
it_has_behavior 'patch sequences correctly' do
|
170
170
|
let(:s1) { seq2 }
|
171
171
|
let(:s2) { seq1 }
|
172
172
|
let(:patch_set) { Diff::LCS.sdiff(seq2, seq1) }
|
@@ -179,43 +179,43 @@ describe "Diff::LCS.patch" do
|
|
179
179
|
# to s2 patches"), this cannot use the "patch sequences correctly" shared
|
180
180
|
# set. Once the bug in autodiscovery is fixed, this can be converted as
|
181
181
|
# above.
|
182
|
-
describe
|
182
|
+
describe 'fix bug 891: patchsets do not contain the last equal part' do
|
183
183
|
before :each do
|
184
|
-
@s1 = %w(a b c d e f g h i j k)
|
184
|
+
@s1 = %w(a b c d e f g h i j k) # rubocop:disable Layout/SpaceInsideArrayPercentLiteral
|
185
185
|
@s2 = %w(a b c d D e f g h i j k)
|
186
186
|
end
|
187
187
|
|
188
|
-
describe
|
188
|
+
describe 'using Diff::LCS.diff with default diff callbacks' do
|
189
189
|
before :each do
|
190
190
|
@patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2)
|
191
191
|
@patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1)
|
192
192
|
end
|
193
193
|
|
194
|
-
it
|
194
|
+
it 'autodiscovers s1 to s2 patches' do
|
195
195
|
expect do
|
196
196
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
|
197
197
|
end.to_not raise_error
|
198
198
|
end
|
199
199
|
|
200
|
-
it
|
200
|
+
it 'autodiscovers s2 to s1 patches' do
|
201
201
|
expect do
|
202
202
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
|
203
203
|
end.to_not raise_error
|
204
204
|
end
|
205
205
|
|
206
|
-
it
|
206
|
+
it 'autodiscovers s2 to s1 the left-to-right patches' do
|
207
207
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
|
208
208
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
|
209
209
|
end
|
210
210
|
|
211
|
-
it
|
211
|
+
it 'correctly patches left-to-right (explicit patch)' do
|
212
212
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
|
213
213
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
|
214
214
|
expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
|
215
215
|
expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
|
216
216
|
end
|
217
217
|
|
218
|
-
it
|
218
|
+
it 'correctly patches right-to-left (explicit unpatch)' do
|
219
219
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
|
220
220
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
|
221
221
|
expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
|
@@ -223,39 +223,37 @@ describe "Diff::LCS.patch" do
|
|
223
223
|
end
|
224
224
|
end
|
225
225
|
|
226
|
-
describe
|
226
|
+
describe 'using Diff::LCS.diff with context diff callbacks' do
|
227
227
|
before :each do
|
228
|
-
@patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2,
|
229
|
-
|
230
|
-
@patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1,
|
231
|
-
Diff::LCS::ContextDiffCallbacks)
|
228
|
+
@patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2, Diff::LCS::ContextDiffCallbacks)
|
229
|
+
@patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1, Diff::LCS::ContextDiffCallbacks)
|
232
230
|
end
|
233
231
|
|
234
|
-
it
|
232
|
+
it 'autodiscovers s1 to s2 patches' do
|
235
233
|
expect do
|
236
234
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
|
237
235
|
end.to_not raise_error
|
238
236
|
end
|
239
237
|
|
240
|
-
it
|
238
|
+
it 'autodiscovers s2 to s1 patches' do
|
241
239
|
expect do
|
242
240
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
|
243
241
|
end.to_not raise_error
|
244
242
|
end
|
245
243
|
|
246
|
-
it
|
244
|
+
it 'autodiscovers s2 to s1 the left-to-right patches' do
|
247
245
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
|
248
246
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
|
249
247
|
end
|
250
248
|
|
251
|
-
it
|
249
|
+
it 'correctly patches left-to-right (explicit patch)' do
|
252
250
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
|
253
251
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
|
254
252
|
expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
|
255
253
|
expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
|
256
254
|
end
|
257
255
|
|
258
|
-
it
|
256
|
+
it 'correctly patches right-to-left (explicit unpatch)' do
|
259
257
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
|
260
258
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
|
261
259
|
expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
|
@@ -263,39 +261,37 @@ describe "Diff::LCS.patch" do
|
|
263
261
|
end
|
264
262
|
end
|
265
263
|
|
266
|
-
describe
|
264
|
+
describe 'using Diff::LCS.diff with sdiff callbacks' do
|
267
265
|
before(:each) do
|
268
|
-
@patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2,
|
269
|
-
|
270
|
-
@patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1,
|
271
|
-
Diff::LCS::SDiffCallbacks)
|
266
|
+
@patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2, Diff::LCS::SDiffCallbacks)
|
267
|
+
@patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1, Diff::LCS::SDiffCallbacks)
|
272
268
|
end
|
273
269
|
|
274
|
-
it
|
270
|
+
it 'autodiscovers s1 to s2 patches' do
|
275
271
|
expect do
|
276
272
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
|
277
273
|
end.to_not raise_error
|
278
274
|
end
|
279
275
|
|
280
|
-
it
|
276
|
+
it 'autodiscovers s2 to s1 patches' do
|
281
277
|
expect do
|
282
278
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
|
283
279
|
end.to_not raise_error
|
284
280
|
end
|
285
281
|
|
286
|
-
it
|
282
|
+
it 'autodiscovers s2 to s1 the left-to-right patches' do
|
287
283
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
|
288
284
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
|
289
285
|
end
|
290
286
|
|
291
|
-
it
|
287
|
+
it 'correctly patches left-to-right (explicit patch)' do
|
292
288
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
|
293
289
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
|
294
290
|
expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
|
295
291
|
expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
|
296
292
|
end
|
297
293
|
|
298
|
-
it
|
294
|
+
it 'correctly patches right-to-left (explicit unpatch)' do
|
299
295
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
|
300
296
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
|
301
297
|
expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
|
@@ -303,37 +299,37 @@ describe "Diff::LCS.patch" do
|
|
303
299
|
end
|
304
300
|
end
|
305
301
|
|
306
|
-
describe
|
302
|
+
describe 'using Diff::LCS.sdiff with default sdiff callbacks' do
|
307
303
|
before(:each) do
|
308
304
|
@patch_set_s1_s2 = Diff::LCS.sdiff(@s1, @s2)
|
309
305
|
@patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1)
|
310
306
|
end
|
311
307
|
|
312
|
-
it
|
308
|
+
it 'autodiscovers s1 to s2 patches' do
|
313
309
|
expect do
|
314
310
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
|
315
311
|
end.to_not raise_error
|
316
312
|
end
|
317
313
|
|
318
|
-
it
|
314
|
+
it 'autodiscovers s2 to s1 patches' do
|
319
315
|
expect do
|
320
316
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
|
321
317
|
end.to_not raise_error
|
322
318
|
end
|
323
319
|
|
324
|
-
it
|
320
|
+
it 'autodiscovers s2 to s1 the left-to-right patches' do
|
325
321
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
|
326
322
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
|
327
323
|
end
|
328
324
|
|
329
|
-
it
|
325
|
+
it 'correctly patches left-to-right (explicit patch)' do
|
330
326
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
|
331
327
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
|
332
328
|
expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
|
333
329
|
expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
|
334
330
|
end
|
335
331
|
|
336
|
-
it
|
332
|
+
it 'correctly patches right-to-left (explicit unpatch)' do
|
337
333
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
|
338
334
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
|
339
335
|
expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
|
@@ -341,39 +337,37 @@ describe "Diff::LCS.patch" do
|
|
341
337
|
end
|
342
338
|
end
|
343
339
|
|
344
|
-
describe
|
340
|
+
describe 'using Diff::LCS.sdiff with context diff callbacks' do
|
345
341
|
before(:each) do
|
346
|
-
@patch_set_s1_s2 = Diff::LCS.sdiff(@s1, @s2,
|
347
|
-
|
348
|
-
@patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1,
|
349
|
-
Diff::LCS::ContextDiffCallbacks)
|
342
|
+
@patch_set_s1_s2 = Diff::LCS.sdiff(@s1, @s2, Diff::LCS::ContextDiffCallbacks)
|
343
|
+
@patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1, Diff::LCS::ContextDiffCallbacks)
|
350
344
|
end
|
351
345
|
|
352
|
-
it
|
346
|
+
it 'autodiscovers s1 to s2 patches' do
|
353
347
|
expect do
|
354
348
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
|
355
349
|
end.to_not raise_error
|
356
350
|
end
|
357
351
|
|
358
|
-
it
|
352
|
+
it 'autodiscovers s2 to s1 patches' do
|
359
353
|
expect do
|
360
354
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
|
361
355
|
end.to_not raise_error
|
362
356
|
end
|
363
357
|
|
364
|
-
it
|
358
|
+
it 'autodiscovers s2 to s1 the left-to-right patches' do
|
365
359
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
|
366
360
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
|
367
361
|
end
|
368
362
|
|
369
|
-
it
|
363
|
+
it 'correctly patches left-to-right (explicit patch)' do
|
370
364
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
|
371
365
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
|
372
366
|
expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
|
373
367
|
expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
|
374
368
|
end
|
375
369
|
|
376
|
-
it
|
370
|
+
it 'correctly patches right-to-left (explicit unpatch)' do
|
377
371
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
|
378
372
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
|
379
373
|
expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
|
@@ -381,37 +375,37 @@ describe "Diff::LCS.patch" do
|
|
381
375
|
end
|
382
376
|
end
|
383
377
|
|
384
|
-
describe
|
378
|
+
describe 'using Diff::LCS.sdiff with default diff callbacks' do
|
385
379
|
before(:each) do
|
386
380
|
@patch_set_s1_s2 = Diff::LCS.sdiff(@s1, @s2, Diff::LCS::DiffCallbacks)
|
387
381
|
@patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1, Diff::LCS::DiffCallbacks)
|
388
382
|
end
|
389
383
|
|
390
|
-
it
|
384
|
+
it 'autodiscovers s1 to s2 patches' do
|
391
385
|
expect do
|
392
386
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
|
393
387
|
end.to_not raise_error
|
394
388
|
end
|
395
389
|
|
396
|
-
it
|
390
|
+
it 'autodiscovers s2 to s1 patches' do
|
397
391
|
expect do
|
398
392
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
|
399
393
|
end.to_not raise_error
|
400
394
|
end
|
401
395
|
|
402
|
-
it
|
396
|
+
it 'autodiscovers s2 to s1 the left-to-right patches' do
|
403
397
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
|
404
398
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
|
405
399
|
end
|
406
400
|
|
407
|
-
it
|
401
|
+
it 'correctly patches left-to-right (explicit patch)' do
|
408
402
|
expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
|
409
403
|
expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
|
410
404
|
expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
|
411
405
|
expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
|
412
406
|
end
|
413
407
|
|
414
|
-
it
|
408
|
+
it 'correctly patches right-to-left (explicit unpatch)' do
|
415
409
|
expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
|
416
410
|
expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
|
417
411
|
expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
|