rubygems-update 3.1.6 → 3.2.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +55 -19
- data/CONTRIBUTING.md +1 -2
- data/History.txt +122 -14
- data/Manifest.txt +13 -25
- data/POLICIES.md +2 -9
- data/README.md +1 -1
- data/Rakefile +31 -33
- data/bin/update_rubygems +1 -1
- data/bundler/CHANGELOG.md +806 -741
- data/bundler/README.md +6 -8
- data/bundler/UPGRADING.md +16 -30
- data/bundler/bundler.gemspec +3 -3
- data/bundler/exe/bundle +3 -0
- data/bundler/lib/bundler.rb +15 -4
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +32 -11
- data/bundler/lib/bundler/cli/console.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +83 -10
- data/bundler/lib/bundler/cli/info.rb +13 -3
- data/bundler/lib/bundler/cli/init.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +5 -14
- data/bundler/lib/bundler/cli/issue.rb +2 -2
- data/bundler/lib/bundler/cli/list.rb +11 -9
- data/bundler/lib/bundler/cli/outdated.rb +88 -65
- data/bundler/lib/bundler/cli/plugin.rb +10 -0
- data/bundler/lib/bundler/cli/pristine.rb +5 -0
- data/bundler/lib/bundler/definition.rb +32 -32
- data/bundler/lib/bundler/dependency.rb +0 -9
- data/bundler/lib/bundler/dsl.rb +1 -5
- data/bundler/lib/bundler/environment_preserver.rb +26 -2
- data/bundler/lib/bundler/errors.rb +1 -0
- data/bundler/lib/bundler/feature_flag.rb +0 -2
- data/bundler/lib/bundler/fetcher.rb +1 -0
- data/bundler/lib/bundler/friendly_errors.rb +4 -10
- data/bundler/lib/bundler/gem_helper.rb +17 -10
- data/bundler/lib/bundler/gem_version_promoter.rb +1 -1
- data/bundler/lib/bundler/injector.rb +14 -3
- data/bundler/lib/bundler/inline.rb +1 -1
- data/bundler/lib/bundler/installer.rb +29 -28
- data/bundler/lib/bundler/installer/gem_installer.rb +2 -2
- data/bundler/lib/bundler/installer/parallel_installer.rb +9 -9
- data/bundler/lib/bundler/lazy_specification.rb +16 -3
- data/bundler/lib/bundler/plugin.rb +26 -0
- data/bundler/lib/bundler/plugin/index.rb +9 -0
- data/bundler/lib/bundler/psyched_yaml.rb +0 -15
- data/bundler/lib/bundler/remote_specification.rb +4 -1
- data/bundler/lib/bundler/resolver.rb +31 -8
- data/bundler/lib/bundler/resolver/spec_group.rb +26 -5
- data/bundler/lib/bundler/rubygems_ext.rb +7 -8
- data/bundler/lib/bundler/rubygems_gem_installer.rb +1 -7
- data/bundler/lib/bundler/rubygems_integration.rb +3 -48
- data/bundler/lib/bundler/runtime.rb +2 -12
- data/bundler/lib/bundler/settings.rb +0 -3
- data/bundler/lib/bundler/shared_helpers.rb +1 -1
- data/bundler/lib/bundler/source/git.rb +4 -4
- data/bundler/lib/bundler/source/git/git_proxy.rb +53 -58
- data/bundler/lib/bundler/source/path.rb +5 -1
- data/bundler/lib/bundler/source/path/installer.rb +7 -9
- data/bundler/lib/bundler/source/rubygems.rb +11 -14
- data/bundler/lib/bundler/stub_specification.rb +16 -4
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +9 -1
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +19 -5
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
- data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -4
- data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +10 -0
- data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
- data/bundler/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/bundler/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +75 -189
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +0 -7
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/man/bundle-add.1 +1 -1
- data/bundler/man/bundle-add.1.txt +15 -15
- data/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/man/bundle-binstubs.1.txt +10 -10
- data/bundler/man/bundle-cache.1 +1 -1
- data/bundler/man/bundle-cache.1.txt +15 -15
- data/bundler/man/bundle-check.1 +1 -1
- data/bundler/man/bundle-check.1.txt +8 -8
- data/bundler/man/bundle-clean.1 +1 -1
- data/bundler/man/bundle-clean.1.txt +6 -6
- data/bundler/man/bundle-config.1 +3 -9
- data/bundler/man/bundle-config.1.txt +271 -272
- data/bundler/man/bundle-config.ronn +5 -9
- data/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/man/bundle-doctor.1.txt +9 -9
- data/bundler/man/bundle-exec.1 +1 -1
- data/bundler/man/bundle-exec.1.txt +84 -81
- data/bundler/man/bundle-gem.1 +25 -3
- data/bundler/man/bundle-gem.1.txt +65 -39
- data/bundler/man/bundle-gem.ronn +30 -7
- data/bundler/man/bundle-info.1 +1 -1
- data/bundler/man/bundle-info.1.txt +2 -2
- data/bundler/man/bundle-init.1 +1 -1
- data/bundler/man/bundle-init.1.txt +9 -9
- data/bundler/man/bundle-inject.1 +1 -1
- data/bundler/man/bundle-inject.1.txt +4 -4
- data/bundler/man/bundle-install.1 +1 -1
- data/bundler/man/bundle-install.1.txt +169 -169
- data/bundler/man/bundle-list.1 +7 -7
- data/bundler/man/bundle-list.1.txt +12 -11
- data/bundler/man/bundle-list.ronn +6 -6
- data/bundler/man/bundle-lock.1 +1 -1
- data/bundler/man/bundle-lock.1.txt +28 -28
- data/bundler/man/bundle-open.1 +1 -1
- data/bundler/man/bundle-open.1.txt +3 -3
- data/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/man/bundle-outdated.1.txt +34 -34
- data/bundler/man/bundle-platform.1 +1 -1
- data/bundler/man/bundle-platform.1.txt +16 -16
- data/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/man/bundle-pristine.1.txt +8 -8
- data/bundler/man/bundle-remove.1 +1 -1
- data/bundler/man/bundle-remove.1.txt +9 -9
- data/bundler/man/bundle-show.1 +1 -1
- data/bundler/man/bundle-show.1.txt +8 -8
- data/bundler/man/bundle-update.1 +1 -1
- data/bundler/man/bundle-update.1.txt +149 -148
- data/bundler/man/bundle-viz.1 +1 -1
- data/bundler/man/bundle-viz.1.txt +11 -11
- data/bundler/man/bundle.1 +1 -1
- data/bundler/man/bundle.1.txt +31 -31
- data/bundler/man/gemfile.5 +1 -1
- data/bundler/man/gemfile.5.txt +218 -216
- data/lib/rubygems.rb +68 -148
- data/lib/rubygems/available_set.rb +4 -4
- data/lib/rubygems/basic_specification.rb +11 -5
- data/lib/rubygems/bundler_version_finder.rb +14 -9
- data/lib/rubygems/command.rb +16 -14
- data/lib/rubygems/command_manager.rb +4 -3
- data/lib/rubygems/commands/cert_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +3 -3
- data/lib/rubygems/commands/contents_command.rb +4 -4
- data/lib/rubygems/commands/dependency_command.rb +6 -6
- data/lib/rubygems/commands/fetch_command.rb +2 -2
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/info_command.rb +9 -4
- data/lib/rubygems/commands/install_command.rb +3 -3
- data/lib/rubygems/commands/list_command.rb +9 -6
- data/lib/rubygems/commands/lock_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +0 -2
- data/lib/rubygems/commands/pristine_command.rb +10 -2
- data/lib/rubygems/commands/push_command.rb +4 -42
- data/lib/rubygems/commands/query_command.rb +7 -352
- data/lib/rubygems/commands/search_command.rb +8 -6
- data/lib/rubygems/commands/setup_command.rb +128 -32
- data/lib/rubygems/commands/specification_command.rb +2 -2
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +1 -1
- data/lib/rubygems/commands/unpack_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +40 -10
- data/lib/rubygems/config_file.rb +11 -2
- data/lib/rubygems/core_ext/kernel_require.rb +2 -2
- data/lib/rubygems/defaults.rb +99 -5
- data/lib/rubygems/dependency.rb +2 -5
- data/lib/rubygems/dependency_installer.rb +1 -73
- data/lib/rubygems/dependency_list.rb +7 -7
- data/lib/rubygems/deprecate.rb +46 -1
- data/lib/rubygems/doctor.rb +4 -2
- data/lib/rubygems/errors.rb +3 -2
- data/lib/rubygems/exceptions.rb +2 -13
- data/lib/rubygems/ext.rb +6 -6
- data/lib/rubygems/ext/build_error.rb +2 -0
- data/lib/rubygems/ext/builder.rb +1 -1
- data/lib/rubygems/ext/cmake_builder.rb +1 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +6 -7
- data/lib/rubygems/gem_runner.rb +3 -8
- data/lib/rubygems/gemcutter_utilities.rb +1 -1
- data/lib/rubygems/indexer.rb +1 -19
- data/lib/rubygems/install_update_options.rb +5 -5
- data/lib/rubygems/installer.rb +45 -42
- data/lib/rubygems/installer_test_case.rb +19 -2
- data/lib/rubygems/installer_uninstaller_utils.rb +24 -0
- data/lib/rubygems/local_remote_options.rb +1 -1
- data/lib/rubygems/name_tuple.rb +2 -4
- data/lib/rubygems/package.rb +8 -13
- data/lib/rubygems/package/old.rb +1 -1
- data/lib/rubygems/package/tar_header.rb +3 -3
- data/lib/rubygems/package/tar_reader.rb +0 -1
- data/lib/rubygems/package/tar_reader/entry.rb +0 -1
- data/lib/rubygems/package/tar_test_case.rb +1 -1
- data/lib/rubygems/package/tar_writer.rb +2 -6
- data/lib/rubygems/package_task.rb +1 -5
- data/lib/rubygems/path_support.rb +1 -1
- data/lib/rubygems/platform.rb +3 -3
- data/lib/rubygems/query_utils.rb +362 -0
- data/lib/rubygems/rdoc.rb +0 -12
- data/lib/rubygems/remote_fetcher.rb +5 -19
- data/lib/rubygems/request/connection_pools.rb +1 -1
- data/lib/rubygems/request_set.rb +5 -5
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/request_set/lockfile.rb +8 -8
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
- data/lib/rubygems/requirement.rb +14 -15
- data/lib/rubygems/resolver.rb +7 -8
- data/lib/rubygems/resolver/api_set.rb +3 -3
- data/lib/rubygems/resolver/composed_set.rb +3 -3
- data/lib/rubygems/resolver/conflict.rb +1 -1
- data/lib/rubygems/resolver/index_set.rb +1 -1
- data/lib/rubygems/resolver/installer_set.rb +3 -3
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/safe_yaml.rb +4 -4
- data/lib/rubygems/security.rb +25 -25
- data/lib/rubygems/security/policy.rb +3 -3
- data/lib/rubygems/security/signer.rb +4 -4
- data/lib/rubygems/security/trust_dir.rb +1 -1
- data/lib/rubygems/server.rb +8 -8
- data/lib/rubygems/source/git.rb +7 -6
- data/lib/rubygems/source/local.rb +2 -2
- data/lib/rubygems/source_list.rb +4 -5
- data/lib/rubygems/spec_fetcher.rb +18 -15
- data/lib/rubygems/specification.rb +79 -104
- data/lib/rubygems/specification_policy.rb +79 -27
- data/lib/rubygems/ssl_certs/{rubygems.org → index.rubygems.org}/GlobalSignRootCA.pem +0 -0
- data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
- data/lib/rubygems/test_case.rb +63 -83
- data/lib/rubygems/test_utilities.rb +6 -6
- data/lib/rubygems/uninstaller.rb +35 -14
- data/lib/rubygems/user_interaction.rb +1 -10
- data/lib/rubygems/util.rb +10 -2
- data/lib/rubygems/util/licenses.rb +4 -4
- data/lib/rubygems/validator.rb +1 -1
- data/lib/rubygems/version.rb +4 -4
- data/rubygems-update.gemspec +2 -2
- data/setup.rb +2 -7
- data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -2
- data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +0 -2
- data/test/rubygems/test_bundled_ca.rb +4 -12
- data/test/rubygems/test_deprecate.rb +43 -4
- data/test/rubygems/test_gem.rb +79 -74
- data/test/rubygems/test_gem_available_set.rb +3 -3
- data/test/rubygems/test_gem_bundler_version_finder.rb +19 -1
- data/test/rubygems/test_gem_command.rb +24 -3
- data/test/rubygems/test_gem_command_manager.rb +37 -4
- data/test/rubygems/test_gem_commands_build_command.rb +7 -2
- data/test/rubygems/test_gem_commands_cert_command.rb +2 -2
- data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +48 -15
- data/test/rubygems/test_gem_commands_environment_command.rb +21 -21
- data/test/rubygems/test_gem_commands_generate_index_command.rb +1 -5
- data/test/rubygems/test_gem_commands_info_command.rb +6 -6
- data/test/rubygems/test_gem_commands_install_command.rb +31 -31
- data/test/rubygems/test_gem_commands_mirror.rb +1 -1
- data/test/rubygems/test_gem_commands_open_command.rb +4 -4
- data/test/rubygems/test_gem_commands_owner_command.rb +11 -3
- data/test/rubygems/test_gem_commands_pristine_command.rb +41 -8
- data/test/rubygems/test_gem_commands_push_command.rb +7 -2
- data/test/rubygems/test_gem_commands_query_command.rb +9 -5
- data/test/rubygems/test_gem_commands_setup_command.rb +160 -108
- data/test/rubygems/test_gem_commands_signin_command.rb +6 -4
- data/test/rubygems/test_gem_commands_signout_command.rb +0 -5
- data/test/rubygems/test_gem_commands_specification_command.rb +18 -18
- data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -1
- data/test/rubygems/test_gem_commands_update_command.rb +68 -5
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_commands_yank_command.rb +14 -6
- data/test/rubygems/test_gem_config_file.rb +7 -10
- data/test/rubygems/test_gem_dependency_installer.rb +52 -189
- data/test/rubygems/test_gem_dependency_list.rb +8 -8
- data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -1
- data/test/rubygems/test_gem_doctor.rb +28 -0
- data/test/rubygems/test_gem_ext_builder.rb +14 -25
- data/test/rubygems/test_gem_ext_cmake_builder.rb +13 -12
- data/test/rubygems/test_gem_ext_configure_builder.rb +1 -9
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +0 -1
- data/test/rubygems/test_gem_ext_rake_builder.rb +9 -9
- data/test/rubygems/test_gem_gem_runner.rb +42 -0
- data/test/rubygems/test_gem_gemcutter_utilities.rb +5 -0
- data/test/rubygems/test_gem_indexer.rb +9 -13
- data/test/rubygems/test_gem_installer.rb +149 -45
- data/test/rubygems/test_gem_package.rb +13 -12
- data/test/rubygems/test_gem_package_tar_header.rb +19 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +3 -3
- data/test/rubygems/test_gem_package_task.rb +46 -11
- data/test/rubygems/test_gem_remote_fetcher.rb +152 -190
- data/test/rubygems/test_gem_request.rb +11 -11
- data/test/rubygems/test_gem_request_set.rb +20 -20
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +9 -9
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +118 -118
- data/test/rubygems/test_gem_requirement.rb +2 -2
- data/test/rubygems/test_gem_resolver.rb +6 -6
- data/test/rubygems/test_gem_resolver_api_set.rb +3 -3
- data/test/rubygems/test_gem_resolver_best_set.rb +2 -2
- data/test/rubygems/test_gem_resolver_index_set.rb +2 -2
- data/test/rubygems/test_gem_resolver_installer_set.rb +7 -7
- data/test/rubygems/test_gem_resolver_lock_set.rb +3 -3
- data/test/rubygems/test_gem_security.rb +20 -20
- data/test/rubygems/test_gem_security_policy.rb +5 -8
- data/test/rubygems/test_gem_security_signer.rb +8 -8
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_server.rb +10 -10
- data/test/rubygems/test_gem_source.rb +12 -14
- data/test/rubygems/test_gem_source_git.rb +12 -11
- data/test/rubygems/test_gem_source_installed.rb +7 -7
- data/test/rubygems/test_gem_source_local.rb +8 -8
- data/test/rubygems/test_gem_source_lock.rb +10 -10
- data/test/rubygems/test_gem_source_specific_file.rb +7 -7
- data/test/rubygems/test_gem_source_vendor.rb +7 -7
- data/test/rubygems/test_gem_spec_fetcher.rb +11 -2
- data/test/rubygems/test_gem_specification.rb +143 -113
- data/test/rubygems/test_gem_stream_ui.rb +3 -1
- data/test/rubygems/test_gem_text.rb +1 -1
- data/test/rubygems/test_gem_uninstaller.rb +134 -10
- data/test/rubygems/test_gem_util.rb +7 -5
- data/test/rubygems/test_gem_version.rb +1 -1
- data/test/rubygems/test_kernel.rb +10 -12
- data/test/rubygems/test_project_sanity.rb +8 -1
- data/test/rubygems/test_require.rb +141 -43
- metadata +32 -45
- data/.bundle/config +0 -2
- data/.rubocop.yml +0 -91
- data/Gemfile +0 -8
- data/Gemfile.lock +0 -43
- data/bundler/CODE_OF_CONDUCT.md +0 -136
- data/lib/rubygems/source_local.rb +0 -7
- data/lib/rubygems/source_specific_file.rb +0 -6
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +0 -21
- data/lib/ubygems.rb +0 -14
- data/tmp/.keep +0 -0
- data/util/CL2notes +0 -55
- data/util/bisect +0 -10
- data/util/ci.sh +0 -62
- data/util/cops/deprecations.rb +0 -52
- data/util/create_certs.rb +0 -171
- data/util/create_certs.sh +0 -27
- data/util/create_encrypted_key.rb +0 -16
- data/util/generate_spdx_license_list.rb +0 -63
- data/util/patch_with_prs.rb +0 -77
- data/util/rubocop +0 -8
- data/util/update_bundled_ca_certificates.rb +0 -137
- data/util/update_changelog.rb +0 -64
data/lib/rubygems.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# -*- ruby -*-
|
3
2
|
#--
|
4
3
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
5
4
|
# All rights reserved.
|
@@ -9,7 +8,7 @@
|
|
9
8
|
require 'rbconfig'
|
10
9
|
|
11
10
|
module Gem
|
12
|
-
VERSION = "3.1
|
11
|
+
VERSION = "3.2.0.rc.1".freeze
|
13
12
|
end
|
14
13
|
|
15
14
|
# Must be first since it unloads the prelude from 1.9.2
|
@@ -43,10 +42,10 @@ require 'rubygems/errors'
|
|
43
42
|
#
|
44
43
|
# == RubyGems Plugins
|
45
44
|
#
|
46
|
-
#
|
45
|
+
# RubyGems will load plugins in the latest version of each installed gem or
|
47
46
|
# $LOAD_PATH. Plugins must be named 'rubygems_plugin' (.rb, .so, etc) and
|
48
|
-
# placed at the root of your gem's #require_path. Plugins are
|
49
|
-
#
|
47
|
+
# placed at the root of your gem's #require_path. Plugins are installed at a
|
48
|
+
# special location and loaded on boot.
|
50
49
|
#
|
51
50
|
# For an example plugin, see the {Graph gem}[https://github.com/seattlerb/graph]
|
52
51
|
# which adds a `gem graph` command.
|
@@ -148,6 +147,7 @@ module Gem
|
|
148
147
|
doc
|
149
148
|
extensions
|
150
149
|
gems
|
150
|
+
plugins
|
151
151
|
specifications
|
152
152
|
].freeze
|
153
153
|
|
@@ -317,6 +317,13 @@ module Gem
|
|
317
317
|
Gem.default_bindir
|
318
318
|
end
|
319
319
|
|
320
|
+
##
|
321
|
+
# The path were rubygems plugins are to be installed.
|
322
|
+
|
323
|
+
def self.plugindir(install_dir=Gem.dir)
|
324
|
+
File.join install_dir, 'plugins'
|
325
|
+
end
|
326
|
+
|
320
327
|
##
|
321
328
|
# Reset the +dir+ and +path+ values. The next time +dir+ or +path+
|
322
329
|
# is requested, the values will be calculated from scratch. This is
|
@@ -329,13 +336,6 @@ module Gem
|
|
329
336
|
Gem::Security.reset if defined?(Gem::Security)
|
330
337
|
end
|
331
338
|
|
332
|
-
##
|
333
|
-
# The path to standard location of the user's .gemrc file.
|
334
|
-
|
335
|
-
def self.config_file
|
336
|
-
@config_file ||= File.join Gem.user_home, '.gemrc'
|
337
|
-
end
|
338
|
-
|
339
339
|
##
|
340
340
|
# The standard configuration object for gems.
|
341
341
|
|
@@ -393,11 +393,11 @@ module Gem
|
|
393
393
|
target[k] = v
|
394
394
|
when Array
|
395
395
|
unless Gem::Deprecate.skip
|
396
|
-
warn <<-
|
396
|
+
warn <<-EOWARN
|
397
397
|
Array values in the parameter to `Gem.paths=` are deprecated.
|
398
398
|
Please use a String or nil.
|
399
399
|
An Array (#{env.inspect}) was passed in from #{caller[3]}
|
400
|
-
|
400
|
+
EOWARN
|
401
401
|
end
|
402
402
|
target[k] = v.join File::PATH_SEPARATOR
|
403
403
|
end
|
@@ -411,8 +411,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
411
411
|
|
412
412
|
##
|
413
413
|
# The path where gems are to be installed.
|
414
|
-
#--
|
415
|
-
# FIXME deprecate these once everything else has been done -ebh
|
416
414
|
|
417
415
|
def self.dir
|
418
416
|
paths.home
|
@@ -465,7 +463,10 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
465
463
|
subdirs.each do |name|
|
466
464
|
subdir = File.join dir, name
|
467
465
|
next if File.exist? subdir
|
468
|
-
|
466
|
+
begin
|
467
|
+
FileUtils.mkdir_p subdir, **options
|
468
|
+
rescue Errno::EACCES
|
469
|
+
end
|
469
470
|
end
|
470
471
|
ensure
|
471
472
|
File.umask old_umask
|
@@ -502,7 +503,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
502
503
|
|
503
504
|
gem_specifications = @gemdeps ? Gem.loaded_specs.values : Gem::Specification.stubs
|
504
505
|
|
505
|
-
files.concat gem_specifications.map {
|
506
|
+
files.concat gem_specifications.map {|spec|
|
506
507
|
spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}")
|
507
508
|
}.flatten
|
508
509
|
|
@@ -517,7 +518,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
517
518
|
glob_with_suffixes = "#{glob}#{Gem.suffix_pattern}"
|
518
519
|
$LOAD_PATH.map do |load_path|
|
519
520
|
Gem::Util.glob_files_in_dir(glob_with_suffixes, load_path)
|
520
|
-
end.flatten.select {
|
521
|
+
end.flatten.select {|file| File.file? file.tap(&Gem::UNTAINT) }
|
521
522
|
end
|
522
523
|
|
523
524
|
##
|
@@ -537,7 +538,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
537
538
|
|
538
539
|
files = find_files_from_load_path glob if check_load_path
|
539
540
|
|
540
|
-
files.concat Gem::Specification.latest_specs(true).map {
|
541
|
+
files.concat Gem::Specification.latest_specs(true).map {|spec|
|
541
542
|
spec.matches_for_glob("#{glob}#{Gem.suffix_pattern}")
|
542
543
|
}.flatten
|
543
544
|
|
@@ -548,83 +549,12 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
548
549
|
return files
|
549
550
|
end
|
550
551
|
|
551
|
-
##
|
552
|
-
# Finds the user's home directory.
|
553
|
-
#--
|
554
|
-
# Some comments from the ruby-talk list regarding finding the home
|
555
|
-
# directory:
|
556
|
-
#
|
557
|
-
# I have HOME, USERPROFILE and HOMEDRIVE + HOMEPATH. Ruby seems
|
558
|
-
# to be depending on HOME in those code samples. I propose that
|
559
|
-
# it should fallback to USERPROFILE and HOMEDRIVE + HOMEPATH (at
|
560
|
-
# least on Win32).
|
561
|
-
#++
|
562
|
-
#--
|
563
|
-
#
|
564
|
-
#++
|
565
|
-
|
566
|
-
def self.find_home
|
567
|
-
Dir.home.dup
|
568
|
-
rescue
|
569
|
-
if Gem.win_platform?
|
570
|
-
File.expand_path File.join(ENV['HOMEDRIVE'] || ENV['SystemDrive'], '/')
|
571
|
-
else
|
572
|
-
File.expand_path "/"
|
573
|
-
end
|
574
|
-
end
|
575
|
-
|
576
|
-
private_class_method :find_home
|
577
|
-
|
578
|
-
# TODO: remove in RubyGems 4.0
|
579
|
-
|
580
|
-
##
|
581
|
-
# Zlib::GzipReader wrapper that unzips +data+.
|
582
|
-
|
583
|
-
def self.gunzip(data)
|
584
|
-
Gem::Util.gunzip data
|
585
|
-
end
|
586
|
-
|
587
|
-
class << self
|
588
|
-
|
589
|
-
extend Gem::Deprecate
|
590
|
-
deprecate :gunzip, "Gem::Util.gunzip", 2018, 12
|
591
|
-
|
592
|
-
end
|
593
|
-
|
594
|
-
##
|
595
|
-
# Zlib::GzipWriter wrapper that zips +data+.
|
596
|
-
|
597
|
-
def self.gzip(data)
|
598
|
-
Gem::Util.gzip data
|
599
|
-
end
|
600
|
-
|
601
|
-
class << self
|
602
|
-
|
603
|
-
extend Gem::Deprecate
|
604
|
-
deprecate :gzip, "Gem::Util.gzip", 2018, 12
|
605
|
-
|
606
|
-
end
|
607
|
-
|
608
|
-
##
|
609
|
-
# A Zlib::Inflate#inflate wrapper
|
610
|
-
|
611
|
-
def self.inflate(data)
|
612
|
-
Gem::Util.inflate data
|
613
|
-
end
|
614
|
-
|
615
|
-
class << self
|
616
|
-
|
617
|
-
extend Gem::Deprecate
|
618
|
-
deprecate :inflate, "Gem::Util.inflate", 2018, 12
|
619
|
-
|
620
|
-
end
|
621
|
-
|
622
552
|
##
|
623
553
|
# Top level install helper method. Allows you to install gems interactively:
|
624
554
|
#
|
625
555
|
# % irb
|
626
556
|
# >> Gem.install "minitest"
|
627
|
-
# Fetching: minitest-
|
557
|
+
# Fetching: minitest-5.14.0.gem (100%)
|
628
558
|
# => [#<Gem::Specification:0x1013b4528 @name="minitest", ...>]
|
629
559
|
|
630
560
|
def self.install(name, version = Gem::Requirement.default, *options)
|
@@ -689,13 +619,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
689
619
|
return if @yaml_loaded
|
690
620
|
return unless defined?(gem)
|
691
621
|
|
692
|
-
begin
|
693
|
-
gem 'psych', '>= 2.0.0'
|
694
|
-
rescue Gem::LoadError
|
695
|
-
# It's OK if the user does not have the psych gem installed. We will
|
696
|
-
# attempt to require the stdlib version
|
697
|
-
end
|
698
|
-
|
699
622
|
begin
|
700
623
|
# Try requiring the gem version *or* stdlib version of psych.
|
701
624
|
require 'psych'
|
@@ -909,8 +832,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
909
832
|
|
910
833
|
def self.ruby
|
911
834
|
if @ruby.nil?
|
912
|
-
@ruby =
|
913
|
-
"#{RbConfig::CONFIG['ruby_install_name']}#{RbConfig::CONFIG['EXEEXT']}")
|
835
|
+
@ruby = RbConfig.ruby
|
914
836
|
|
915
837
|
@ruby = "\"#{@ruby}\"" if @ruby =~ /\s/
|
916
838
|
end
|
@@ -1023,17 +945,34 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1023
945
|
@suffix_pattern ||= "{#{suffixes.join(',')}}"
|
1024
946
|
end
|
1025
947
|
|
948
|
+
##
|
949
|
+
# Regexp for require-able path suffixes.
|
950
|
+
|
1026
951
|
def self.suffix_regexp
|
1027
952
|
@suffix_regexp ||= /#{Regexp.union(suffixes)}\z/
|
1028
953
|
end
|
1029
954
|
|
955
|
+
##
|
956
|
+
# Glob pattern for require-able plugin suffixes.
|
957
|
+
|
958
|
+
def self.plugin_suffix_pattern
|
959
|
+
@plugin_suffix_pattern ||= "_plugin#{suffix_pattern}"
|
960
|
+
end
|
961
|
+
|
962
|
+
##
|
963
|
+
# Regexp for require-able plugin suffixes.
|
964
|
+
|
965
|
+
def self.plugin_suffix_regexp
|
966
|
+
@plugin_suffix_regexp ||= /_plugin#{suffix_regexp}\z/
|
967
|
+
end
|
968
|
+
|
1030
969
|
##
|
1031
970
|
# Suffixes for require-able paths.
|
1032
971
|
|
1033
972
|
def self.suffixes
|
1034
973
|
@suffixes ||= ['',
|
1035
974
|
'.rb',
|
1036
|
-
*%w
|
975
|
+
*%w[DLEXT DLEXT2].map do |key|
|
1037
976
|
val = RbConfig::CONFIG[key]
|
1038
977
|
next unless val and not val.empty?
|
1039
978
|
".#{val}"
|
@@ -1074,24 +1013,17 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1074
1013
|
paths.flatten!
|
1075
1014
|
paths.compact!
|
1076
1015
|
hash = { "GEM_HOME" => home, "GEM_PATH" => paths.empty? ? home : paths.join(File::PATH_SEPARATOR) }
|
1077
|
-
hash.delete_if {
|
1016
|
+
hash.delete_if {|_, v| v.nil? }
|
1078
1017
|
self.paths = hash
|
1079
1018
|
end
|
1080
1019
|
|
1081
|
-
##
|
1082
|
-
# The home directory for the user.
|
1083
|
-
|
1084
|
-
def self.user_home
|
1085
|
-
@user_home ||= find_home.tap(&Gem::UNTAINT)
|
1086
|
-
end
|
1087
|
-
|
1088
1020
|
##
|
1089
1021
|
# Is this a windows platform?
|
1090
1022
|
|
1091
1023
|
def self.win_platform?
|
1092
1024
|
if @@win_platform.nil?
|
1093
1025
|
ruby_platform = RbConfig::CONFIG['host_os']
|
1094
|
-
@@win_platform = !!WIN_PATTERNS.find {
|
1026
|
+
@@win_platform = !!WIN_PATTERNS.find {|r| ruby_platform =~ r }
|
1095
1027
|
end
|
1096
1028
|
|
1097
1029
|
@@win_platform
|
@@ -1125,35 +1057,17 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1125
1057
|
end
|
1126
1058
|
|
1127
1059
|
##
|
1128
|
-
# Find
|
1129
|
-
# them
|
1060
|
+
# Find rubygems plugin files in the standard location and load them
|
1130
1061
|
|
1131
1062
|
def self.load_plugins
|
1132
|
-
|
1133
|
-
if ENV['RUBYGEMS_LOAD_ALL_PLUGINS']
|
1134
|
-
load_plugin_files find_files('rubygems_plugin', false)
|
1135
|
-
else
|
1136
|
-
load_plugin_files find_latest_files('rubygems_plugin', false)
|
1137
|
-
end
|
1063
|
+
load_plugin_files Gem::Util.glob_files_in_dir("*#{Gem.plugin_suffix_pattern}", plugindir)
|
1138
1064
|
end
|
1139
1065
|
|
1140
1066
|
##
|
1141
1067
|
# Find all 'rubygems_plugin' files in $LOAD_PATH and load them
|
1142
1068
|
|
1143
1069
|
def self.load_env_plugins
|
1144
|
-
|
1145
|
-
|
1146
|
-
files = []
|
1147
|
-
glob = "#{path}#{Gem.suffix_pattern}"
|
1148
|
-
$LOAD_PATH.each do |load_path|
|
1149
|
-
globbed = Gem::Util.glob_files_in_dir(glob, load_path)
|
1150
|
-
|
1151
|
-
globbed.each do |load_path_file|
|
1152
|
-
files << load_path_file if File.file?(load_path_file.tap(&Gem::UNTAINT))
|
1153
|
-
end
|
1154
|
-
end
|
1155
|
-
|
1156
|
-
load_plugin_files files
|
1070
|
+
load_plugin_files find_files_from_load_path("rubygems_plugin")
|
1157
1071
|
end
|
1158
1072
|
|
1159
1073
|
##
|
@@ -1186,7 +1100,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1186
1100
|
|
1187
1101
|
if path == "-"
|
1188
1102
|
Gem::Util.traverse_parents Dir.pwd do |directory|
|
1189
|
-
dep_file = GEM_DEP_FILES.find {
|
1103
|
+
dep_file = GEM_DEP_FILES.find {|f| File.file?(f) }
|
1190
1104
|
|
1191
1105
|
next unless dep_file
|
1192
1106
|
|
@@ -1228,18 +1142,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1228
1142
|
end
|
1229
1143
|
end
|
1230
1144
|
|
1231
|
-
class << self
|
1232
|
-
|
1233
|
-
##
|
1234
|
-
# TODO remove with RubyGems 4.0
|
1235
|
-
|
1236
|
-
alias detect_gemdeps use_gemdeps # :nodoc:
|
1237
|
-
|
1238
|
-
extend Gem::Deprecate
|
1239
|
-
deprecate :detect_gemdeps, "Gem.use_gemdeps", 2018, 12
|
1240
|
-
|
1241
|
-
end
|
1242
|
-
|
1243
1145
|
##
|
1244
1146
|
# If the SOURCE_DATE_EPOCH environment variable is set, returns it's value.
|
1245
1147
|
# Otherwise, returns the time that `Gem.source_date_epoch_string` was
|
@@ -1285,6 +1187,12 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1285
1187
|
# other.
|
1286
1188
|
class << self
|
1287
1189
|
|
1190
|
+
##
|
1191
|
+
# RubyGems distributors (like operating system package managers) can
|
1192
|
+
# disable RubyGems update by setting this to error message printed to
|
1193
|
+
# end-users on gem update --system instead of actual update.
|
1194
|
+
attr_accessor :disable_system_update_message
|
1195
|
+
|
1288
1196
|
##
|
1289
1197
|
# Hash of loaded Gem::Specification keyed by name
|
1290
1198
|
|
@@ -1309,7 +1217,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1309
1217
|
#
|
1310
1218
|
|
1311
1219
|
def register_default_spec(spec)
|
1312
|
-
extended_require_paths = spec.require_paths.map {|f| f + "/"}
|
1220
|
+
extended_require_paths = spec.require_paths.map {|f| f + "/" }
|
1313
1221
|
new_format = extended_require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }
|
1314
1222
|
|
1315
1223
|
if new_format
|
@@ -1323,6 +1231,8 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1323
1231
|
next unless $~
|
1324
1232
|
end
|
1325
1233
|
|
1234
|
+
spec.activate if already_loaded?(file)
|
1235
|
+
|
1326
1236
|
@path_to_default_spec_map[file] = spec
|
1327
1237
|
@path_to_default_spec_map[file.sub(suffix_regexp, "")] = spec
|
1328
1238
|
end
|
@@ -1388,6 +1298,18 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1388
1298
|
|
1389
1299
|
attr_reader :pre_uninstall_hooks
|
1390
1300
|
|
1301
|
+
private
|
1302
|
+
|
1303
|
+
def already_loaded?(file)
|
1304
|
+
default_gem_load_paths.find do |load_path_entry|
|
1305
|
+
$LOADED_FEATURES.include?("#{load_path_entry}/#{file}")
|
1306
|
+
end
|
1307
|
+
end
|
1308
|
+
|
1309
|
+
def default_gem_load_paths
|
1310
|
+
@default_gem_load_paths ||= $LOAD_PATH[load_path_insert_index..-1]
|
1311
|
+
end
|
1312
|
+
|
1391
1313
|
end
|
1392
1314
|
|
1393
1315
|
##
|
@@ -1413,8 +1335,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1413
1335
|
autoload :Specification, File.expand_path('rubygems/specification', __dir__)
|
1414
1336
|
autoload :Util, File.expand_path('rubygems/util', __dir__)
|
1415
1337
|
autoload :Version, File.expand_path('rubygems/version', __dir__)
|
1416
|
-
|
1417
|
-
require "rubygems/specification"
|
1418
1338
|
end
|
1419
1339
|
|
1420
1340
|
require 'rubygems/exceptions'
|
@@ -70,11 +70,11 @@ class Gem::AvailableSet
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def all_specs
|
73
|
-
@set.map {
|
73
|
+
@set.map {|t| t.spec }
|
74
74
|
end
|
75
75
|
|
76
76
|
def match_platform!
|
77
|
-
@set.reject! {
|
77
|
+
@set.reject! {|t| !Gem::Platform.match(t.spec.platform) }
|
78
78
|
@sorted = nil
|
79
79
|
self
|
80
80
|
end
|
@@ -91,7 +91,7 @@ class Gem::AvailableSet
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def source_for(spec)
|
94
|
-
f = @set.find {
|
94
|
+
f = @set.find {|t| t.spec == spec }
|
95
95
|
f.source
|
96
96
|
end
|
97
97
|
|
@@ -160,7 +160,7 @@ class Gem::AvailableSet
|
|
160
160
|
end
|
161
161
|
|
162
162
|
def inject_into_list(dep_list)
|
163
|
-
@set.each {
|
163
|
+
@set.each {|t| dep_list.add t.spec }
|
164
164
|
end
|
165
165
|
|
166
166
|
end
|
@@ -41,7 +41,7 @@ class Gem::BasicSpecification
|
|
41
41
|
class << self
|
42
42
|
|
43
43
|
extend Gem::Deprecate
|
44
|
-
|
44
|
+
rubygems_deprecate :default_specifications_dir, "Gem.default_specifications_dir"
|
45
45
|
|
46
46
|
end
|
47
47
|
|
@@ -274,10 +274,16 @@ class Gem::BasicSpecification
|
|
274
274
|
# Return all files in this gem that match for +glob+.
|
275
275
|
|
276
276
|
def matches_for_glob(glob) # TODO: rename?
|
277
|
-
# TODO: do we need these?? Kill it
|
278
277
|
glob = File.join(self.lib_dirs_glob, glob)
|
279
278
|
|
280
|
-
Dir[glob].map {
|
279
|
+
Dir[glob].map {|f| f.tap(&Gem::UNTAINT) } # FIX our tests are broken, run w/ SAFE=1
|
280
|
+
end
|
281
|
+
|
282
|
+
##
|
283
|
+
# Returns the list of plugins in this spec.
|
284
|
+
|
285
|
+
def plugins
|
286
|
+
matches_for_glob("rubygems#{Gem.plugin_suffix_pattern}")
|
281
287
|
end
|
282
288
|
|
283
289
|
##
|
@@ -329,12 +335,12 @@ class Gem::BasicSpecification
|
|
329
335
|
def have_file?(file, suffixes)
|
330
336
|
return true if raw_require_paths.any? do |path|
|
331
337
|
base = File.join(gems_dir, full_name, path.tap(&Gem::UNTAINT), file).tap(&Gem::UNTAINT)
|
332
|
-
suffixes.any? {
|
338
|
+
suffixes.any? {|suf| File.file? base + suf }
|
333
339
|
end
|
334
340
|
|
335
341
|
if have_extensions?
|
336
342
|
base = File.join extension_dir, file
|
337
|
-
suffixes.any? {
|
343
|
+
suffixes.any? {|suf| File.file? base + suf }
|
338
344
|
else
|
339
345
|
false
|
340
346
|
end
|