rubygems-update 3.4.22 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +99 -2
- data/Manifest.txt +34 -221
- data/README.md +1 -3
- data/bundler/CHANGELOG.md +53 -0
- data/bundler/bundler.gemspec +4 -2
- data/bundler/exe/bundle +1 -10
- data/bundler/lib/bundler/build_metadata.rb +3 -3
- data/bundler/lib/bundler/capistrano.rb +1 -1
- data/bundler/lib/bundler/checksum.rb +245 -0
- data/bundler/lib/bundler/ci_detector.rb +75 -0
- data/bundler/lib/bundler/cli/add.rb +3 -3
- data/bundler/lib/bundler/cli/binstubs.rb +4 -4
- data/bundler/lib/bundler/cli/cache.rb +1 -1
- data/bundler/lib/bundler/cli/check.rb +1 -1
- data/bundler/lib/bundler/cli/common.rb +9 -1
- data/bundler/lib/bundler/cli/config.rb +8 -7
- data/bundler/lib/bundler/cli/console.rb +3 -2
- data/bundler/lib/bundler/cli/doctor.rb +2 -2
- data/bundler/lib/bundler/cli/exec.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +28 -23
- data/bundler/lib/bundler/cli/info.rb +2 -13
- data/bundler/lib/bundler/cli/install.rb +5 -4
- data/bundler/lib/bundler/cli/issue.rb +1 -1
- data/bundler/lib/bundler/cli/lock.rb +4 -4
- data/bundler/lib/bundler/cli/open.rb +1 -1
- data/bundler/lib/bundler/cli/outdated.rb +6 -6
- data/bundler/lib/bundler/cli/plugin.rb +7 -14
- data/bundler/lib/bundler/cli/pristine.rb +38 -30
- data/bundler/lib/bundler/cli/show.rb +2 -2
- data/bundler/lib/bundler/cli/update.rb +5 -5
- data/bundler/lib/bundler/cli.rb +215 -263
- data/bundler/lib/bundler/compact_index_client/cache.rb +29 -9
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +153 -0
- data/bundler/lib/bundler/compact_index_client/gem_parser.rb +7 -3
- data/bundler/lib/bundler/compact_index_client/updater.rb +79 -81
- data/bundler/lib/bundler/compact_index_client.rb +14 -7
- data/bundler/lib/bundler/constants.rb +1 -1
- data/bundler/lib/bundler/current_ruby.rb +5 -21
- data/bundler/lib/bundler/definition.rb +42 -15
- data/bundler/lib/bundler/dependency.rb +16 -12
- data/bundler/lib/bundler/digest.rb +2 -2
- data/bundler/lib/bundler/dsl.rb +43 -25
- data/bundler/lib/bundler/endpoint_specification.rb +5 -1
- data/bundler/lib/bundler/env.rb +1 -3
- data/bundler/lib/bundler/errors.rb +43 -0
- data/bundler/lib/bundler/fetcher/base.rb +3 -1
- data/bundler/lib/bundler/fetcher/compact_index.rb +4 -4
- data/bundler/lib/bundler/fetcher/downloader.rb +13 -11
- data/bundler/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/bundler/lib/bundler/fetcher/index.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +28 -25
- data/bundler/lib/bundler/friendly_errors.rb +5 -5
- data/bundler/lib/bundler/gem_helper.rb +1 -1
- data/bundler/lib/bundler/gem_helpers.rb +5 -2
- data/bundler/lib/bundler/graph.rb +9 -9
- data/bundler/lib/bundler/index.rb +1 -2
- data/bundler/lib/bundler/injector.rb +1 -1
- data/bundler/lib/bundler/inline.rb +3 -3
- data/bundler/lib/bundler/installer/gem_installer.rb +5 -5
- data/bundler/lib/bundler/installer/parallel_installer.rb +16 -8
- data/bundler/lib/bundler/installer/standalone.rb +2 -3
- data/bundler/lib/bundler/installer.rb +9 -9
- data/bundler/lib/bundler/lazy_specification.rb +24 -17
- data/bundler/lib/bundler/lockfile_generator.rb +9 -0
- data/bundler/lib/bundler/lockfile_parser.rb +81 -10
- data/bundler/lib/bundler/man/bundle-add.1 +3 -26
- data/bundler/lib/bundler/man/bundle-binstubs.1 +4 -16
- data/bundler/lib/bundler/man/bundle-cache.1 +3 -24
- data/bundler/lib/bundler/man/bundle-check.1 +3 -12
- data/bundler/lib/bundler/man/bundle-clean.1 +3 -10
- data/bundler/lib/bundler/man/bundle-config.1 +20 -211
- data/bundler/lib/bundler/man/bundle-config.1.ronn +6 -0
- data/bundler/lib/bundler/man/bundle-console.1 +4 -22
- data/bundler/lib/bundler/man/bundle-doctor.1 +4 -18
- data/bundler/lib/bundler/man/bundle-exec.1 +12 -73
- data/bundler/lib/bundler/man/bundle-gem.1 +13 -49
- data/bundler/lib/bundler/man/bundle-help.1 +3 -7
- data/bundler/lib/bundler/man/bundle-info.1 +3 -9
- data/bundler/lib/bundler/man/bundle-init.1 +3 -12
- data/bundler/lib/bundler/man/bundle-inject.1 +6 -19
- data/bundler/lib/bundler/man/bundle-install.1 +27 -125
- data/bundler/lib/bundler/man/bundle-install.1.ronn +1 -0
- data/bundler/lib/bundler/man/bundle-list.1 +4 -19
- data/bundler/lib/bundler/man/bundle-lock.1 +5 -29
- data/bundler/lib/bundler/man/bundle-open.1 +7 -27
- data/bundler/lib/bundler/man/bundle-outdated.1 +3 -55
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +1 -0
- data/bundler/lib/bundler/man/bundle-platform.1 +5 -27
- data/bundler/lib/bundler/man/bundle-plugin.1 +3 -29
- data/bundler/lib/bundler/man/bundle-pristine.1 +5 -16
- data/bundler/lib/bundler/man/bundle-remove.1 +4 -14
- data/bundler/lib/bundler/man/bundle-show.1 +3 -10
- data/bundler/lib/bundler/man/bundle-update.1 +18 -137
- data/bundler/lib/bundler/man/bundle-version.1 +3 -16
- data/bundler/lib/bundler/man/bundle-viz.1 +4 -16
- data/bundler/lib/bundler/man/bundle.1 +5 -44
- data/bundler/lib/bundler/man/gemfile.5 +24 -301
- data/bundler/lib/bundler/man/gemfile.5.ronn +4 -0
- data/bundler/lib/bundler/match_metadata.rb +4 -0
- data/bundler/lib/bundler/match_platform.rb +1 -1
- data/bundler/lib/bundler/plugin/api/source.rb +3 -2
- data/bundler/lib/bundler/plugin/installer.rb +1 -1
- data/bundler/lib/bundler/plugin.rb +3 -3
- data/bundler/lib/bundler/resolver/base.rb +1 -1
- data/bundler/lib/bundler/resolver/incompatibility.rb +1 -1
- data/bundler/lib/bundler/resolver/spec_group.rb +1 -4
- data/bundler/lib/bundler/resolver.rb +16 -16
- data/bundler/lib/bundler/ruby_dsl.rb +20 -12
- data/bundler/lib/bundler/ruby_version.rb +1 -1
- data/bundler/lib/bundler/rubygems_ext.rb +24 -50
- data/bundler/lib/bundler/rubygems_gem_installer.rb +6 -56
- data/bundler/lib/bundler/rubygems_integration.rb +25 -94
- data/bundler/lib/bundler/runtime.rb +2 -2
- data/bundler/lib/bundler/self_manager.rb +23 -7
- data/bundler/lib/bundler/settings.rb +27 -7
- data/bundler/lib/bundler/setup.rb +4 -1
- data/bundler/lib/bundler/shared_helpers.rb +35 -13
- data/bundler/lib/bundler/source/git/git_proxy.rb +15 -15
- data/bundler/lib/bundler/source/git.rb +4 -3
- data/bundler/lib/bundler/source/metadata.rb +15 -15
- data/bundler/lib/bundler/source/path.rb +7 -6
- data/bundler/lib/bundler/source/rubygems.rb +21 -14
- data/bundler/lib/bundler/source.rb +2 -0
- data/bundler/lib/bundler/spec_set.rb +38 -10
- data/bundler/lib/bundler/stub_specification.rb +1 -0
- data/bundler/lib/bundler/templates/Executable.bundler +1 -1
- data/bundler/lib/bundler/templates/newgem/README.md.tt +3 -3
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +2 -6
- data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/standard.yml.tt +1 -1
- data/bundler/lib/bundler/ui/shell.rb +1 -1
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +53 -6
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +8 -20
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +3 -3
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +2 -2
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +35 -35
- data/bundler/lib/bundler/vendor/tsort/lib/tsort.rb +3 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +256 -132
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +95 -31
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendored_net_http.rb +8 -0
- data/bundler/lib/bundler/vendored_persistent.rb +0 -4
- data/bundler/lib/bundler/vendored_timeout.rb +8 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler/vlad.rb +1 -1
- data/bundler/lib/bundler/yaml_serializer.rb +3 -3
- data/bundler/lib/bundler.rb +38 -27
- data/lib/rubygems/available_set.rb +4 -4
- data/lib/rubygems/basic_specification.rb +35 -37
- data/lib/rubygems/bundler_version_finder.rb +4 -4
- data/lib/rubygems/ci_detector.rb +75 -0
- data/lib/rubygems/command.rb +13 -15
- data/lib/rubygems/command_manager.rb +5 -4
- data/lib/rubygems/commands/build_command.rb +2 -2
- data/lib/rubygems/commands/cert_command.rb +1 -2
- data/lib/rubygems/commands/check_command.rb +4 -4
- data/lib/rubygems/commands/cleanup_command.rb +12 -14
- data/lib/rubygems/commands/contents_command.rb +4 -4
- data/lib/rubygems/commands/dependency_command.rb +4 -5
- data/lib/rubygems/commands/environment_command.rb +1 -3
- data/lib/rubygems/commands/exec_command.rb +1 -1
- data/lib/rubygems/commands/fetch_command.rb +2 -2
- data/lib/rubygems/commands/generate_index_command.rb +39 -74
- data/lib/rubygems/commands/help_command.rb +3 -3
- data/lib/rubygems/commands/info_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +8 -16
- data/lib/rubygems/commands/list_command.rb +2 -2
- data/lib/rubygems/commands/lock_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +1 -1
- data/lib/rubygems/commands/owner_command.rb +1 -1
- data/lib/rubygems/commands/pristine_command.rb +13 -15
- data/lib/rubygems/commands/push_command.rb +2 -2
- data/lib/rubygems/commands/query_command.rb +4 -5
- data/lib/rubygems/commands/rdoc_command.rb +2 -2
- data/lib/rubygems/commands/search_command.rb +2 -2
- data/lib/rubygems/commands/setup_command.rb +31 -34
- data/lib/rubygems/commands/sources_command.rb +12 -12
- data/lib/rubygems/commands/specification_command.rb +10 -10
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +9 -10
- data/lib/rubygems/commands/unpack_command.rb +4 -4
- data/lib/rubygems/commands/update_command.rb +10 -12
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +1 -1
- data/lib/rubygems/compatibility.rb +5 -6
- data/lib/rubygems/config_file.rb +4 -4
- data/lib/rubygems/core_ext/kernel_gem.rb +0 -2
- data/lib/rubygems/core_ext/kernel_require.rb +19 -48
- data/lib/rubygems/core_ext/kernel_warn.rb +1 -1
- data/lib/rubygems/core_ext/tcpsocket_init.rb +1 -1
- data/lib/rubygems/defaults.rb +15 -3
- data/lib/rubygems/dependency.rb +12 -14
- data/lib/rubygems/dependency_installer.rb +29 -30
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/deprecate.rb +16 -15
- data/lib/rubygems/doctor.rb +5 -5
- data/lib/rubygems/errors.rb +2 -6
- data/lib/rubygems/exceptions.rb +2 -1
- data/lib/rubygems/ext/builder.rb +15 -10
- data/lib/rubygems/ext/cargo_builder.rb +5 -5
- data/lib/rubygems/ext/ext_conf_builder.rb +1 -3
- data/lib/rubygems/gem_runner.rb +4 -4
- data/lib/rubygems/gemcutter_utilities/webauthn_listener/response.rb +3 -3
- data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +3 -3
- data/lib/rubygems/gemcutter_utilities.rb +18 -19
- data/lib/rubygems/install_update_options.rb +18 -19
- data/lib/rubygems/installer.rb +59 -33
- data/lib/rubygems/installer_uninstaller_utils.rb +0 -2
- data/lib/rubygems/local_remote_options.rb +7 -10
- data/lib/rubygems/name_tuple.rb +7 -9
- data/lib/rubygems/net/http.rb +3 -0
- data/lib/rubygems/net-http/LICENSE.txt +22 -0
- data/lib/rubygems/net-http/lib/net/http/backward.rb +40 -0
- data/lib/rubygems/net-http/lib/net/http/exceptions.rb +34 -0
- data/lib/rubygems/net-http/lib/net/http/generic_request.rb +414 -0
- data/lib/rubygems/net-http/lib/net/http/header.rb +981 -0
- data/lib/rubygems/net-http/lib/net/http/proxy_delta.rb +17 -0
- data/lib/rubygems/net-http/lib/net/http/request.rb +88 -0
- data/lib/rubygems/net-http/lib/net/http/requests.rb +425 -0
- data/lib/rubygems/net-http/lib/net/http/response.rb +738 -0
- data/lib/rubygems/net-http/lib/net/http/responses.rb +1174 -0
- data/lib/rubygems/net-http/lib/net/http/status.rb +84 -0
- data/lib/rubygems/net-http/lib/net/http.rb +2496 -0
- data/lib/rubygems/net-http/lib/net/https.rb +23 -0
- data/lib/rubygems/net-protocol/LICENSE.txt +22 -0
- data/lib/rubygems/net-protocol/lib/net/protocol.rb +544 -0
- data/lib/rubygems/optparse/lib/optparse.rb +39 -17
- data/lib/rubygems/package/old.rb +2 -2
- data/lib/rubygems/package/tar_header.rb +45 -39
- data/lib/rubygems/package/tar_reader/entry.rb +5 -4
- data/lib/rubygems/package/tar_reader.rb +5 -3
- data/lib/rubygems/package/tar_writer.rb +19 -17
- data/lib/rubygems/package.rb +27 -26
- data/lib/rubygems/package_task.rb +2 -2
- data/lib/rubygems/path_support.rb +9 -10
- data/lib/rubygems/platform.rb +60 -45
- data/lib/rubygems/query_utils.rb +7 -9
- data/lib/rubygems/remote_fetcher.rb +15 -15
- data/lib/rubygems/request/connection_pools.rb +3 -3
- data/lib/rubygems/request.rb +20 -17
- data/lib/rubygems/request_set/gem_dependency_api.rb +119 -122
- data/lib/rubygems/request_set/lockfile/parser.rb +9 -9
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +20 -12
- data/lib/rubygems/request_set/lockfile.rb +6 -11
- data/lib/rubygems/request_set.rb +5 -5
- data/lib/rubygems/requirement.rb +7 -7
- data/lib/rubygems/resolv/LICENSE.txt +22 -0
- data/lib/rubygems/resolv/lib/resolv.rb +3387 -0
- data/lib/rubygems/resolver/activation_request.rb +1 -3
- data/lib/rubygems/resolver/api_set/gem_parser.rb +7 -3
- data/lib/rubygems/resolver/best_set.rb +1 -1
- data/lib/rubygems/resolver/composed_set.rb +1 -1
- data/lib/rubygems/resolver/conflict.rb +4 -12
- data/lib/rubygems/resolver/index_set.rb +4 -4
- data/lib/rubygems/resolver/index_specification.rb +2 -2
- data/lib/rubygems/resolver/installer_set.rb +5 -6
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/resolver.rb +3 -10
- data/lib/rubygems/s3_uri_signer.rb +6 -6
- data/lib/rubygems/safe_marshal/elements.rb +138 -0
- data/lib/rubygems/safe_marshal/reader.rb +306 -0
- data/lib/rubygems/safe_marshal/visitors/stream_printer.rb +31 -0
- data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +385 -0
- data/lib/rubygems/safe_marshal/visitors/visitor.rb +74 -0
- data/lib/rubygems/safe_marshal.rb +74 -0
- data/lib/rubygems/safe_yaml.rb +5 -28
- data/lib/rubygems/security/policies.rb +36 -38
- data/lib/rubygems/security/policy.rb +7 -11
- data/lib/rubygems/security/signer.rb +1 -1
- data/lib/rubygems/security/trust_dir.rb +3 -3
- data/lib/rubygems/security.rb +8 -22
- data/lib/rubygems/source/git.rb +1 -3
- data/lib/rubygems/source/installed.rb +0 -2
- data/lib/rubygems/source/local.rb +5 -8
- data/lib/rubygems/source/lock.rb +1 -3
- data/lib/rubygems/source/specific_file.rb +0 -1
- data/lib/rubygems/source/vendor.rb +0 -2
- data/lib/rubygems/source.rb +12 -12
- data/lib/rubygems/source_list.rb +4 -4
- data/lib/rubygems/spec_fetcher.rb +29 -29
- data/lib/rubygems/specification.rb +125 -138
- data/lib/rubygems/specification_policy.rb +55 -25
- data/lib/rubygems/stub_specification.rb +4 -5
- data/lib/rubygems/text.rb +1 -2
- data/lib/rubygems/timeout/LICENSE.txt +22 -0
- data/lib/rubygems/timeout/lib/timeout.rb +199 -0
- data/lib/rubygems/timeout.rb +3 -0
- data/lib/rubygems/tsort/lib/tsort.rb +3 -0
- data/lib/rubygems/uninstaller.rb +7 -9
- data/lib/rubygems/update_suggestion.rb +5 -18
- data/lib/rubygems/uri_formatter.rb +1 -1
- data/lib/rubygems/user_interaction.rb +15 -21
- data/lib/rubygems/util/licenses.rb +65 -35
- data/lib/rubygems/util/list.rb +3 -1
- data/lib/rubygems/util.rb +2 -4
- data/lib/rubygems/validator.rb +5 -3
- data/lib/rubygems/version.rb +34 -28
- data/lib/rubygems/version_option.rb +2 -5
- data/lib/rubygems/yaml_serializer.rb +3 -3
- data/lib/rubygems.rb +37 -37
- data/rubygems-update.gemspec +4 -4
- data/setup.rb +2 -2
- metadata +38 -225
- data/lib/rubygems/indexer.rb +0 -428
- data/lib/rubygems/mock_gem_ui.rb +0 -86
- data/test/rubygems/alternate_cert.pem +0 -19
- data/test/rubygems/alternate_cert_32.pem +0 -19
- data/test/rubygems/alternate_key.pem +0 -27
- data/test/rubygems/bad_rake.rb +0 -3
- data/test/rubygems/bundler_test_gem.rb +0 -424
- data/test/rubygems/ca_cert.pem +0 -77
- data/test/rubygems/child_cert.pem +0 -19
- data/test/rubygems/child_cert_32.pem +0 -19
- data/test/rubygems/child_key.pem +0 -27
- data/test/rubygems/client.pem +0 -107
- data/test/rubygems/data/excon-0.7.7.gemspec.rz +0 -0
- data/test/rubygems/data/gem-private_key.pem +0 -27
- data/test/rubygems/data/gem-public_cert.pem +0 -20
- data/test/rubygems/data/null-required-ruby-version.gemspec.rz +0 -0
- data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
- data/test/rubygems/data/pry-0.4.7.gemspec.rz +0 -0
- data/test/rubygems/encrypted_private_key.pem +0 -30
- data/test/rubygems/expired_cert.pem +0 -19
- data/test/rubygems/fake_certlib/openssl.rb +0 -9
- data/test/rubygems/foo/discover.rb +0 -1
- data/test/rubygems/future_cert.pem +0 -19
- data/test/rubygems/future_cert_32.pem +0 -19
- data/test/rubygems/good_rake.rb +0 -3
- data/test/rubygems/grandchild_cert.pem +0 -19
- data/test/rubygems/grandchild_cert_32.pem +0 -19
- data/test/rubygems/grandchild_key.pem +0 -27
- data/test/rubygems/helper.rb +0 -1649
- data/test/rubygems/installer_test_case.rb +0 -248
- data/test/rubygems/invalid_client.pem +0 -49
- data/test/rubygems/invalid_issuer_cert.pem +0 -20
- data/test/rubygems/invalid_issuer_cert_32.pem +0 -20
- data/test/rubygems/invalid_key.pem +0 -27
- data/test/rubygems/invalid_signer_cert.pem +0 -19
- data/test/rubygems/invalid_signer_cert_32.pem +0 -19
- data/test/rubygems/invalidchild_cert.pem +0 -19
- data/test/rubygems/invalidchild_cert_32.pem +0 -19
- data/test/rubygems/invalidchild_key.pem +0 -27
- data/test/rubygems/multifactor_auth_utilities.rb +0 -111
- data/test/rubygems/package/tar_test_case.rb +0 -175
- data/test/rubygems/packages/Bluebie-legs-0.6.2.gem +0 -0
- data/test/rubygems/packages/ascii_binder-0.1.10.1.gem +0 -0
- data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
- data/test/rubygems/plugin/exception/rubygems_plugin.rb +0 -4
- data/test/rubygems/plugin/load/rubygems_plugin.rb +0 -5
- data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +0 -4
- data/test/rubygems/private3072_key.pem +0 -40
- data/test/rubygems/private_ec_key.pem +0 -9
- data/test/rubygems/private_key.pem +0 -27
- data/test/rubygems/public3072_cert.pem +0 -25
- data/test/rubygems/public_cert.pem +0 -20
- data/test/rubygems/public_cert_32.pem +0 -19
- data/test/rubygems/public_key.pem +0 -9
- data/test/rubygems/rubygems/commands/crash_command.rb +0 -5
- data/test/rubygems/rubygems_plugin.rb +0 -24
- data/test/rubygems/sff/discover.rb +0 -1
- data/test/rubygems/simple_gem.rb +0 -68
- data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -9
- data/test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspec +0 -0
- data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +0 -14
- data/test/rubygems/ssl_cert.pem +0 -80
- data/test/rubygems/ssl_key.pem +0 -27
- data/test/rubygems/test_bundled_ca.rb +0 -61
- data/test/rubygems/test_config.rb +0 -28
- data/test/rubygems/test_deprecate.rb +0 -158
- data/test/rubygems/test_exit.rb +0 -17
- data/test/rubygems/test_gem.rb +0 -1799
- data/test/rubygems/test_gem_available_set.rb +0 -130
- data/test/rubygems/test_gem_bundler_version_finder.rb +0 -127
- data/test/rubygems/test_gem_command.rb +0 -403
- data/test/rubygems/test_gem_command_manager.rb +0 -400
- data/test/rubygems/test_gem_commands_build_command.rb +0 -739
- data/test/rubygems/test_gem_commands_cert_command.rb +0 -866
- data/test/rubygems/test_gem_commands_check_command.rb +0 -68
- data/test/rubygems/test_gem_commands_cleanup_command.rb +0 -292
- data/test/rubygems/test_gem_commands_contents_command.rb +0 -271
- data/test/rubygems/test_gem_commands_dependency_command.rb +0 -228
- data/test/rubygems/test_gem_commands_environment_command.rb +0 -169
- data/test/rubygems/test_gem_commands_exec_command.rb +0 -857
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -258
- data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -81
- data/test/rubygems/test_gem_commands_help_command.rb +0 -94
- data/test/rubygems/test_gem_commands_info_command.rb +0 -70
- data/test/rubygems/test_gem_commands_install_command.rb +0 -1573
- data/test/rubygems/test_gem_commands_list_command.rb +0 -33
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -67
- data/test/rubygems/test_gem_commands_mirror.rb +0 -20
- data/test/rubygems/test_gem_commands_open_command.rb +0 -101
- data/test/rubygems/test_gem_commands_outdated_command.rb +0 -50
- data/test/rubygems/test_gem_commands_owner_command.rb +0 -503
- data/test/rubygems/test_gem_commands_pristine_command.rb +0 -708
- data/test/rubygems/test_gem_commands_push_command.rb +0 -603
- data/test/rubygems/test_gem_commands_query_command.rb +0 -858
- data/test/rubygems/test_gem_commands_search_command.rb +0 -16
- data/test/rubygems/test_gem_commands_server_command.rb +0 -20
- data/test/rubygems/test_gem_commands_setup_command.rb +0 -474
- data/test/rubygems/test_gem_commands_signin_command.rb +0 -259
- data/test/rubygems/test_gem_commands_signout_command.rb +0 -30
- data/test/rubygems/test_gem_commands_sources_command.rb +0 -534
- data/test/rubygems/test_gem_commands_specification_command.rb +0 -277
- data/test/rubygems/test_gem_commands_stale_command.rb +0 -43
- data/test/rubygems/test_gem_commands_uninstall_command.rb +0 -542
- data/test/rubygems/test_gem_commands_unpack_command.rb +0 -224
- data/test/rubygems/test_gem_commands_update_command.rb +0 -836
- data/test/rubygems/test_gem_commands_which_command.rb +0 -85
- data/test/rubygems/test_gem_commands_yank_command.rb +0 -299
- data/test/rubygems/test_gem_config_file.rb +0 -551
- data/test/rubygems/test_gem_dependency.rb +0 -398
- data/test/rubygems/test_gem_dependency_installer.rb +0 -1190
- data/test/rubygems/test_gem_dependency_list.rb +0 -265
- data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -27
- data/test/rubygems/test_gem_doctor.rb +0 -195
- data/test/rubygems/test_gem_ext_builder.rb +0 -337
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/.gitignore +0 -1
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +0 -10
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.lock +0 -249
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.toml +0 -10
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/src/lib.rs +0 -27
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/lib/custom_name.rb +0 -3
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/.gitignore +0 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +0 -249
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +0 -10
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/rust_ruby_example.gemspec +0 -10
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +0 -51
- data/test/rubygems/test_gem_ext_cargo_builder.rb +0 -167
- data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +0 -34
- data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +0 -60
- data/test/rubygems/test_gem_ext_cmake_builder.rb +0 -84
- data/test/rubygems/test_gem_ext_configure_builder.rb +0 -80
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +0 -229
- data/test/rubygems/test_gem_ext_rake_builder.rb +0 -113
- data/test/rubygems/test_gem_gem_runner.rb +0 -119
- data/test/rubygems/test_gem_gemcutter_utilities.rb +0 -361
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -60
- data/test/rubygems/test_gem_indexer.rb +0 -381
- data/test/rubygems/test_gem_install_update_options.rb +0 -208
- data/test/rubygems/test_gem_installer.rb +0 -2512
- data/test/rubygems/test_gem_local_remote_options.rb +0 -133
- data/test/rubygems/test_gem_name_tuple.rb +0 -43
- data/test/rubygems/test_gem_package.rb +0 -1306
- data/test/rubygems/test_gem_package_old.rb +0 -91
- data/test/rubygems/test_gem_package_tar_header.rb +0 -226
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -150
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +0 -350
- data/test/rubygems/test_gem_package_tar_writer.rb +0 -331
- data/test/rubygems/test_gem_package_task.rb +0 -118
- data/test/rubygems/test_gem_path_support.rb +0 -139
- data/test/rubygems/test_gem_platform.rb +0 -497
- data/test/rubygems/test_gem_rdoc.rb +0 -137
- data/test/rubygems/test_gem_remote_fetcher.rb +0 -1227
- data/test/rubygems/test_gem_request.rb +0 -547
- data/test/rubygems/test_gem_request_connection_pools.rb +0 -152
- data/test/rubygems/test_gem_request_set.rb +0 -672
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +0 -853
- data/test/rubygems/test_gem_request_set_lockfile.rb +0 -469
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +0 -544
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +0 -307
- data/test/rubygems/test_gem_requirement.rb +0 -505
- data/test/rubygems/test_gem_resolver.rb +0 -859
- data/test/rubygems/test_gem_resolver_activation_request.rb +0 -43
- data/test/rubygems/test_gem_resolver_api_set.rb +0 -210
- data/test/rubygems/test_gem_resolver_api_specification.rb +0 -167
- data/test/rubygems/test_gem_resolver_best_set.rb +0 -159
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -44
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -82
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -83
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -188
- data/test/rubygems/test_gem_resolver_git_specification.rb +0 -114
- data/test/rubygems/test_gem_resolver_index_set.rb +0 -88
- data/test/rubygems/test_gem_resolver_index_specification.rb +0 -93
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -47
- data/test/rubygems/test_gem_resolver_installer_set.rb +0 -320
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -44
- data/test/rubygems/test_gem_resolver_lock_set.rb +0 -62
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -98
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -19
- data/test/rubygems/test_gem_resolver_specification.rb +0 -63
- data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -82
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -82
- data/test/rubygems/test_gem_security.rb +0 -341
- data/test/rubygems/test_gem_security_policy.rb +0 -535
- data/test/rubygems/test_gem_security_signer.rb +0 -218
- data/test/rubygems/test_gem_security_trust_dir.rb +0 -99
- data/test/rubygems/test_gem_silent_ui.rb +0 -123
- data/test/rubygems/test_gem_source.rb +0 -254
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -37
- data/test/rubygems/test_gem_source_git.rb +0 -310
- data/test/rubygems/test_gem_source_installed.rb +0 -35
- data/test/rubygems/test_gem_source_list.rb +0 -119
- data/test/rubygems/test_gem_source_local.rb +0 -107
- data/test/rubygems/test_gem_source_lock.rb +0 -113
- data/test/rubygems/test_gem_source_specific_file.rb +0 -76
- data/test/rubygems/test_gem_source_subpath_problem.rb +0 -50
- data/test/rubygems/test_gem_source_vendor.rb +0 -30
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -338
- data/test/rubygems/test_gem_specification.rb +0 -3856
- data/test/rubygems/test_gem_stream_ui.rb +0 -255
- data/test/rubygems/test_gem_stub_specification.rb +0 -278
- data/test/rubygems/test_gem_text.rb +0 -103
- data/test/rubygems/test_gem_uninstaller.rb +0 -675
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -31
- data/test/rubygems/test_gem_update_suggestion.rb +0 -209
- data/test/rubygems/test_gem_uri.rb +0 -41
- data/test/rubygems/test_gem_uri_formatter.rb +0 -27
- data/test/rubygems/test_gem_util.rb +0 -91
- data/test/rubygems/test_gem_validator.rb +0 -42
- data/test/rubygems/test_gem_version.rb +0 -305
- data/test/rubygems/test_gem_version_option.rb +0 -165
- data/test/rubygems/test_kernel.rb +0 -124
- data/test/rubygems/test_project_sanity.rb +0 -49
- data/test/rubygems/test_remote_fetch_error.rb +0 -20
- data/test/rubygems/test_require.rb +0 -732
- data/test/rubygems/test_rubygems.rb +0 -76
- data/test/rubygems/test_webauthn_listener.rb +0 -143
- data/test/rubygems/test_webauthn_listener_response.rb +0 -93
- data/test/rubygems/test_webauthn_poller.rb +0 -124
- data/test/rubygems/utilities.rb +0 -436
- data/test/rubygems/wrong_key_cert.pem +0 -19
- data/test/rubygems/wrong_key_cert_32.pem +0 -19
- data/test/test_changelog_generator.rb +0 -17
@@ -0,0 +1,245 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class Checksum
|
5
|
+
ALGO_SEPARATOR = "="
|
6
|
+
DEFAULT_ALGORITHM = "sha256"
|
7
|
+
private_constant :DEFAULT_ALGORITHM
|
8
|
+
DEFAULT_BLOCK_SIZE = 16_384
|
9
|
+
private_constant :DEFAULT_BLOCK_SIZE
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def from_gem_package(gem_package, algo = DEFAULT_ALGORITHM)
|
13
|
+
return if Bundler.settings[:disable_checksum_validation]
|
14
|
+
return unless source = gem_package.instance_variable_get(:@gem)
|
15
|
+
return unless source.respond_to?(:with_read_io)
|
16
|
+
|
17
|
+
source.with_read_io do |io|
|
18
|
+
from_gem(io, source.path)
|
19
|
+
ensure
|
20
|
+
io.rewind
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def from_gem(io, pathname, algo = DEFAULT_ALGORITHM)
|
25
|
+
digest = Bundler::SharedHelpers.digest(algo.upcase).new
|
26
|
+
buf = String.new(capacity: DEFAULT_BLOCK_SIZE)
|
27
|
+
digest << io.readpartial(DEFAULT_BLOCK_SIZE, buf) until io.eof?
|
28
|
+
Checksum.new(algo, digest.hexdigest!, Source.new(:gem, pathname))
|
29
|
+
end
|
30
|
+
|
31
|
+
def from_api(digest, source_uri, algo = DEFAULT_ALGORITHM)
|
32
|
+
return if Bundler.settings[:disable_checksum_validation]
|
33
|
+
Checksum.new(algo, to_hexdigest(digest, algo), Source.new(:api, source_uri))
|
34
|
+
end
|
35
|
+
|
36
|
+
def from_lock(lock_checksum, lockfile_location)
|
37
|
+
algo, digest = lock_checksum.strip.split(ALGO_SEPARATOR, 2)
|
38
|
+
Checksum.new(algo, to_hexdigest(digest, algo), Source.new(:lock, lockfile_location))
|
39
|
+
end
|
40
|
+
|
41
|
+
def to_hexdigest(digest, algo = DEFAULT_ALGORITHM)
|
42
|
+
return digest unless algo == DEFAULT_ALGORITHM
|
43
|
+
return digest if digest.match?(/\A[0-9a-f]{64}\z/i)
|
44
|
+
if digest.match?(%r{\A[-0-9a-z_+/]{43}={0,2}\z}i)
|
45
|
+
digest = digest.tr("-_", "+/") # fix urlsafe base64
|
46
|
+
return digest.unpack1("m0").unpack1("H*")
|
47
|
+
end
|
48
|
+
raise ArgumentError, "#{digest.inspect} is not a valid SHA256 hex or base64 digest"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
attr_reader :algo, :digest, :sources
|
53
|
+
|
54
|
+
def initialize(algo, digest, source)
|
55
|
+
@algo = algo
|
56
|
+
@digest = digest
|
57
|
+
@sources = [source]
|
58
|
+
end
|
59
|
+
|
60
|
+
def ==(other)
|
61
|
+
match?(other) && other.sources == sources
|
62
|
+
end
|
63
|
+
|
64
|
+
alias_method :eql?, :==
|
65
|
+
|
66
|
+
def match?(other)
|
67
|
+
other.is_a?(self.class) && other.digest == digest && other.algo == algo
|
68
|
+
end
|
69
|
+
|
70
|
+
def hash
|
71
|
+
digest.hash
|
72
|
+
end
|
73
|
+
|
74
|
+
def to_s
|
75
|
+
"#{to_lock} (from #{sources.first}#{", ..." if sources.size > 1})"
|
76
|
+
end
|
77
|
+
|
78
|
+
def to_lock
|
79
|
+
"#{algo}#{ALGO_SEPARATOR}#{digest}"
|
80
|
+
end
|
81
|
+
|
82
|
+
def merge!(other)
|
83
|
+
return nil unless match?(other)
|
84
|
+
@sources.concat(other.sources).uniq!
|
85
|
+
self
|
86
|
+
end
|
87
|
+
|
88
|
+
def formatted_sources
|
89
|
+
sources.join("\n and ").concat("\n")
|
90
|
+
end
|
91
|
+
|
92
|
+
def removable?
|
93
|
+
sources.all?(&:removable?)
|
94
|
+
end
|
95
|
+
|
96
|
+
def removal_instructions
|
97
|
+
msg = +""
|
98
|
+
i = 1
|
99
|
+
sources.each do |source|
|
100
|
+
msg << " #{i}. #{source.removal}\n"
|
101
|
+
i += 1
|
102
|
+
end
|
103
|
+
msg << " #{i}. run `bundle install`\n"
|
104
|
+
end
|
105
|
+
|
106
|
+
def inspect
|
107
|
+
abbr = "#{algo}#{ALGO_SEPARATOR}#{digest[0, 8]}"
|
108
|
+
from = "from #{sources.join(" and ")}"
|
109
|
+
"#<#{self.class}:#{object_id} #{abbr} #{from}>"
|
110
|
+
end
|
111
|
+
|
112
|
+
class Source
|
113
|
+
attr_reader :type, :location
|
114
|
+
|
115
|
+
def initialize(type, location)
|
116
|
+
@type = type
|
117
|
+
@location = location
|
118
|
+
end
|
119
|
+
|
120
|
+
def removable?
|
121
|
+
type == :lock || type == :gem
|
122
|
+
end
|
123
|
+
|
124
|
+
def ==(other)
|
125
|
+
other.is_a?(self.class) && other.type == type && other.location == location
|
126
|
+
end
|
127
|
+
|
128
|
+
# phrased so that the usual string format is grammatically correct
|
129
|
+
# rake (10.3.2) sha256=abc123 from #{to_s}
|
130
|
+
def to_s
|
131
|
+
case type
|
132
|
+
when :lock
|
133
|
+
"the lockfile CHECKSUMS at #{location}"
|
134
|
+
when :gem
|
135
|
+
"the gem at #{location}"
|
136
|
+
when :api
|
137
|
+
"the API at #{location}"
|
138
|
+
else
|
139
|
+
"#{location} (#{type})"
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# A full sentence describing how to remove the checksum
|
144
|
+
def removal
|
145
|
+
case type
|
146
|
+
when :lock
|
147
|
+
"remove the matching checksum in #{location}"
|
148
|
+
when :gem
|
149
|
+
"remove the gem at #{location}"
|
150
|
+
when :api
|
151
|
+
"checksums from #{location} cannot be locally modified, you may need to update your sources"
|
152
|
+
else
|
153
|
+
"remove #{location} (#{type})"
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
class Store
|
159
|
+
attr_reader :store
|
160
|
+
protected :store
|
161
|
+
|
162
|
+
def initialize
|
163
|
+
@store = {}
|
164
|
+
end
|
165
|
+
|
166
|
+
def initialize_copy(other)
|
167
|
+
@store = {}
|
168
|
+
other.store.each do |lock_name, checksums|
|
169
|
+
store[lock_name] = checksums.dup
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
def inspect
|
174
|
+
"#<#{self.class}:#{object_id} size=#{store.size}>"
|
175
|
+
end
|
176
|
+
|
177
|
+
def fetch(spec, algo = DEFAULT_ALGORITHM)
|
178
|
+
store[spec.name_tuple.lock_name]&.fetch(algo, nil)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Replace when the new checksum is from the same source.
|
182
|
+
# The primary purpose of this registering checksums from gems where there are
|
183
|
+
# duplicates of the same gem (according to full_name) in the index.
|
184
|
+
# In particular, this is when 2 gems have two similar platforms, e.g.
|
185
|
+
# "darwin20" and "darwin-20", both of which resolve to darwin-20.
|
186
|
+
# In the Index, the later gem replaces the former, so we do that here.
|
187
|
+
#
|
188
|
+
# However, if the new checksum is from a different source, we register like normal.
|
189
|
+
# This ensures a mismatch error where there are multiple top level sources
|
190
|
+
# that contain the same gem with different checksums.
|
191
|
+
def replace(spec, checksum)
|
192
|
+
return unless checksum
|
193
|
+
|
194
|
+
lock_name = spec.name_tuple.lock_name
|
195
|
+
checksums = (store[lock_name] ||= {})
|
196
|
+
existing = checksums[checksum.algo]
|
197
|
+
|
198
|
+
# we assume only one source because this is used while building the index
|
199
|
+
if !existing || existing.sources.first == checksum.sources.first
|
200
|
+
checksums[checksum.algo] = checksum
|
201
|
+
else
|
202
|
+
register_checksum(lock_name, checksum)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
def register(spec, checksum)
|
207
|
+
return unless checksum
|
208
|
+
register_checksum(spec.name_tuple.lock_name, checksum)
|
209
|
+
end
|
210
|
+
|
211
|
+
def merge!(other)
|
212
|
+
other.store.each do |lock_name, checksums|
|
213
|
+
checksums.each do |_algo, checksum|
|
214
|
+
register_checksum(lock_name, checksum)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
def to_lock(spec)
|
220
|
+
lock_name = spec.name_tuple.lock_name
|
221
|
+
if checksums = store[lock_name]
|
222
|
+
"#{lock_name} #{checksums.values.map(&:to_lock).sort.join(",")}"
|
223
|
+
else
|
224
|
+
lock_name
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
private
|
229
|
+
|
230
|
+
def register_checksum(lock_name, checksum)
|
231
|
+
return unless checksum
|
232
|
+
checksums = (store[lock_name] ||= {})
|
233
|
+
existing = checksums[checksum.algo]
|
234
|
+
|
235
|
+
if !existing
|
236
|
+
checksums[checksum.algo] = checksum
|
237
|
+
elsif existing.merge!(checksum)
|
238
|
+
checksum
|
239
|
+
else
|
240
|
+
raise ChecksumMismatchError.new(lock_name, existing, checksum)
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
module CIDetector
|
5
|
+
# NOTE: Any changes made here will need to be made to both lib/rubygems/ci_detector.rb and
|
6
|
+
# bundler/lib/bundler/ci_detector.rb (which are enforced duplicates).
|
7
|
+
# TODO: Drop that duplication once bundler drops support for RubyGems 3.4
|
8
|
+
#
|
9
|
+
# ## Recognized CI providers, their signifiers, and the relevant docs ##
|
10
|
+
#
|
11
|
+
# Travis CI - CI, TRAVIS https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
|
12
|
+
# Cirrus CI - CI, CIRRUS_CI https://cirrus-ci.org/guide/writing-tasks/#environment-variables
|
13
|
+
# Circle CI - CI, CIRCLECI https://circleci.com/docs/variables/#built-in-environment-variables
|
14
|
+
# Gitlab CI - CI, GITLAB_CI https://docs.gitlab.com/ee/ci/variables/
|
15
|
+
# AppVeyor - CI, APPVEYOR https://www.appveyor.com/docs/environment-variables/
|
16
|
+
# CodeShip - CI_NAME https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/environment-variables#_default_environment_variables
|
17
|
+
# dsari - CI, DSARI https://github.com/rfinnie/dsari#running
|
18
|
+
# Jenkins - BUILD_NUMBER https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
19
|
+
# TeamCity - TEAMCITY_VERSION https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html#Predefined+Server+Build+Parameters
|
20
|
+
# Appflow - CI_BUILD_ID https://ionic.io/docs/appflow/automation/environments#predefined-environments
|
21
|
+
# TaskCluster - TASKCLUSTER_ROOT_URL https://docs.taskcluster.net/docs/manual/design/env-vars
|
22
|
+
# Semaphore - CI, SEMAPHORE https://docs.semaphoreci.com/ci-cd-environment/environment-variables/
|
23
|
+
# BuildKite - CI, BUILDKITE https://buildkite.com/docs/pipelines/environment-variables
|
24
|
+
# GoCD - GO_SERVER_URL https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html
|
25
|
+
# GH Actions - CI, GITHUB_ACTIONS https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
|
26
|
+
#
|
27
|
+
# ### Some "standard" ENVs that multiple providers may set ###
|
28
|
+
#
|
29
|
+
# * CI - this is set by _most_ (but not all) CI providers now; it's approaching a standard.
|
30
|
+
# * CI_NAME - Not as frequently used, but some providers set this to specify their own name
|
31
|
+
|
32
|
+
# Any of these being set is a reasonably reliable indicator that we are
|
33
|
+
# executing in a CI environment.
|
34
|
+
ENV_INDICATORS = [
|
35
|
+
"CI",
|
36
|
+
"CI_NAME",
|
37
|
+
"CONTINUOUS_INTEGRATION",
|
38
|
+
"BUILD_NUMBER",
|
39
|
+
"CI_APP_ID",
|
40
|
+
"CI_BUILD_ID",
|
41
|
+
"CI_BUILD_NUMBER",
|
42
|
+
"RUN_ID",
|
43
|
+
"TASKCLUSTER_ROOT_URL",
|
44
|
+
].freeze
|
45
|
+
|
46
|
+
# For each CI, this env suffices to indicate that we're on _that_ CI's
|
47
|
+
# containers. (A few of them only supply a CI_NAME variable, which is also
|
48
|
+
# nice). And if they set "CI" but we can't tell which one they are, we also
|
49
|
+
# want to know that - a bare "ci" without another token tells us as much.
|
50
|
+
ENV_DESCRIPTORS = {
|
51
|
+
"TRAVIS" => "travis",
|
52
|
+
"CIRCLECI" => "circle",
|
53
|
+
"CIRRUS_CI" => "cirrus",
|
54
|
+
"DSARI" => "dsari",
|
55
|
+
"SEMAPHORE" => "semaphore",
|
56
|
+
"JENKINS_URL" => "jenkins",
|
57
|
+
"BUILDKITE" => "buildkite",
|
58
|
+
"GO_SERVER_URL" => "go",
|
59
|
+
"GITLAB_CI" => "gitlab",
|
60
|
+
"GITHUB_ACTIONS" => "github",
|
61
|
+
"TASKCLUSTER_ROOT_URL" => "taskcluster",
|
62
|
+
"CI" => "ci",
|
63
|
+
}.freeze
|
64
|
+
|
65
|
+
def self.ci?
|
66
|
+
ENV_INDICATORS.any? {|var| ENV.include?(var) }
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.ci_strings
|
70
|
+
matching_names = ENV_DESCRIPTORS.select {|env, _| ENV[env] }.values
|
71
|
+
matching_names << ENV["CI_NAME"].downcase if ENV["CI_NAME"]
|
72
|
+
matching_names.reject(&:empty?).sort.uniq
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -28,9 +28,9 @@ module Bundler
|
|
28
28
|
dependencies = gems.map {|g| Bundler::Dependency.new(g, version, options) }
|
29
29
|
|
30
30
|
Injector.inject(dependencies,
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
31
|
+
conservative_versioning: options[:version].nil?, # Perform conservative versioning only when version is not specified
|
32
|
+
optimistic: options[:optimistic],
|
33
|
+
strict: options[:strict])
|
34
34
|
end
|
35
35
|
|
36
36
|
def validate_options!
|
@@ -17,9 +17,9 @@ module Bundler
|
|
17
17
|
installer = Installer.new(Bundler.root, Bundler.definition)
|
18
18
|
|
19
19
|
installer_opts = {
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
20
|
+
force: options[:force],
|
21
|
+
binstubs_cmd: true,
|
22
|
+
all_platforms: options["all-platforms"],
|
23
23
|
}
|
24
24
|
|
25
25
|
if options[:all]
|
@@ -45,7 +45,7 @@ module Bundler
|
|
45
45
|
next
|
46
46
|
end
|
47
47
|
|
48
|
-
Bundler.settings.temporary(:
|
48
|
+
Bundler.settings.temporary(path: (Bundler.settings[:path] || Bundler.root)) do
|
49
49
|
installer.generate_standalone_bundler_executable_stubs(spec, installer_opts)
|
50
50
|
end
|
51
51
|
else
|
@@ -19,7 +19,7 @@ module Bundler
|
|
19
19
|
# TODO: move cache contents here now that all bundles are locked
|
20
20
|
custom_path = Bundler.settings[:path] if options[:path]
|
21
21
|
|
22
|
-
Bundler.settings.temporary(:
|
22
|
+
Bundler.settings.temporary(cache_all_platforms: options["all-platforms"]) do
|
23
23
|
Bundler.load.cache(custom_path)
|
24
24
|
end
|
25
25
|
end
|
@@ -32,7 +32,7 @@ module Bundler
|
|
32
32
|
Bundler.ui.error "This bundle has been frozen, but there is no #{SharedHelpers.relative_lockfile_path} present"
|
33
33
|
exit 1
|
34
34
|
else
|
35
|
-
Bundler.load.lock(:
|
35
|
+
Bundler.load.lock(preserve_unknown_sections: true) unless options[:"dry-run"]
|
36
36
|
Bundler.ui.info "The Gemfile's dependencies are satisfied"
|
37
37
|
end
|
38
38
|
end
|
@@ -54,9 +54,12 @@ module Bundler
|
|
54
54
|
|
55
55
|
Bundler.definition.specs.each do |spec|
|
56
56
|
return spec if spec.name == name
|
57
|
-
specs << spec if regexp && spec.name
|
57
|
+
specs << spec if regexp && spec.name.match?(regexp)
|
58
58
|
end
|
59
59
|
|
60
|
+
default_spec = default_gem_spec(name)
|
61
|
+
specs << default_spec if default_spec
|
62
|
+
|
60
63
|
case specs.count
|
61
64
|
when 0
|
62
65
|
dep_in_other_group = Bundler.definition.current_dependencies.find {|dep|dep.name == name }
|
@@ -75,6 +78,11 @@ module Bundler
|
|
75
78
|
raise GemNotFound, gem_not_found_message(name, Bundler.definition.dependencies)
|
76
79
|
end
|
77
80
|
|
81
|
+
def self.default_gem_spec(name)
|
82
|
+
gem_spec = Gem::Specification.find_all_by_name(name).last
|
83
|
+
gem_spec if gem_spec&.default_gem?
|
84
|
+
end
|
85
|
+
|
78
86
|
def self.ask_for_spec_from(specs)
|
79
87
|
specs.each_with_index do |spec, index|
|
80
88
|
Bundler.ui.info "#{index.succ} : #{spec.name}", true
|
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
module Bundler
|
4
4
|
class CLI::Config < Thor
|
5
|
-
class_option :parseable, :
|
5
|
+
class_option :parseable, type: :boolean, banner: "Use minimal formatting for more parseable output"
|
6
6
|
|
7
7
|
def self.scope_options
|
8
|
-
method_option :global, :
|
9
|
-
method_option :local, :
|
8
|
+
method_option :global, type: :boolean, banner: "Only change the global config"
|
9
|
+
method_option :local, type: :boolean, banner: "Only change the local config"
|
10
10
|
end
|
11
11
|
private_class_method :scope_options
|
12
12
|
|
13
|
-
desc "base NAME [VALUE]", "The Bundler 1 config interface", :
|
13
|
+
desc "base NAME [VALUE]", "The Bundler 1 config interface", hide: true
|
14
14
|
scope_options
|
15
|
-
method_option :delete, :
|
15
|
+
method_option :delete, type: :boolean, banner: "delete"
|
16
16
|
def base(name = nil, *value)
|
17
17
|
new_args =
|
18
18
|
if ARGV.size == 1
|
@@ -25,8 +25,9 @@ module Bundler
|
|
25
25
|
["config", "get", ARGV[1]]
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
message = "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
|
29
|
+
removed_message = "Using the `config` command without a subcommand [list, get, set, unset] is has been removed. Use `bundle #{new_args.join(" ")}` instead."
|
30
|
+
SharedHelpers.major_deprecation 3, message, removed_message: removed_message
|
30
31
|
|
31
32
|
Base.new(options, name, value, self).run
|
32
33
|
end
|
@@ -9,8 +9,9 @@ module Bundler
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
-
|
13
|
-
|
12
|
+
message = "bundle console will be replaced by `bin/console` generated by `bundle gem <name>`"
|
13
|
+
removed_message = "bundle console has been replaced by `bin/console` generated by `bundle gem <name>`"
|
14
|
+
Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
|
14
15
|
|
15
16
|
group ? Bundler.require(:default, *group.split(" ").map!(&:to_sym)) : Bundler.require
|
16
17
|
ARGV.clear
|
@@ -6,8 +6,8 @@ require "fiddle"
|
|
6
6
|
|
7
7
|
module Bundler
|
8
8
|
class CLI::Doctor
|
9
|
-
DARWIN_REGEX = /\s+(.+) \(compatibility
|
10
|
-
LDD_REGEX = /\t\S+ => (\S+) \(\S+\)
|
9
|
+
DARWIN_REGEX = /\s+(.+) \(compatibility /
|
10
|
+
LDD_REGEX = /\t\S+ => (\S+) \(\S+\)/
|
11
11
|
|
12
12
|
attr_reader :options
|
13
13
|
|
@@ -12,7 +12,7 @@ module Bundler
|
|
12
12
|
@options = options
|
13
13
|
@cmd = args.shift
|
14
14
|
@args = args
|
15
|
-
@args << { :
|
15
|
+
@args << { close_others: !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby?
|
16
16
|
end
|
17
17
|
|
18
18
|
def run
|
@@ -11,7 +11,7 @@ module Bundler
|
|
11
11
|
class CLI::Gem
|
12
12
|
TEST_FRAMEWORK_VERSIONS = {
|
13
13
|
"rspec" => "3.0",
|
14
|
-
"minitest" => "5.
|
14
|
+
"minitest" => "5.16",
|
15
15
|
"test-unit" => "3.0",
|
16
16
|
}.freeze
|
17
17
|
|
@@ -59,23 +59,23 @@ module Bundler
|
|
59
59
|
end
|
60
60
|
|
61
61
|
config = {
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
66
|
-
:
|
67
|
-
:
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
73
|
-
:
|
74
|
-
:
|
75
|
-
:
|
76
|
-
:
|
77
|
-
:
|
78
|
-
:
|
62
|
+
name: name,
|
63
|
+
underscored_name: underscored_name,
|
64
|
+
namespaced_path: namespaced_path,
|
65
|
+
makefile_path: "#{underscored_name}/#{underscored_name}",
|
66
|
+
constant_name: constant_name,
|
67
|
+
constant_array: constant_array,
|
68
|
+
author: git_author_name.empty? ? "TODO: Write your name" : git_author_name,
|
69
|
+
email: git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
|
70
|
+
test: options[:test],
|
71
|
+
ext: extension,
|
72
|
+
exe: options[:exe],
|
73
|
+
bundler_version: bundler_dependency_version,
|
74
|
+
git: use_git,
|
75
|
+
github_username: github_username.empty? ? "[USERNAME]" : github_username,
|
76
|
+
required_ruby_version: required_ruby_version,
|
77
|
+
rust_builder_required_rubygems_version: rust_builder_required_rubygems_version,
|
78
|
+
minitest_constant_name: minitest_constant_name,
|
79
79
|
}
|
80
80
|
ensure_safe_gem_name(name, constant_array)
|
81
81
|
|
@@ -236,7 +236,7 @@ module Bundler
|
|
236
236
|
end
|
237
237
|
|
238
238
|
if use_git
|
239
|
-
IO.popen(%w[git add .], { :
|
239
|
+
IO.popen(%w[git add .], { chdir: target }, &:read)
|
240
240
|
end
|
241
241
|
|
242
242
|
# Open gemspec in editor
|
@@ -349,7 +349,7 @@ module Bundler
|
|
349
349
|
Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
|
350
350
|
"Supported Linters:\n" \
|
351
351
|
"* RuboCop: https://rubocop.org\n" \
|
352
|
-
"* Standard: https://github.com/
|
352
|
+
"* Standard: https://github.com/standardrb/standard\n" \
|
353
353
|
"\n"
|
354
354
|
Bundler.ui.info hint_text("linter")
|
355
355
|
|
@@ -380,15 +380,20 @@ module Bundler
|
|
380
380
|
def deprecated_rubocop_option
|
381
381
|
if !options[:rubocop].nil?
|
382
382
|
if options[:rubocop]
|
383
|
-
Bundler::SharedHelpers.major_deprecation 2,
|
383
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
384
|
+
"--rubocop is deprecated, use --linter=rubocop",
|
385
|
+
removed_message: "--rubocop has been removed, use --linter=rubocop"
|
384
386
|
"rubocop"
|
385
387
|
else
|
386
|
-
Bundler::SharedHelpers.major_deprecation 2,
|
388
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
389
|
+
"--no-rubocop is deprecated, use --linter",
|
390
|
+
removed_message: "--no-rubocop has been removed, use --linter"
|
387
391
|
false
|
388
392
|
end
|
389
393
|
elsif !Bundler.settings["gem.rubocop"].nil?
|
390
394
|
Bundler::SharedHelpers.major_deprecation 2,
|
391
|
-
"config gem.rubocop is deprecated; we've updated your config to use gem.linter instead"
|
395
|
+
"config gem.rubocop is deprecated; we've updated your config to use gem.linter instead",
|
396
|
+
removed_message: "config gem.rubocop has been removed; we've updated your config to use gem.linter instead"
|
392
397
|
Bundler.settings["gem.rubocop"] ? "rubocop" : false
|
393
398
|
end
|
394
399
|
end
|
@@ -25,19 +25,8 @@ module Bundler
|
|
25
25
|
|
26
26
|
private
|
27
27
|
|
28
|
-
def spec_for_gem(
|
29
|
-
|
30
|
-
spec || default_gem_spec(gem_name) || Bundler::CLI::Common.select_spec(gem_name, :regex_match)
|
31
|
-
end
|
32
|
-
|
33
|
-
def default_gem_spec(gem_name)
|
34
|
-
return unless Gem::Specification.respond_to?(:find_all_by_name)
|
35
|
-
gem_spec = Gem::Specification.find_all_by_name(gem_name).last
|
36
|
-
gem_spec if gem_spec&.default_gem?
|
37
|
-
end
|
38
|
-
|
39
|
-
def spec_not_found(gem_name)
|
40
|
-
raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
|
28
|
+
def spec_for_gem(name)
|
29
|
+
Bundler::CLI::Common.select_spec(name, :regex_match)
|
41
30
|
end
|
42
31
|
|
43
32
|
def print_gem_version(spec)
|
@@ -51,7 +51,8 @@ module Bundler
|
|
51
51
|
|
52
52
|
if options["binstubs"]
|
53
53
|
Bundler::SharedHelpers.major_deprecation 2,
|
54
|
-
"The --binstubs option will be removed in favor of `bundle binstubs --all`"
|
54
|
+
"The --binstubs option will be removed in favor of `bundle binstubs --all`",
|
55
|
+
removed_message: "The --binstubs option have been removed in favor of `bundle binstubs --all`"
|
55
56
|
end
|
56
57
|
|
57
58
|
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
|
@@ -61,7 +62,7 @@ module Bundler
|
|
61
62
|
|
62
63
|
installer = Installer.install(Bundler.root, definition, options)
|
63
64
|
|
64
|
-
Bundler.settings.temporary(:
|
65
|
+
Bundler.settings.temporary(cache_all_platforms: options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
|
65
66
|
Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
|
66
67
|
end
|
67
68
|
|
@@ -95,7 +96,7 @@ module Bundler
|
|
95
96
|
def warn_if_root
|
96
97
|
return if Bundler.settings[:silence_root_warning] || Gem.win_platform? || !Process.uid.zero?
|
97
98
|
Bundler.ui.warn "Don't run Bundler as root. Installing your bundle as root " \
|
98
|
-
"will break this application for all non-root users on this machine.", :
|
99
|
+
"will break this application for all non-root users on this machine.", wrap: true
|
99
100
|
end
|
100
101
|
|
101
102
|
def dependencies_count_for(definition)
|
@@ -148,7 +149,7 @@ module Bundler
|
|
148
149
|
Bundler.settings.set_command_option_if_given :path, options[:path]
|
149
150
|
|
150
151
|
if options["standalone"] && Bundler.settings[:path].nil? && !options["local"]
|
151
|
-
Bundler.settings.temporary(:
|
152
|
+
Bundler.settings.temporary(path_relative_to_cwd: false) do
|
152
153
|
Bundler.settings.set_command_option :path, "bundle"
|
153
154
|
end
|
154
155
|
end
|
@@ -26,14 +26,14 @@ module Bundler
|
|
26
26
|
|
27
27
|
if update.is_a?(Array) # unlocking specific gems
|
28
28
|
Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update)
|
29
|
-
update = { :
|
29
|
+
update = { gems: update, conservative: conservative }
|
30
30
|
elsif update && conservative
|
31
|
-
update = { :
|
31
|
+
update = { conservative: conservative }
|
32
32
|
elsif update && bundler
|
33
|
-
update = { :
|
33
|
+
update = { bundler: bundler }
|
34
34
|
end
|
35
35
|
|
36
|
-
Bundler.settings.temporary(:
|
36
|
+
Bundler.settings.temporary(frozen: false) do
|
37
37
|
definition = Bundler.definition(update)
|
38
38
|
|
39
39
|
Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
|
@@ -21,7 +21,7 @@ module Bundler
|
|
21
21
|
require "shellwords"
|
22
22
|
command = Shellwords.split(editor) << File.join([root_path, path].compact)
|
23
23
|
Bundler.with_original_env do
|
24
|
-
system(*command, { :
|
24
|
+
system(*command, { chdir: root_path })
|
25
25
|
end || Bundler.ui.info("Could not run '#{command.join(" ")}'")
|
26
26
|
end
|
27
27
|
end
|