cloudsmith-api 0.51.34 → 0.52.5
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 +14 -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/MavenPackageUpload.md +1 -0
- data/docs/Package.md +2 -0
- data/docs/PackageCopy.md +2 -0
- data/docs/PackageMove.md +2 -0
- data/docs/PackagesApi.md +238 -39
- 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/{PackagesResync.md → PackagesUploadTerraform.md} +3 -1
- 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 +10 -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 +3 -3
- data/docs/RepositoryTokenRefresh.md +3 -3
- data/docs/RepositoryTokenSyncTokens.md +3 -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/packages_api.rb +237 -53
- 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/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 +214 -0
- 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 +214 -0
- 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 +3 -3
- data/lib/cloudsmith-api/models/repository_token_refresh.rb +3 -3
- data/lib/cloudsmith-api/models/repository_token_sync_tokens.rb +3 -3
- 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/packages_api_spec.rb +59 -17
- 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/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 +54 -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 +54 -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_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 +276 -249
- 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
@@ -1,56 +0,0 @@
|
|
1
|
-
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
-
You can redistribute it and/or modify it under either the terms of the
|
3
|
-
2-clause BSDL (see the file BSDL), or the conditions below:
|
4
|
-
|
5
|
-
1. You may make and give away verbatim copies of the source form of the
|
6
|
-
software without restriction, provided that you duplicate all of the
|
7
|
-
original copyright notices and associated disclaimers.
|
8
|
-
|
9
|
-
2. You may modify your copy of the software in any way, provided that
|
10
|
-
you do at least ONE of the following:
|
11
|
-
|
12
|
-
a) place your modifications in the Public Domain or otherwise
|
13
|
-
make them Freely Available, such as by posting said
|
14
|
-
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
-
the author to include your modifications in the software.
|
16
|
-
|
17
|
-
b) use the modified software only within your corporation or
|
18
|
-
organization.
|
19
|
-
|
20
|
-
c) give non-standard binaries non-standard names, with
|
21
|
-
instructions on where to get the original software distribution.
|
22
|
-
|
23
|
-
d) make other distribution arrangements with the author.
|
24
|
-
|
25
|
-
3. You may distribute the software in object code or binary form,
|
26
|
-
provided that you do at least ONE of the following:
|
27
|
-
|
28
|
-
a) distribute the binaries and library files of the software,
|
29
|
-
together with instructions (in the manual page or equivalent)
|
30
|
-
on where to get the original distribution.
|
31
|
-
|
32
|
-
b) accompany the distribution with the machine-readable source of
|
33
|
-
the software.
|
34
|
-
|
35
|
-
c) give non-standard binaries non-standard names, with
|
36
|
-
instructions on where to get the original software distribution.
|
37
|
-
|
38
|
-
d) make other distribution arrangements with the author.
|
39
|
-
|
40
|
-
4. You may modify and include the part of the software into any other
|
41
|
-
software (possibly commercial). But some files in the distribution
|
42
|
-
are not written by the author, so that they are not under these terms.
|
43
|
-
|
44
|
-
For the list of those files and their copying conditions, see the
|
45
|
-
file LEGAL.
|
46
|
-
|
47
|
-
5. The scripts and library files supplied as input to or produced as
|
48
|
-
output from the software do not automatically fall under the
|
49
|
-
copyright of the software, but belong to whomever generated them,
|
50
|
-
and may be sold commercially, and may be aggregated with this
|
51
|
-
software.
|
52
|
-
|
53
|
-
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
-
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
-
PURPOSE.
|
@@ -1 +0,0 @@
|
|
1
|
-
2.3.0
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,63 +0,0 @@
|
|
1
|
-
#frozen_string_literal: false
|
2
|
-
require 'json/common'
|
3
|
-
|
4
|
-
##
|
5
|
-
# = JavaScript Object Notation (JSON)
|
6
|
-
#
|
7
|
-
# JSON is a lightweight data-interchange format. It is easy for us
|
8
|
-
# humans to read and write. Plus, equally simple for machines to generate or parse.
|
9
|
-
# JSON is completely language agnostic, making it the ideal interchange format.
|
10
|
-
#
|
11
|
-
# Built on two universally available structures:
|
12
|
-
# 1. A collection of name/value pairs. Often referred to as an _object_, hash table, record, struct, keyed list, or associative array.
|
13
|
-
# 2. An ordered list of values. More commonly called an _array_, vector, sequence or list.
|
14
|
-
#
|
15
|
-
# To read more about JSON visit: http://json.org
|
16
|
-
#
|
17
|
-
# == Parsing JSON
|
18
|
-
#
|
19
|
-
# To parse a JSON string received by another application or generated within
|
20
|
-
# your existing application:
|
21
|
-
#
|
22
|
-
# require 'json'
|
23
|
-
#
|
24
|
-
# my_hash = JSON.parse('{"hello": "goodbye"}')
|
25
|
-
# puts my_hash["hello"] => "goodbye"
|
26
|
-
#
|
27
|
-
# Notice the extra quotes <tt>''</tt> around the hash notation. Ruby expects
|
28
|
-
# the argument to be a string and can't convert objects like a hash or array.
|
29
|
-
#
|
30
|
-
# Ruby converts your string into a hash
|
31
|
-
#
|
32
|
-
# == Generating JSON
|
33
|
-
#
|
34
|
-
# Creating a JSON string for communication or serialization is
|
35
|
-
# just as simple.
|
36
|
-
#
|
37
|
-
# require 'json'
|
38
|
-
#
|
39
|
-
# my_hash = {:hello => "goodbye"}
|
40
|
-
# puts JSON.generate(my_hash) => "{\"hello\":\"goodbye\"}"
|
41
|
-
#
|
42
|
-
# Or an alternative way:
|
43
|
-
#
|
44
|
-
# require 'json'
|
45
|
-
# puts {:hello => "goodbye"}.to_json => "{\"hello\":\"goodbye\"}"
|
46
|
-
#
|
47
|
-
# <tt>JSON.generate</tt> only allows objects or arrays to be converted
|
48
|
-
# to JSON syntax. <tt>to_json</tt>, however, accepts many Ruby classes
|
49
|
-
# even though it acts only as a method for serialization:
|
50
|
-
#
|
51
|
-
# require 'json'
|
52
|
-
#
|
53
|
-
# 1.to_json => "1"
|
54
|
-
#
|
55
|
-
module JSON
|
56
|
-
require 'json/version'
|
57
|
-
|
58
|
-
begin
|
59
|
-
require 'json/ext'
|
60
|
-
rescue LoadError
|
61
|
-
require 'json/pure'
|
62
|
-
end
|
63
|
-
end
|
@@ -1,456 +0,0 @@
|
|
1
|
-
#frozen_string_literal: false
|
2
|
-
require 'json/version'
|
3
|
-
require 'json/generic_object'
|
4
|
-
|
5
|
-
module JSON
|
6
|
-
class << self
|
7
|
-
# If _object_ is string-like, parse the string and return the parsed
|
8
|
-
# result as a Ruby data structure. Otherwise generate a JSON text from the
|
9
|
-
# Ruby data structure object and return it.
|
10
|
-
#
|
11
|
-
# The _opts_ argument is passed through to generate/parse respectively.
|
12
|
-
# See generate and parse for their documentation.
|
13
|
-
def [](object, opts = {})
|
14
|
-
if object.respond_to? :to_str
|
15
|
-
JSON.parse(object.to_str, opts)
|
16
|
-
else
|
17
|
-
JSON.generate(object, opts)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# Returns the JSON parser class that is used by JSON. This is either
|
22
|
-
# JSON::Ext::Parser or JSON::Pure::Parser.
|
23
|
-
attr_reader :parser
|
24
|
-
|
25
|
-
# Set the JSON parser class _parser_ to be used by JSON.
|
26
|
-
def parser=(parser) # :nodoc:
|
27
|
-
@parser = parser
|
28
|
-
remove_const :Parser if const_defined?(:Parser, false)
|
29
|
-
const_set :Parser, parser
|
30
|
-
end
|
31
|
-
|
32
|
-
# Return the constant located at _path_. The format of _path_ has to be
|
33
|
-
# either ::A::B::C or A::B::C. In any case, A has to be located at the top
|
34
|
-
# level (absolute namespace path?). If there doesn't exist a constant at
|
35
|
-
# the given path, an ArgumentError is raised.
|
36
|
-
def deep_const_get(path) # :nodoc:
|
37
|
-
path.to_s.split(/::/).inject(Object) do |p, c|
|
38
|
-
case
|
39
|
-
when c.empty? then p
|
40
|
-
when p.const_defined?(c, true) then p.const_get(c)
|
41
|
-
else
|
42
|
-
begin
|
43
|
-
p.const_missing(c)
|
44
|
-
rescue NameError => e
|
45
|
-
raise ArgumentError, "can't get const #{path}: #{e}"
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# Set the module _generator_ to be used by JSON.
|
52
|
-
def generator=(generator) # :nodoc:
|
53
|
-
old, $VERBOSE = $VERBOSE, nil
|
54
|
-
@generator = generator
|
55
|
-
generator_methods = generator::GeneratorMethods
|
56
|
-
for const in generator_methods.constants
|
57
|
-
klass = deep_const_get(const)
|
58
|
-
modul = generator_methods.const_get(const)
|
59
|
-
klass.class_eval do
|
60
|
-
instance_methods(false).each do |m|
|
61
|
-
m.to_s == 'to_json' and remove_method m
|
62
|
-
end
|
63
|
-
include modul
|
64
|
-
end
|
65
|
-
end
|
66
|
-
self.state = generator::State
|
67
|
-
const_set :State, self.state
|
68
|
-
const_set :SAFE_STATE_PROTOTYPE, State.new
|
69
|
-
const_set :FAST_STATE_PROTOTYPE, State.new(
|
70
|
-
:indent => '',
|
71
|
-
:space => '',
|
72
|
-
:object_nl => "",
|
73
|
-
:array_nl => "",
|
74
|
-
:max_nesting => false
|
75
|
-
)
|
76
|
-
const_set :PRETTY_STATE_PROTOTYPE, State.new(
|
77
|
-
:indent => ' ',
|
78
|
-
:space => ' ',
|
79
|
-
:object_nl => "\n",
|
80
|
-
:array_nl => "\n"
|
81
|
-
)
|
82
|
-
ensure
|
83
|
-
$VERBOSE = old
|
84
|
-
end
|
85
|
-
|
86
|
-
# Returns the JSON generator module that is used by JSON. This is
|
87
|
-
# either JSON::Ext::Generator or JSON::Pure::Generator.
|
88
|
-
attr_reader :generator
|
89
|
-
|
90
|
-
# Returns the JSON generator state class that is used by JSON. This is
|
91
|
-
# either JSON::Ext::Generator::State or JSON::Pure::Generator::State.
|
92
|
-
attr_accessor :state
|
93
|
-
|
94
|
-
# This is create identifier, which is used to decide if the _json_create_
|
95
|
-
# hook of a class should be called. It defaults to 'json_class'.
|
96
|
-
attr_accessor :create_id
|
97
|
-
end
|
98
|
-
self.create_id = 'json_class'
|
99
|
-
|
100
|
-
NaN = 0.0/0
|
101
|
-
|
102
|
-
Infinity = 1.0/0
|
103
|
-
|
104
|
-
MinusInfinity = -Infinity
|
105
|
-
|
106
|
-
# The base exception for JSON errors.
|
107
|
-
class JSONError < StandardError
|
108
|
-
def self.wrap(exception)
|
109
|
-
obj = new("Wrapped(#{exception.class}): #{exception.message.inspect}")
|
110
|
-
obj.set_backtrace exception.backtrace
|
111
|
-
obj
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
# This exception is raised if a parser error occurs.
|
116
|
-
class ParserError < JSONError; end
|
117
|
-
|
118
|
-
# This exception is raised if the nesting of parsed data structures is too
|
119
|
-
# deep.
|
120
|
-
class NestingError < ParserError; end
|
121
|
-
|
122
|
-
# :stopdoc:
|
123
|
-
class CircularDatastructure < NestingError; end
|
124
|
-
# :startdoc:
|
125
|
-
|
126
|
-
# This exception is raised if a generator or unparser error occurs.
|
127
|
-
class GeneratorError < JSONError; end
|
128
|
-
# For backwards compatibility
|
129
|
-
UnparserError = GeneratorError
|
130
|
-
|
131
|
-
# This exception is raised if the required unicode support is missing on the
|
132
|
-
# system. Usually this means that the iconv library is not installed.
|
133
|
-
class MissingUnicodeSupport < JSONError; end
|
134
|
-
|
135
|
-
module_function
|
136
|
-
|
137
|
-
# Parse the JSON document _source_ into a Ruby data structure and return it.
|
138
|
-
#
|
139
|
-
# _opts_ can have the following
|
140
|
-
# keys:
|
141
|
-
# * *max_nesting*: The maximum depth of nesting allowed in the parsed data
|
142
|
-
# structures. Disable depth checking with :max_nesting => false. It
|
143
|
-
# defaults to 100.
|
144
|
-
# * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
|
145
|
-
# defiance of RFC 7159 to be parsed by the Parser. This option defaults
|
146
|
-
# to false.
|
147
|
-
# * *symbolize_names*: If set to true, returns symbols for the names
|
148
|
-
# (keys) in a JSON object. Otherwise strings are returned. Strings are
|
149
|
-
# the default.
|
150
|
-
# * *create_additions*: If set to false, the Parser doesn't create
|
151
|
-
# additions even if a matching class and create_id was found. This option
|
152
|
-
# defaults to false.
|
153
|
-
# * *object_class*: Defaults to Hash
|
154
|
-
# * *array_class*: Defaults to Array
|
155
|
-
def parse(source, opts = {})
|
156
|
-
Parser.new(source, **(opts||{})).parse
|
157
|
-
end
|
158
|
-
|
159
|
-
# Parse the JSON document _source_ into a Ruby data structure and return it.
|
160
|
-
# The bang version of the parse method defaults to the more dangerous values
|
161
|
-
# for the _opts_ hash, so be sure only to parse trusted _source_ documents.
|
162
|
-
#
|
163
|
-
# _opts_ can have the following keys:
|
164
|
-
# * *max_nesting*: The maximum depth of nesting allowed in the parsed data
|
165
|
-
# structures. Enable depth checking with :max_nesting => anInteger. The
|
166
|
-
# parse! methods defaults to not doing max depth checking: This can be
|
167
|
-
# dangerous if someone wants to fill up your stack.
|
168
|
-
# * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
|
169
|
-
# defiance of RFC 7159 to be parsed by the Parser. This option defaults
|
170
|
-
# to true.
|
171
|
-
# * *create_additions*: If set to false, the Parser doesn't create
|
172
|
-
# additions even if a matching class and create_id was found. This option
|
173
|
-
# defaults to false.
|
174
|
-
def parse!(source, opts = {})
|
175
|
-
opts = {
|
176
|
-
:max_nesting => false,
|
177
|
-
:allow_nan => true
|
178
|
-
}.merge(opts)
|
179
|
-
Parser.new(source, **(opts||{})).parse
|
180
|
-
end
|
181
|
-
|
182
|
-
# Generate a JSON document from the Ruby data structure _obj_ and return
|
183
|
-
# it. _state_ is * a JSON::State object,
|
184
|
-
# * or a Hash like object (responding to to_hash),
|
185
|
-
# * an object convertible into a hash by a to_h method,
|
186
|
-
# that is used as or to configure a State object.
|
187
|
-
#
|
188
|
-
# It defaults to a state object, that creates the shortest possible JSON text
|
189
|
-
# in one line, checks for circular data structures and doesn't allow NaN,
|
190
|
-
# Infinity, and -Infinity.
|
191
|
-
#
|
192
|
-
# A _state_ hash can have the following keys:
|
193
|
-
# * *indent*: a string used to indent levels (default: ''),
|
194
|
-
# * *space*: a string that is put after, a : or , delimiter (default: ''),
|
195
|
-
# * *space_before*: a string that is put before a : pair delimiter (default: ''),
|
196
|
-
# * *object_nl*: a string that is put at the end of a JSON object (default: ''),
|
197
|
-
# * *array_nl*: a string that is put at the end of a JSON array (default: ''),
|
198
|
-
# * *allow_nan*: true if NaN, Infinity, and -Infinity should be
|
199
|
-
# generated, otherwise an exception is thrown if these values are
|
200
|
-
# encountered. This options defaults to false.
|
201
|
-
# * *max_nesting*: The maximum depth of nesting allowed in the data
|
202
|
-
# structures from which JSON is to be generated. Disable depth checking
|
203
|
-
# with :max_nesting => false, it defaults to 100.
|
204
|
-
#
|
205
|
-
# See also the fast_generate for the fastest creation method with the least
|
206
|
-
# amount of sanity checks, and the pretty_generate method for some
|
207
|
-
# defaults for pretty output.
|
208
|
-
def generate(obj, opts = nil)
|
209
|
-
if State === opts
|
210
|
-
state, opts = opts, nil
|
211
|
-
else
|
212
|
-
state = SAFE_STATE_PROTOTYPE.dup
|
213
|
-
end
|
214
|
-
if opts
|
215
|
-
if opts.respond_to? :to_hash
|
216
|
-
opts = opts.to_hash
|
217
|
-
elsif opts.respond_to? :to_h
|
218
|
-
opts = opts.to_h
|
219
|
-
else
|
220
|
-
raise TypeError, "can't convert #{opts.class} into Hash"
|
221
|
-
end
|
222
|
-
state = state.configure(opts)
|
223
|
-
end
|
224
|
-
state.generate(obj)
|
225
|
-
end
|
226
|
-
|
227
|
-
# :stopdoc:
|
228
|
-
# I want to deprecate these later, so I'll first be silent about them, and
|
229
|
-
# later delete them.
|
230
|
-
alias unparse generate
|
231
|
-
module_function :unparse
|
232
|
-
# :startdoc:
|
233
|
-
|
234
|
-
# Generate a JSON document from the Ruby data structure _obj_ and return it.
|
235
|
-
# This method disables the checks for circles in Ruby objects.
|
236
|
-
#
|
237
|
-
# *WARNING*: Be careful not to pass any Ruby data structures with circles as
|
238
|
-
# _obj_ argument because this will cause JSON to go into an infinite loop.
|
239
|
-
def fast_generate(obj, opts = nil)
|
240
|
-
if State === opts
|
241
|
-
state, opts = opts, nil
|
242
|
-
else
|
243
|
-
state = FAST_STATE_PROTOTYPE.dup
|
244
|
-
end
|
245
|
-
if opts
|
246
|
-
if opts.respond_to? :to_hash
|
247
|
-
opts = opts.to_hash
|
248
|
-
elsif opts.respond_to? :to_h
|
249
|
-
opts = opts.to_h
|
250
|
-
else
|
251
|
-
raise TypeError, "can't convert #{opts.class} into Hash"
|
252
|
-
end
|
253
|
-
state.configure(opts)
|
254
|
-
end
|
255
|
-
state.generate(obj)
|
256
|
-
end
|
257
|
-
|
258
|
-
# :stopdoc:
|
259
|
-
# I want to deprecate these later, so I'll first be silent about them, and later delete them.
|
260
|
-
alias fast_unparse fast_generate
|
261
|
-
module_function :fast_unparse
|
262
|
-
# :startdoc:
|
263
|
-
|
264
|
-
# Generate a JSON document from the Ruby data structure _obj_ and return it.
|
265
|
-
# The returned document is a prettier form of the document returned by
|
266
|
-
# #unparse.
|
267
|
-
#
|
268
|
-
# The _opts_ argument can be used to configure the generator. See the
|
269
|
-
# generate method for a more detailed explanation.
|
270
|
-
def pretty_generate(obj, opts = nil)
|
271
|
-
if State === opts
|
272
|
-
state, opts = opts, nil
|
273
|
-
else
|
274
|
-
state = PRETTY_STATE_PROTOTYPE.dup
|
275
|
-
end
|
276
|
-
if opts
|
277
|
-
if opts.respond_to? :to_hash
|
278
|
-
opts = opts.to_hash
|
279
|
-
elsif opts.respond_to? :to_h
|
280
|
-
opts = opts.to_h
|
281
|
-
else
|
282
|
-
raise TypeError, "can't convert #{opts.class} into Hash"
|
283
|
-
end
|
284
|
-
state.configure(opts)
|
285
|
-
end
|
286
|
-
state.generate(obj)
|
287
|
-
end
|
288
|
-
|
289
|
-
# :stopdoc:
|
290
|
-
# I want to deprecate these later, so I'll first be silent about them, and later delete them.
|
291
|
-
alias pretty_unparse pretty_generate
|
292
|
-
module_function :pretty_unparse
|
293
|
-
# :startdoc:
|
294
|
-
|
295
|
-
class << self
|
296
|
-
# The global default options for the JSON.load method:
|
297
|
-
# :max_nesting: false
|
298
|
-
# :allow_nan: true
|
299
|
-
# :allow_blank: true
|
300
|
-
attr_accessor :load_default_options
|
301
|
-
end
|
302
|
-
self.load_default_options = {
|
303
|
-
:max_nesting => false,
|
304
|
-
:allow_nan => true,
|
305
|
-
:allow_blank => true,
|
306
|
-
:create_additions => true,
|
307
|
-
}
|
308
|
-
|
309
|
-
# Load a ruby data structure from a JSON _source_ and return it. A source can
|
310
|
-
# either be a string-like object, an IO-like object, or an object responding
|
311
|
-
# to the read method. If _proc_ was given, it will be called with any nested
|
312
|
-
# Ruby object as an argument recursively in depth first order. To modify the
|
313
|
-
# default options pass in the optional _options_ argument as well.
|
314
|
-
#
|
315
|
-
# BEWARE: This method is meant to serialise data from trusted user input,
|
316
|
-
# like from your own database server or clients under your control, it could
|
317
|
-
# be dangerous to allow untrusted users to pass JSON sources into it. The
|
318
|
-
# default options for the parser can be changed via the load_default_options
|
319
|
-
# method.
|
320
|
-
#
|
321
|
-
# This method is part of the implementation of the load/dump interface of
|
322
|
-
# Marshal and YAML.
|
323
|
-
def load(source, proc = nil, options = {})
|
324
|
-
opts = load_default_options.merge options
|
325
|
-
if source.respond_to? :to_str
|
326
|
-
source = source.to_str
|
327
|
-
elsif source.respond_to? :to_io
|
328
|
-
source = source.to_io.read
|
329
|
-
elsif source.respond_to?(:read)
|
330
|
-
source = source.read
|
331
|
-
end
|
332
|
-
if opts[:allow_blank] && (source.nil? || source.empty?)
|
333
|
-
source = 'null'
|
334
|
-
end
|
335
|
-
result = parse(source, opts)
|
336
|
-
recurse_proc(result, &proc) if proc
|
337
|
-
result
|
338
|
-
end
|
339
|
-
|
340
|
-
# Recursively calls passed _Proc_ if the parsed data structure is an _Array_ or _Hash_
|
341
|
-
def recurse_proc(result, &proc)
|
342
|
-
case result
|
343
|
-
when Array
|
344
|
-
result.each { |x| recurse_proc x, &proc }
|
345
|
-
proc.call result
|
346
|
-
when Hash
|
347
|
-
result.each { |x, y| recurse_proc x, &proc; recurse_proc y, &proc }
|
348
|
-
proc.call result
|
349
|
-
else
|
350
|
-
proc.call result
|
351
|
-
end
|
352
|
-
end
|
353
|
-
|
354
|
-
alias restore load
|
355
|
-
module_function :restore
|
356
|
-
|
357
|
-
class << self
|
358
|
-
# The global default options for the JSON.dump method:
|
359
|
-
# :max_nesting: false
|
360
|
-
# :allow_nan: true
|
361
|
-
# :allow_blank: true
|
362
|
-
attr_accessor :dump_default_options
|
363
|
-
end
|
364
|
-
self.dump_default_options = {
|
365
|
-
:max_nesting => false,
|
366
|
-
:allow_nan => true,
|
367
|
-
}
|
368
|
-
|
369
|
-
# Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns
|
370
|
-
# the result.
|
371
|
-
#
|
372
|
-
# If anIO (an IO-like object or an object that responds to the write method)
|
373
|
-
# was given, the resulting JSON is written to it.
|
374
|
-
#
|
375
|
-
# If the number of nested arrays or objects exceeds _limit_, an ArgumentError
|
376
|
-
# exception is raised. This argument is similar (but not exactly the
|
377
|
-
# same!) to the _limit_ argument in Marshal.dump.
|
378
|
-
#
|
379
|
-
# The default options for the generator can be changed via the
|
380
|
-
# dump_default_options method.
|
381
|
-
#
|
382
|
-
# This method is part of the implementation of the load/dump interface of
|
383
|
-
# Marshal and YAML.
|
384
|
-
def dump(obj, anIO = nil, limit = nil)
|
385
|
-
if anIO and limit.nil?
|
386
|
-
anIO = anIO.to_io if anIO.respond_to?(:to_io)
|
387
|
-
unless anIO.respond_to?(:write)
|
388
|
-
limit = anIO
|
389
|
-
anIO = nil
|
390
|
-
end
|
391
|
-
end
|
392
|
-
opts = JSON.dump_default_options
|
393
|
-
opts = opts.merge(:max_nesting => limit) if limit
|
394
|
-
result = generate(obj, opts)
|
395
|
-
if anIO
|
396
|
-
anIO.write result
|
397
|
-
anIO
|
398
|
-
else
|
399
|
-
result
|
400
|
-
end
|
401
|
-
rescue JSON::NestingError
|
402
|
-
raise ArgumentError, "exceed depth limit"
|
403
|
-
end
|
404
|
-
|
405
|
-
# Encodes string using Ruby's _String.encode_
|
406
|
-
def self.iconv(to, from, string)
|
407
|
-
string.encode(to, from)
|
408
|
-
end
|
409
|
-
end
|
410
|
-
|
411
|
-
module ::Kernel
|
412
|
-
private
|
413
|
-
|
414
|
-
# Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in
|
415
|
-
# one line.
|
416
|
-
def j(*objs)
|
417
|
-
objs.each do |obj|
|
418
|
-
puts JSON::generate(obj, :allow_nan => true, :max_nesting => false)
|
419
|
-
end
|
420
|
-
nil
|
421
|
-
end
|
422
|
-
|
423
|
-
# Outputs _objs_ to STDOUT as JSON strings in a pretty format, with
|
424
|
-
# indentation and over many lines.
|
425
|
-
def jj(*objs)
|
426
|
-
objs.each do |obj|
|
427
|
-
puts JSON::pretty_generate(obj, :allow_nan => true, :max_nesting => false)
|
428
|
-
end
|
429
|
-
nil
|
430
|
-
end
|
431
|
-
|
432
|
-
# If _object_ is string-like, parse the string and return the parsed result as
|
433
|
-
# a Ruby data structure. Otherwise, generate a JSON text from the Ruby data
|
434
|
-
# structure object and return it.
|
435
|
-
#
|
436
|
-
# The _opts_ argument is passed through to generate/parse respectively. See
|
437
|
-
# generate and parse for their documentation.
|
438
|
-
def JSON(object, *args)
|
439
|
-
if object.respond_to? :to_str
|
440
|
-
JSON.parse(object.to_str, args.first)
|
441
|
-
else
|
442
|
-
JSON.generate(object, args.first)
|
443
|
-
end
|
444
|
-
end
|
445
|
-
end
|
446
|
-
|
447
|
-
# Extends any Class to include _json_creatable?_ method.
|
448
|
-
class ::Class
|
449
|
-
# Returns true if this class can be used to create an instance
|
450
|
-
# from a serialised JSON string. The class has to implement a class
|
451
|
-
# method _json_create_ that expects a hash as first parameter. The hash
|
452
|
-
# should include the required data.
|
453
|
-
def json_creatable?
|
454
|
-
respond_to?(:json_create)
|
455
|
-
end
|
456
|
-
end
|