rubygems-update 2.7.11 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +67 -0
- data/.travis.yml +24 -18
- data/CODE_OF_CONDUCT.md +10 -8
- data/CONTRIBUTING.md +148 -0
- data/History.txt +458 -8
- data/MAINTAINERS.txt +1 -0
- data/Manifest.txt +16 -9
- data/POLICIES.md +92 -0
- data/README.md +53 -26
- data/Rakefile +77 -211
- data/{UPGRADING.rdoc → UPGRADING.md} +31 -32
- data/appveyor.yml +20 -45
- data/bin/gem +1 -2
- data/bin/update_rubygems +2 -3
- data/bundler/CHANGELOG.md +65 -0
- data/bundler/bundler.gemspec +7 -1
- data/bundler/lib/bundler/build_metadata.rb +1 -1
- data/bundler/lib/bundler/cli/add.rb +15 -5
- data/bundler/lib/bundler/cli/binstubs.rb +8 -2
- data/bundler/lib/bundler/cli/doctor.rb +47 -1
- data/bundler/lib/bundler/cli/install.rb +8 -5
- data/bundler/lib/bundler/cli/list.rb +41 -5
- data/bundler/lib/bundler/cli/outdated.rb +7 -1
- data/bundler/lib/bundler/cli/pristine.rb +4 -0
- data/bundler/lib/bundler/cli/remove.rb +18 -0
- data/bundler/lib/bundler/cli.rb +63 -21
- data/bundler/lib/bundler/definition.rb +15 -16
- data/bundler/lib/bundler/dependency.rb +2 -2
- data/bundler/lib/bundler/dsl.rb +19 -3
- data/bundler/lib/bundler/feature_flag.rb +7 -0
- data/bundler/lib/bundler/gem_version_promoter.rb +4 -2
- data/bundler/lib/bundler/injector.rb +168 -9
- data/bundler/lib/bundler/installer/parallel_installer.rb +5 -0
- data/bundler/lib/bundler/installer.rb +29 -6
- data/bundler/lib/bundler/plugin/events.rb +61 -0
- data/bundler/lib/bundler/plugin.rb +10 -3
- data/bundler/lib/bundler/resolver.rb +2 -2
- data/bundler/lib/bundler/rubygems_gem_installer.rb +7 -0
- data/bundler/lib/bundler/runtime.rb +8 -2
- data/bundler/lib/bundler/settings/validator.rb +23 -0
- data/bundler/lib/bundler/settings.rb +24 -3
- data/bundler/lib/bundler/shared_helpers.rb +19 -3
- data/bundler/lib/bundler/source/metadata.rb +2 -3
- data/bundler/lib/bundler/source.rb +9 -9
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +26 -8
- data/bundler/man/bundle-add.ronn +13 -2
- data/bundler/man/bundle-config.ronn +21 -0
- data/bundler/man/bundle-install.ronn +1 -1
- data/bundler/man/bundle-list.ronn +19 -1
- data/bundler/man/bundle-outdated.ronn +4 -0
- data/bundler/man/bundle-remove.ronn +23 -0
- data/bundler/man/bundle-update.ronn +1 -1
- data/bundler/man/bundle.ronn +3 -0
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/basic_specification.rb +12 -12
- data/lib/rubygems/bundler_version_finder.rb +3 -3
- data/lib/rubygems/command.rb +22 -15
- data/lib/rubygems/command_manager.rb +22 -5
- data/lib/rubygems/commands/build_command.rb +41 -7
- data/lib/rubygems/commands/cert_command.rb +45 -24
- data/lib/rubygems/commands/check_command.rb +1 -1
- data/lib/rubygems/commands/cleanup_command.rb +14 -7
- data/lib/rubygems/commands/contents_command.rb +14 -15
- data/lib/rubygems/commands/dependency_command.rb +17 -17
- data/lib/rubygems/commands/environment_command.rb +20 -1
- data/lib/rubygems/commands/fetch_command.rb +2 -3
- data/lib/rubygems/commands/generate_index_command.rb +2 -3
- data/lib/rubygems/commands/help_command.rb +12 -13
- data/lib/rubygems/commands/info_command.rb +33 -0
- data/lib/rubygems/commands/install_command.rb +21 -17
- data/lib/rubygems/commands/list_command.rb +0 -1
- data/lib/rubygems/commands/lock_command.rb +3 -4
- data/lib/rubygems/commands/open_command.rb +16 -10
- data/lib/rubygems/commands/owner_command.rb +21 -7
- data/lib/rubygems/commands/pristine_command.rb +23 -16
- data/lib/rubygems/commands/push_command.rb +19 -8
- data/lib/rubygems/commands/query_command.rb +24 -24
- data/lib/rubygems/commands/rdoc_command.rb +3 -4
- data/lib/rubygems/commands/search_command.rb +0 -1
- data/lib/rubygems/commands/server_command.rb +1 -2
- data/lib/rubygems/commands/setup_command.rb +86 -48
- data/lib/rubygems/commands/signin_command.rb +2 -1
- data/lib/rubygems/commands/signout_command.rb +2 -2
- data/lib/rubygems/commands/sources_command.rb +11 -12
- data/lib/rubygems/commands/specification_command.rb +7 -7
- data/lib/rubygems/commands/uninstall_command.rb +50 -18
- data/lib/rubygems/commands/unpack_command.rb +16 -7
- data/lib/rubygems/commands/update_command.rb +28 -23
- data/lib/rubygems/commands/which_command.rb +5 -8
- data/lib/rubygems/commands/yank_command.rb +1 -2
- data/lib/rubygems/compatibility.rb +1 -21
- data/lib/rubygems/config_file.rb +36 -36
- data/lib/rubygems/core_ext/kernel_require.rb +6 -6
- data/lib/rubygems/core_ext/kernel_warn.rb +45 -0
- data/lib/rubygems/defaults.rb +31 -19
- data/lib/rubygems/dependency.rb +15 -15
- data/lib/rubygems/dependency_installer.rb +30 -33
- data/lib/rubygems/dependency_list.rb +9 -10
- data/lib/rubygems/deprecate.rb +2 -3
- data/lib/rubygems/doctor.rb +5 -6
- data/lib/rubygems/errors.rb +3 -3
- data/lib/rubygems/exceptions.rb +11 -8
- data/lib/rubygems/ext/build_error.rb +0 -1
- data/lib/rubygems/ext/builder.rb +50 -23
- data/lib/rubygems/ext/cmake_builder.rb +2 -2
- data/lib/rubygems/ext/configure_builder.rb +2 -3
- data/lib/rubygems/ext/ext_conf_builder.rb +8 -7
- data/lib/rubygems/ext/rake_builder.rb +16 -18
- data/lib/rubygems/ext.rb +0 -1
- data/lib/rubygems/gem_runner.rb +2 -2
- data/lib/rubygems/gemcutter_utilities.rb +46 -12
- data/lib/rubygems/indexer.rb +19 -12
- data/lib/rubygems/install_default_message.rb +0 -1
- data/lib/rubygems/install_message.rb +0 -1
- data/lib/rubygems/install_update_options.rb +3 -29
- data/lib/rubygems/installer.rb +97 -55
- data/lib/rubygems/installer_test_case.rb +2 -16
- data/lib/rubygems/local_remote_options.rb +5 -4
- data/lib/rubygems/mock_gem_ui.rb +3 -4
- data/lib/rubygems/name_tuple.rb +4 -4
- data/lib/rubygems/package/digest_io.rb +3 -4
- data/lib/rubygems/package/file_source.rb +3 -4
- data/lib/rubygems/package/io_source.rb +1 -2
- data/lib/rubygems/package/old.rb +8 -16
- data/lib/rubygems/package/source.rb +0 -1
- data/lib/rubygems/package/tar_header.rb +13 -4
- data/lib/rubygems/package/tar_reader/entry.rb +20 -4
- data/lib/rubygems/package/tar_reader.rb +2 -4
- data/lib/rubygems/package/tar_test_case.rb +2 -8
- data/lib/rubygems/package/tar_writer.rb +13 -15
- data/lib/rubygems/package.rb +90 -63
- data/lib/rubygems/package_task.rb +0 -1
- data/lib/rubygems/path_support.rb +16 -6
- data/lib/rubygems/platform.rb +4 -5
- data/lib/rubygems/psych_tree.rb +1 -1
- data/lib/rubygems/rdoc.rb +2 -313
- data/lib/rubygems/remote_fetcher.rb +29 -82
- data/lib/rubygems/request/connection_pools.rb +24 -13
- data/lib/rubygems/request/http_pool.rb +3 -4
- data/lib/rubygems/request/https_pool.rb +1 -3
- data/lib/rubygems/request.rb +17 -16
- data/lib/rubygems/request_set/gem_dependency_api.rb +46 -49
- data/lib/rubygems/request_set/lockfile/parser.rb +18 -29
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +9 -9
- data/lib/rubygems/request_set/lockfile.rb +12 -12
- data/lib/rubygems/request_set.rb +52 -25
- data/lib/rubygems/requirement.rb +32 -21
- data/lib/rubygems/resolver/activation_request.rb +6 -6
- data/lib/rubygems/resolver/api_set.rb +5 -6
- data/lib/rubygems/resolver/api_specification.rb +2 -3
- data/lib/rubygems/resolver/best_set.rb +5 -6
- data/lib/rubygems/resolver/composed_set.rb +5 -6
- data/lib/rubygems/resolver/conflict.rb +5 -5
- data/lib/rubygems/resolver/current_set.rb +1 -2
- data/lib/rubygems/resolver/dependency_request.rb +4 -4
- data/lib/rubygems/resolver/git_set.rb +5 -6
- data/lib/rubygems/resolver/git_specification.rb +4 -5
- data/lib/rubygems/resolver/index_set.rb +5 -6
- data/lib/rubygems/resolver/index_specification.rb +3 -4
- data/lib/rubygems/resolver/installed_specification.rb +3 -4
- data/lib/rubygems/resolver/installer_set.rb +12 -12
- data/lib/rubygems/resolver/local_specification.rb +1 -2
- data/lib/rubygems/resolver/lock_set.rb +5 -6
- data/lib/rubygems/resolver/lock_specification.rb +7 -8
- data/lib/rubygems/resolver/requirement_list.rb +1 -1
- data/lib/rubygems/resolver/set.rb +2 -2
- data/lib/rubygems/resolver/source_set.rb +4 -5
- data/lib/rubygems/resolver/spec_specification.rb +1 -2
- data/lib/rubygems/resolver/specification.rb +10 -7
- data/lib/rubygems/resolver/stats.rb +1 -1
- data/lib/rubygems/resolver/vendor_set.rb +4 -5
- data/lib/rubygems/resolver/vendor_specification.rb +2 -3
- data/lib/rubygems/resolver.rb +14 -16
- data/lib/rubygems/s3_uri_signer.rb +183 -0
- data/lib/rubygems/safe_yaml.rb +18 -10
- data/lib/rubygems/security/policies.rb +1 -2
- data/lib/rubygems/security/policy.rb +25 -25
- data/lib/rubygems/security/signer.rb +72 -24
- data/lib/rubygems/security/trust_dir.rb +10 -10
- data/lib/rubygems/security.rb +21 -22
- data/lib/rubygems/security_option.rb +0 -1
- data/lib/rubygems/server.rb +21 -21
- data/lib/rubygems/source/git.rb +9 -10
- data/lib/rubygems/source/installed.rb +3 -4
- data/lib/rubygems/source/local.rb +7 -7
- data/lib/rubygems/source/lock.rb +4 -4
- data/lib/rubygems/source/specific_file.rb +5 -5
- data/lib/rubygems/source/vendor.rb +2 -3
- data/lib/rubygems/source.rb +16 -25
- data/lib/rubygems/source_list.rb +2 -2
- data/lib/rubygems/source_local.rb +0 -1
- data/lib/rubygems/spec_fetcher.rb +5 -6
- data/lib/rubygems/specification.rb +219 -558
- data/lib/rubygems/specification_policy.rb +407 -0
- data/lib/rubygems/stub_specification.rb +12 -17
- data/lib/rubygems/test_case.rb +161 -75
- data/lib/rubygems/test_utilities.rb +20 -35
- data/lib/rubygems/text.rb +6 -6
- data/lib/rubygems/uninstaller.rb +38 -27
- data/lib/rubygems/uri_formatter.rb +1 -2
- data/lib/rubygems/user_interaction.rb +37 -89
- data/lib/rubygems/util/licenses.rb +27 -1
- data/lib/rubygems/util/list.rb +1 -1
- data/lib/rubygems/util.rb +32 -14
- data/lib/rubygems/validator.rb +4 -5
- data/lib/rubygems/version.rb +15 -15
- data/lib/rubygems/version_option.rb +2 -3
- data/lib/rubygems.rb +71 -102
- data/rubygems-update.gemspec +43 -0
- data/setup.rb +2 -8
- data/test/rubygems/ca_cert.pem +74 -65
- data/test/rubygems/client.pem +103 -45
- data/test/rubygems/rubygems_plugin.rb +0 -1
- data/test/rubygems/simple_gem.rb +1 -1
- data/test/rubygems/ssl_cert.pem +78 -17
- data/test/rubygems/ssl_key.pem +25 -13
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_config.rb +7 -2
- data/test/rubygems/test_gem.rb +205 -132
- data/test/rubygems/test_gem_bundler_version_finder.rb +4 -0
- data/test/rubygems/test_gem_command.rb +0 -1
- data/test/rubygems/test_gem_command_manager.rb +18 -3
- data/test/rubygems/test_gem_commands_build_command.rb +220 -15
- data/test/rubygems/test_gem_commands_cert_command.rb +69 -8
- data/test/rubygems/test_gem_commands_check_command.rb +1 -1
- data/test/rubygems/test_gem_commands_cleanup_command.rb +27 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +1 -2
- data/test/rubygems/test_gem_commands_dependency_command.rb +33 -34
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -0
- data/test/rubygems/test_gem_commands_fetch_command.rb +0 -1
- data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -1
- data/test/rubygems/test_gem_commands_help_command.rb +7 -4
- data/test/rubygems/test_gem_commands_info_command.rb +44 -0
- data/test/rubygems/test_gem_commands_install_command.rb +79 -12
- data/test/rubygems/test_gem_commands_lock_command.rb +0 -1
- data/test/rubygems/test_gem_commands_open_command.rb +29 -0
- data/test/rubygems/test_gem_commands_outdated_command.rb +0 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +93 -57
- data/test/rubygems/test_gem_commands_pristine_command.rb +65 -30
- data/test/rubygems/test_gem_commands_push_command.rb +54 -0
- data/test/rubygems/test_gem_commands_query_command.rb +102 -100
- data/test/rubygems/test_gem_commands_search_command.rb +0 -1
- data/test/rubygems/test_gem_commands_server_command.rb +0 -1
- data/test/rubygems/test_gem_commands_setup_command.rb +50 -15
- data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
- data/test/rubygems/test_gem_commands_sources_command.rb +0 -1
- data/test/rubygems/test_gem_commands_specification_command.rb +2 -3
- data/test/rubygems/test_gem_commands_stale_command.rb +3 -2
- data/test/rubygems/test_gem_commands_uninstall_command.rb +161 -8
- data/test/rubygems/test_gem_commands_unpack_command.rb +17 -1
- data/test/rubygems/test_gem_commands_update_command.rb +19 -2
- data/test/rubygems/test_gem_commands_which_command.rb +0 -1
- data/test/rubygems/test_gem_commands_yank_command.rb +0 -1
- data/test/rubygems/test_gem_config_file.rb +4 -2
- data/test/rubygems/test_gem_dependency.rb +0 -1
- data/test/rubygems/test_gem_dependency_installer.rb +8 -5
- data/test/rubygems/test_gem_dependency_list.rb +6 -7
- data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -1
- data/test/rubygems/test_gem_doctor.rb +1 -2
- data/test/rubygems/test_gem_ext_builder.rb +10 -23
- data/test/rubygems/test_gem_ext_cmake_builder.rb +5 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +3 -3
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +8 -9
- data/test/rubygems/test_gem_ext_rake_builder.rb +20 -5
- data/test/rubygems/test_gem_gem_runner.rb +0 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +32 -6
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -1
- data/test/rubygems/test_gem_indexer.rb +16 -10
- data/test/rubygems/test_gem_install_update_options.rb +1 -20
- data/test/rubygems/test_gem_installer.rb +154 -119
- data/test/rubygems/test_gem_local_remote_options.rb +3 -3
- data/test/rubygems/test_gem_name_tuple.rb +0 -1
- data/test/rubygems/test_gem_package.rb +77 -31
- data/test/rubygems/test_gem_package_old.rb +0 -1
- data/test/rubygems/test_gem_package_tar_header.rb +42 -2
- data/test/rubygems/test_gem_package_tar_reader.rb +0 -1
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +11 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +43 -7
- data/test/rubygems/test_gem_package_task.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +28 -11
- data/test/rubygems/test_gem_platform.rb +4 -5
- data/test/rubygems/test_gem_rdoc.rb +1 -136
- data/test/rubygems/test_gem_remote_fetcher.rb +241 -141
- data/test/rubygems/test_gem_request.rb +9 -9
- data/test/rubygems/test_gem_request_connection_pools.rb +24 -3
- data/test/rubygems/test_gem_request_set.rb +5 -5
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +82 -64
- data/test/rubygems/test_gem_request_set_lockfile.rb +1 -2
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +4 -9
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
- data/test/rubygems/test_gem_requirement.rb +24 -4
- data/test/rubygems/test_gem_resolver.rb +13 -17
- data/test/rubygems/test_gem_resolver_activation_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_api_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_best_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_composed_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -1
- data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_index_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +2 -3
- data/test/rubygems/test_gem_resolver_local_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -2
- data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -1
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -1
- data/test/rubygems/test_gem_security.rb +1 -3
- data/test/rubygems/test_gem_security_policy.rb +5 -6
- data/test/rubygems/test_gem_security_signer.rb +4 -3
- data/test/rubygems/test_gem_security_trust_dir.rb +1 -2
- data/test/rubygems/test_gem_server.rb +4 -4
- data/test/rubygems/test_gem_source.rb +0 -13
- data/test/rubygems/test_gem_source_fetch_problem.rb +0 -1
- data/test/rubygems/test_gem_source_git.rb +0 -1
- data/test/rubygems/test_gem_source_installed.rb +0 -1
- data/test/rubygems/test_gem_source_lock.rb +0 -1
- data/test/rubygems/test_gem_source_vendor.rb +0 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +0 -1
- data/test/rubygems/test_gem_specification.rb +366 -198
- data/test/rubygems/test_gem_stream_ui.rb +15 -32
- data/test/rubygems/test_gem_stub_specification.rb +0 -2
- data/test/rubygems/test_gem_text.rb +4 -0
- data/test/rubygems/test_gem_uninstaller.rb +42 -3
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -1
- data/test/rubygems/test_gem_uri_formatter.rb +0 -1
- data/test/rubygems/test_gem_util.rb +31 -11
- data/test/rubygems/test_gem_validator.rb +0 -1
- data/test/rubygems/test_gem_version.rb +11 -11
- data/test/rubygems/test_gem_version_option.rb +0 -1
- data/test/rubygems/test_remote_fetch_error.rb +0 -1
- data/test/rubygems/test_require.rb +67 -52
- data/util/CL2notes +1 -2
- data/util/ci +20 -12
- data/util/cops/deprecations.rb +52 -0
- data/util/create_certs.rb +6 -7
- data/util/create_certs.sh +27 -0
- data/util/create_encrypted_key.rb +4 -5
- data/util/patch_with_prs.rb +1 -1
- data/util/rubocop +8 -0
- data/util/update_bundled_ca_certificates.rb +12 -13
- data/util/update_changelog.rb +1 -1
- metadata +61 -51
- data/.autotest +0 -71
- data/.document +0 -5
- data/CONTRIBUTING.rdoc +0 -130
- data/CVE-2013-4287.txt +0 -35
- data/CVE-2013-4363.txt +0 -45
- data/CVE-2015-3900.txt +0 -40
- data/POLICIES.rdoc +0 -74
- data/test/rubygems/fix_openssl_warnings.rb +0 -13
@@ -68,8 +68,8 @@ command to remove old versions.
|
|
68
68
|
"#{program_name} GEMNAME [GEMNAME ...]"
|
69
69
|
end
|
70
70
|
|
71
|
-
def check_latest_rubygems
|
72
|
-
if Gem.rubygems_version == version
|
71
|
+
def check_latest_rubygems(version) # :nodoc:
|
72
|
+
if Gem.rubygems_version == version
|
73
73
|
say "Latest version already installed. Done."
|
74
74
|
terminate_interaction
|
75
75
|
end
|
@@ -78,31 +78,40 @@ command to remove old versions.
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def check_update_arguments # :nodoc:
|
81
|
-
unless options[:args].empty?
|
81
|
+
unless options[:args].empty?
|
82
82
|
alert_error "Gem names are not allowed with the --system option"
|
83
83
|
terminate_interaction 1
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
87
|
def execute
|
88
|
-
|
89
|
-
if options[:system] then
|
88
|
+
if options[:system]
|
90
89
|
update_rubygems
|
91
90
|
return
|
92
91
|
end
|
93
92
|
|
94
|
-
say "Updating installed gems"
|
95
|
-
|
96
93
|
hig = highest_installed_gems
|
97
94
|
|
98
95
|
gems_to_update = which_to_update hig, options[:args].uniq
|
99
96
|
|
97
|
+
if options[:explain]
|
98
|
+
say "Gems to update:"
|
99
|
+
|
100
|
+
gems_to_update.each do |(name, version)|
|
101
|
+
say " #{name}-#{version}"
|
102
|
+
end
|
103
|
+
|
104
|
+
return
|
105
|
+
end
|
106
|
+
|
107
|
+
say "Updating installed gems"
|
108
|
+
|
100
109
|
updated = update_gems gems_to_update
|
101
110
|
|
102
111
|
updated_names = updated.map { |spec| spec.name }
|
103
112
|
not_updated_names = options[:args].uniq - updated_names
|
104
113
|
|
105
|
-
if updated.empty?
|
114
|
+
if updated.empty?
|
106
115
|
say "Nothing to update"
|
107
116
|
else
|
108
117
|
say "Gems updated: #{updated_names.join(' ')}"
|
@@ -110,7 +119,7 @@ command to remove old versions.
|
|
110
119
|
end
|
111
120
|
end
|
112
121
|
|
113
|
-
def fetch_remote_gems
|
122
|
+
def fetch_remote_gems(spec) # :nodoc:
|
114
123
|
dependency = Gem::Dependency.new spec.name, "> #{spec.version}"
|
115
124
|
dependency.prerelease = options[:prerelease]
|
116
125
|
|
@@ -129,7 +138,7 @@ command to remove old versions.
|
|
129
138
|
hig = {} # highest installed gems
|
130
139
|
|
131
140
|
Gem::Specification.each do |spec|
|
132
|
-
if hig[spec.name].nil? or hig[spec.name].version < spec.version
|
141
|
+
if hig[spec.name].nil? or hig[spec.name].version < spec.version
|
133
142
|
hig[spec.name] = spec
|
134
143
|
end
|
135
144
|
end
|
@@ -137,7 +146,7 @@ command to remove old versions.
|
|
137
146
|
hig
|
138
147
|
end
|
139
148
|
|
140
|
-
def highest_remote_version
|
149
|
+
def highest_remote_version(spec) # :nodoc:
|
141
150
|
spec_tuples = fetch_remote_gems spec
|
142
151
|
|
143
152
|
matching_gems = spec_tuples.select do |g,_|
|
@@ -151,7 +160,7 @@ command to remove old versions.
|
|
151
160
|
highest_remote_gem.first.version
|
152
161
|
end
|
153
162
|
|
154
|
-
def install_rubygems
|
163
|
+
def install_rubygems(version) # :nodoc:
|
155
164
|
args = update_rubygems_arguments
|
156
165
|
|
157
166
|
update_dir = File.join Gem.dir, 'gems', "rubygems-update-#{version}"
|
@@ -159,12 +168,8 @@ command to remove old versions.
|
|
159
168
|
Dir.chdir update_dir do
|
160
169
|
say "Installing RubyGems #{version}"
|
161
170
|
|
162
|
-
|
163
|
-
old = ENV["RUBYOPT"]
|
164
|
-
ENV.delete("RUBYOPT") if old
|
165
|
-
installed = system Gem.ruby, 'setup.rb', *args
|
171
|
+
installed = system Gem.ruby, '--disable-gems', 'setup.rb', *args
|
166
172
|
say "RubyGems system software updated" if installed
|
167
|
-
ENV["RUBYOPT"] = old if old
|
168
173
|
end
|
169
174
|
end
|
170
175
|
|
@@ -172,7 +177,7 @@ command to remove old versions.
|
|
172
177
|
version = options[:system]
|
173
178
|
update_latest = version == true
|
174
179
|
|
175
|
-
if update_latest
|
180
|
+
if update_latest
|
176
181
|
version = Gem::Version.new Gem::VERSION
|
177
182
|
requirement = Gem::Requirement.new ">= #{Gem::VERSION}"
|
178
183
|
else
|
@@ -191,7 +196,7 @@ command to remove old versions.
|
|
191
196
|
gems_to_update = which_to_update hig, options[:args], :system
|
192
197
|
_, up_ver = gems_to_update.first
|
193
198
|
|
194
|
-
target = if update_latest
|
199
|
+
target = if update_latest
|
195
200
|
up_ver
|
196
201
|
else
|
197
202
|
version
|
@@ -200,7 +205,7 @@ command to remove old versions.
|
|
200
205
|
return target, requirement
|
201
206
|
end
|
202
207
|
|
203
|
-
def update_gem
|
208
|
+
def update_gem(name, version = Gem::Requirement.default)
|
204
209
|
return if @updated.any? { |spec| spec.name == name }
|
205
210
|
|
206
211
|
update_options = options.dup
|
@@ -220,7 +225,7 @@ command to remove old versions.
|
|
220
225
|
end
|
221
226
|
end
|
222
227
|
|
223
|
-
def update_gems
|
228
|
+
def update_gems(gems_to_update)
|
224
229
|
gems_to_update.uniq.sort.each do |(name, version)|
|
225
230
|
update_gem name, version
|
226
231
|
end
|
@@ -259,7 +264,7 @@ command to remove old versions.
|
|
259
264
|
args
|
260
265
|
end
|
261
266
|
|
262
|
-
def which_to_update
|
267
|
+
def which_to_update(highest_installed_gems, gem_names, system = false)
|
263
268
|
result = []
|
264
269
|
|
265
270
|
highest_installed_gems.each do |l_name, l_spec|
|
@@ -268,7 +273,7 @@ command to remove old versions.
|
|
268
273
|
|
269
274
|
highest_remote_ver = highest_remote_version l_spec
|
270
275
|
|
271
|
-
if system or (l_spec.version < highest_remote_ver)
|
276
|
+
if system or (l_spec.version < highest_remote_ver)
|
272
277
|
result << [l_spec.name, [l_spec.version, highest_remote_ver].max]
|
273
278
|
end
|
274
279
|
end
|
@@ -44,21 +44,19 @@ requiring to see why it does not behave as you expect.
|
|
44
44
|
|
45
45
|
spec = Gem::Specification.find_by_path arg
|
46
46
|
|
47
|
-
if spec
|
48
|
-
if options[:search_gems_first]
|
47
|
+
if spec
|
48
|
+
if options[:search_gems_first]
|
49
49
|
dirs = spec.full_require_paths + $LOAD_PATH
|
50
50
|
else
|
51
51
|
dirs = $LOAD_PATH + spec.full_require_paths
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
# TODO: this is totally redundant and stupid
|
56
55
|
paths = find_paths arg, dirs
|
57
56
|
|
58
|
-
if paths.empty?
|
57
|
+
if paths.empty?
|
59
58
|
alert_error "Can't find Ruby library file or shared library #{arg}"
|
60
|
-
|
61
|
-
found &&= false
|
59
|
+
found = false
|
62
60
|
else
|
63
61
|
say paths
|
64
62
|
end
|
@@ -73,7 +71,7 @@ requiring to see why it does not behave as you expect.
|
|
73
71
|
dirs.each do |dir|
|
74
72
|
Gem.suffixes.each do |ext|
|
75
73
|
full_path = File.join dir, "#{package_name}#{ext}"
|
76
|
-
if File.exist? full_path and not File.directory? full_path
|
74
|
+
if File.exist? full_path and not File.directory? full_path
|
77
75
|
result << full_path
|
78
76
|
return result unless options[:show_all]
|
79
77
|
end
|
@@ -88,4 +86,3 @@ requiring to see why it does not behave as you expect.
|
|
88
86
|
end
|
89
87
|
|
90
88
|
end
|
91
|
-
|
@@ -51,7 +51,7 @@ data you will need to change them immediately and yank your gem.
|
|
51
51
|
version = get_version_from_requirements(options[:version])
|
52
52
|
platform = get_platform_from_requirements(options)
|
53
53
|
|
54
|
-
if version
|
54
|
+
if version
|
55
55
|
yank_gem(version, platform)
|
56
56
|
else
|
57
57
|
say "A version argument is required: #{usage}"
|
@@ -93,4 +93,3 @@ data you will need to change them immediately and yank your gem.
|
|
93
93
|
end
|
94
94
|
|
95
95
|
end
|
96
|
-
|
@@ -9,26 +9,6 @@
|
|
9
9
|
# Ruby 1.9.x has introduced some things that are awkward, and we need to
|
10
10
|
# support them, so we define some constants to use later.
|
11
11
|
#++
|
12
|
-
module Gem
|
13
|
-
# Only MRI 1.9.2 has the custom prelude.
|
14
|
-
GEM_PRELUDE_SUCKAGE = RUBY_VERSION =~ /^1\.9\.2/ and RUBY_ENGINE == "ruby"
|
15
|
-
end
|
16
|
-
|
17
|
-
# Gem::QuickLoader exists in the gem prelude code in ruby 1.9.2 itself.
|
18
|
-
# We gotta get rid of it if it's there, before we do anything else.
|
19
|
-
if Gem::GEM_PRELUDE_SUCKAGE and defined?(Gem::QuickLoader) then
|
20
|
-
Gem::QuickLoader.remove
|
21
|
-
|
22
|
-
$LOADED_FEATURES.delete Gem::QuickLoader.path_to_full_rubygems_library
|
23
|
-
|
24
|
-
if path = $LOADED_FEATURES.find {|n| n.end_with? '/rubygems.rb'} then
|
25
|
-
raise LoadError, "another rubygems is already loaded from #{path}"
|
26
|
-
end
|
27
|
-
|
28
|
-
class << Gem
|
29
|
-
remove_method :try_activate if Gem.respond_to?(:try_activate, true)
|
30
|
-
end
|
31
|
-
end
|
32
12
|
|
33
13
|
module Gem
|
34
14
|
RubyGemsVersion = VERSION
|
@@ -42,7 +22,7 @@ module Gem
|
|
42
22
|
EXEEXT RUBY_SO_NAME arch bindir datadir libdir ruby_install_name
|
43
23
|
ruby_version rubylibprefix sitedir sitelibdir vendordir vendorlibdir
|
44
24
|
rubylibdir
|
45
|
-
]
|
25
|
+
].freeze
|
46
26
|
|
47
27
|
unless defined?(ConfigMap)
|
48
28
|
##
|
data/lib/rubygems/config_file.rb
CHANGED
@@ -27,6 +27,7 @@ require 'rbconfig'
|
|
27
27
|
# +:backtrace+:: See #backtrace
|
28
28
|
# +:sources+:: Sets Gem::sources
|
29
29
|
# +:verbose+:: See #verbose
|
30
|
+
# +:concurrent_downloads+:: See #concurrent_downloads
|
30
31
|
#
|
31
32
|
# gemrc files may exist in various locations and are read and merged in
|
32
33
|
# the following order:
|
@@ -43,12 +44,14 @@ class Gem::ConfigFile
|
|
43
44
|
DEFAULT_BULK_THRESHOLD = 1000
|
44
45
|
DEFAULT_VERBOSITY = true
|
45
46
|
DEFAULT_UPDATE_SOURCES = true
|
47
|
+
DEFAULT_CONCURRENT_DOWNLOADS = 8
|
48
|
+
DEFAULT_CERT_EXPIRATION_LENGTH_DAYS = 365
|
46
49
|
|
47
50
|
##
|
48
51
|
# For Ruby packagers to set configuration defaults. Set in
|
49
52
|
# rubygems/defaults/operating_system.rb
|
50
53
|
|
51
|
-
OPERATING_SYSTEM_DEFAULTS =
|
54
|
+
OPERATING_SYSTEM_DEFAULTS = Gem.operating_system_defaults
|
52
55
|
|
53
56
|
##
|
54
57
|
# For Ruby implementers to set configuration defaults. Set in
|
@@ -63,26 +66,7 @@ class Gem::ConfigFile
|
|
63
66
|
require "etc"
|
64
67
|
Etc.sysconfdir
|
65
68
|
rescue LoadError, NoMethodError
|
66
|
-
|
67
|
-
# TODO: remove after we drop 1.8.7 and 1.9.1
|
68
|
-
require 'Win32API'
|
69
|
-
|
70
|
-
CSIDL_COMMON_APPDATA = 0x0023
|
71
|
-
path = 0.chr * 260
|
72
|
-
if RUBY_VERSION > '1.9' then
|
73
|
-
SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'PLPLP',
|
74
|
-
'L', :stdcall
|
75
|
-
SHGetFolderPath.call nil, CSIDL_COMMON_APPDATA, nil, 1, path
|
76
|
-
else
|
77
|
-
SHGetFolderPath = Win32API.new 'shell32', 'SHGetFolderPath', 'LLLLP',
|
78
|
-
'L'
|
79
|
-
SHGetFolderPath.call 0, CSIDL_COMMON_APPDATA, 0, 1, path
|
80
|
-
end
|
81
|
-
|
82
|
-
path.strip
|
83
|
-
rescue LoadError
|
84
|
-
RbConfig::CONFIG["sysconfdir"] || "/etc"
|
85
|
-
end
|
69
|
+
RbConfig::CONFIG["sysconfdir"] || "/etc"
|
86
70
|
end
|
87
71
|
|
88
72
|
# :startdoc:
|
@@ -123,6 +107,11 @@ class Gem::ConfigFile
|
|
123
107
|
|
124
108
|
attr_accessor :verbose
|
125
109
|
|
110
|
+
##
|
111
|
+
# Number of gem downloads that should be performed concurrently.
|
112
|
+
|
113
|
+
attr_accessor :concurrent_downloads
|
114
|
+
|
126
115
|
##
|
127
116
|
# True if we want to update the SourceInfoCache every time, false otherwise
|
128
117
|
|
@@ -147,6 +136,11 @@ class Gem::ConfigFile
|
|
147
136
|
# sources to look for gems
|
148
137
|
attr_accessor :sources
|
149
138
|
|
139
|
+
##
|
140
|
+
# Expiration length to sign a certificate
|
141
|
+
|
142
|
+
attr_accessor :cert_expiration_length_days
|
143
|
+
|
150
144
|
##
|
151
145
|
# Path name of directory or file of openssl client certificate, used for remote https connection with client authentication
|
152
146
|
|
@@ -180,12 +174,12 @@ class Gem::ConfigFile
|
|
180
174
|
arg_list = []
|
181
175
|
|
182
176
|
args.each do |arg|
|
183
|
-
if need_config_file_name
|
177
|
+
if need_config_file_name
|
184
178
|
@config_file_name = arg
|
185
179
|
need_config_file_name = false
|
186
|
-
elsif arg =~ /^--config-file=(.*)/
|
180
|
+
elsif arg =~ /^--config-file=(.*)/
|
187
181
|
@config_file_name = $1
|
188
|
-
elsif arg =~ /^--config-file$/
|
182
|
+
elsif arg =~ /^--config-file$/
|
189
183
|
need_config_file_name = true
|
190
184
|
else
|
191
185
|
arg_list << arg
|
@@ -196,6 +190,8 @@ class Gem::ConfigFile
|
|
196
190
|
@bulk_threshold = DEFAULT_BULK_THRESHOLD
|
197
191
|
@verbose = DEFAULT_VERBOSITY
|
198
192
|
@update_sources = DEFAULT_UPDATE_SOURCES
|
193
|
+
@concurrent_downloads = DEFAULT_CONCURRENT_DOWNLOADS
|
194
|
+
@cert_expiration_length_days = DEFAULT_CERT_EXPIRATION_LENGTH_DAYS
|
199
195
|
|
200
196
|
operating_system_config = Marshal.load Marshal.dump(OPERATING_SYSTEM_DEFAULTS)
|
201
197
|
platform_config = Marshal.load Marshal.dump(PLATFORM_DEFAULTS)
|
@@ -213,14 +209,15 @@ class Gem::ConfigFile
|
|
213
209
|
end
|
214
210
|
|
215
211
|
# HACK these override command-line args, which is bad
|
216
|
-
@backtrace
|
217
|
-
@bulk_threshold
|
218
|
-
@home
|
219
|
-
@path
|
220
|
-
@update_sources
|
221
|
-
@verbose
|
222
|
-
@disable_default_gem_server
|
223
|
-
@sources
|
212
|
+
@backtrace = @hash[:backtrace] if @hash.key? :backtrace
|
213
|
+
@bulk_threshold = @hash[:bulk_threshold] if @hash.key? :bulk_threshold
|
214
|
+
@home = @hash[:gemhome] if @hash.key? :gemhome
|
215
|
+
@path = @hash[:gempath] if @hash.key? :gempath
|
216
|
+
@update_sources = @hash[:update_sources] if @hash.key? :update_sources
|
217
|
+
@verbose = @hash[:verbose] if @hash.key? :verbose
|
218
|
+
@disable_default_gem_server = @hash[:disable_default_gem_server] if @hash.key? :disable_default_gem_server
|
219
|
+
@sources = @hash[:sources] if @hash.key? :sources
|
220
|
+
@cert_expiration_length_days = @hash[:cert_expiration_length_days] if @hash.key? :cert_expiration_length_days
|
224
221
|
|
225
222
|
@ssl_verify_mode = @hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
|
226
223
|
@ssl_ca_cert = @hash[:ssl_ca_cert] if @hash.key? :ssl_ca_cert
|
@@ -284,13 +281,13 @@ if you believe they were disclosed to a third party.
|
|
284
281
|
def load_api_keys
|
285
282
|
check_credentials_permissions
|
286
283
|
|
287
|
-
@api_keys = if File.exist? credentials_path
|
284
|
+
@api_keys = if File.exist? credentials_path
|
288
285
|
load_file(credentials_path)
|
289
286
|
else
|
290
287
|
@hash
|
291
288
|
end
|
292
289
|
|
293
|
-
if @api_keys.key? :rubygems_api_key
|
290
|
+
if @api_keys.key? :rubygems_api_key
|
294
291
|
@rubygems_api_key = @api_keys[:rubygems_api_key]
|
295
292
|
@api_keys[:rubygems] = @api_keys.delete :rubygems_api_key unless
|
296
293
|
@api_keys.key? :rubygems
|
@@ -309,7 +306,7 @@ if you believe they were disclosed to a third party.
|
|
309
306
|
##
|
310
307
|
# Sets the RubyGems.org API key to +api_key+
|
311
308
|
|
312
|
-
def rubygems_api_key=
|
309
|
+
def rubygems_api_key=(api_key)
|
313
310
|
set_api_key :rubygems_api_key, api_key
|
314
311
|
|
315
312
|
@rubygems_api_key = api_key
|
@@ -318,7 +315,7 @@ if you believe they were disclosed to a third party.
|
|
318
315
|
##
|
319
316
|
# Set a specific host's API key to +api_key+
|
320
317
|
|
321
|
-
def set_api_key
|
318
|
+
def set_api_key(host, api_key)
|
322
319
|
check_credentials_permissions
|
323
320
|
|
324
321
|
config = load_file(credentials_path).merge(host => api_key)
|
@@ -434,6 +431,9 @@ if you believe they were disclosed to a third party.
|
|
434
431
|
yaml_hash[:update_sources] = @hash.fetch(:update_sources, DEFAULT_UPDATE_SOURCES)
|
435
432
|
yaml_hash[:verbose] = @hash.fetch(:verbose, DEFAULT_VERBOSITY)
|
436
433
|
|
434
|
+
yaml_hash[:concurrent_downloads] =
|
435
|
+
@hash.fetch(:concurrent_downloads, DEFAULT_CONCURRENT_DOWNLOADS)
|
436
|
+
|
437
437
|
yaml_hash[:ssl_verify_mode] =
|
438
438
|
@hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
|
439
439
|
|
@@ -31,7 +31,7 @@ module Kernel
|
|
31
31
|
# The normal <tt>require</tt> functionality of returning false if
|
32
32
|
# that file has already been loaded is preserved.
|
33
33
|
|
34
|
-
def require
|
34
|
+
def require(path)
|
35
35
|
RUBYGEMS_ACTIVATION_MONITOR.enter
|
36
36
|
|
37
37
|
path = path.to_path if path.respond_to? :to_path
|
@@ -49,7 +49,7 @@ module Kernel
|
|
49
49
|
# If there are no unresolved deps, then we can use just try
|
50
50
|
# normal require handle loading a gem from the rescue below.
|
51
51
|
|
52
|
-
if Gem::Specification.unresolved_deps.empty?
|
52
|
+
if Gem::Specification.unresolved_deps.empty?
|
53
53
|
RUBYGEMS_ACTIVATION_MONITOR.exit
|
54
54
|
return gem_original_require(path)
|
55
55
|
end
|
@@ -79,7 +79,7 @@ module Kernel
|
|
79
79
|
# requested, then find_in_unresolved_tree will find d.rb in d because
|
80
80
|
# it's a dependency of c.
|
81
81
|
#
|
82
|
-
if found_specs.empty?
|
82
|
+
if found_specs.empty?
|
83
83
|
found_specs = Gem::Specification.find_in_unresolved_tree path
|
84
84
|
|
85
85
|
found_specs.each do |found_spec|
|
@@ -94,7 +94,7 @@ module Kernel
|
|
94
94
|
# versions of the same gem
|
95
95
|
names = found_specs.map(&:name).uniq
|
96
96
|
|
97
|
-
if names.size > 1
|
97
|
+
if names.size > 1
|
98
98
|
RUBYGEMS_ACTIVATION_MONITOR.exit
|
99
99
|
raise Gem::LoadError, "#{path} found in multiple gems: #{names.join ', '}"
|
100
100
|
end
|
@@ -103,7 +103,7 @@ module Kernel
|
|
103
103
|
# at the highest version.
|
104
104
|
valid = found_specs.find { |s| !s.has_conflicts? }
|
105
105
|
|
106
|
-
unless valid
|
106
|
+
unless valid
|
107
107
|
le = Gem::LoadError.new "unable to find a version of '#{names.first}' to activate"
|
108
108
|
le.name = names.first
|
109
109
|
RUBYGEMS_ACTIVATION_MONITOR.exit
|
@@ -120,7 +120,7 @@ module Kernel
|
|
120
120
|
|
121
121
|
begin
|
122
122
|
if load_error.message.start_with?("Could not find") or
|
123
|
-
(load_error.message.end_with?(path) and Gem.try_activate(path))
|
123
|
+
(load_error.message.end_with?(path) and Gem.try_activate(path))
|
124
124
|
require_again = true
|
125
125
|
end
|
126
126
|
ensure
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# `uplevel` keyword argument of Kernel#warn is available since ruby 2.5.
|
4
|
+
if RUBY_VERSION >= "2.5"
|
5
|
+
|
6
|
+
module Kernel
|
7
|
+
path = "#{__dir__}/" # Frames to be skipped start with this path.
|
8
|
+
|
9
|
+
# Suppress "method redefined" warning
|
10
|
+
original_warn = instance_method(:warn)
|
11
|
+
Module.new {define_method(:warn, original_warn)}
|
12
|
+
|
13
|
+
original_warn = method(:warn)
|
14
|
+
|
15
|
+
module_function define_method(:warn) {|*messages, uplevel: nil|
|
16
|
+
unless uplevel
|
17
|
+
return original_warn.call(*messages)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Ensure `uplevel` fits a `long`
|
21
|
+
uplevel, = [uplevel].pack("l!").unpack("l!")
|
22
|
+
|
23
|
+
if uplevel >= 0
|
24
|
+
start = 0
|
25
|
+
while uplevel >= 0
|
26
|
+
loc, = caller_locations(start, 1)
|
27
|
+
unless loc
|
28
|
+
# No more backtrace
|
29
|
+
start += uplevel
|
30
|
+
break
|
31
|
+
end
|
32
|
+
|
33
|
+
start += 1
|
34
|
+
|
35
|
+
unless loc.path.start_with?(path)
|
36
|
+
# Non-rubygems frames
|
37
|
+
uplevel -= 1
|
38
|
+
end
|
39
|
+
end
|
40
|
+
uplevel = start
|
41
|
+
end
|
42
|
+
original_warn.call(*messages, uplevel: uplevel)
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
data/lib/rubygems/defaults.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Gem
|
3
|
-
DEFAULT_HOST = "https://rubygems.org"
|
3
|
+
DEFAULT_HOST = "https://rubygems.org".freeze
|
4
4
|
|
5
5
|
@post_install_hooks ||= []
|
6
6
|
@done_installing_hooks ||= []
|
@@ -28,17 +28,17 @@ module Gem
|
|
28
28
|
# specified in the environment
|
29
29
|
|
30
30
|
def self.default_dir
|
31
|
-
path = if defined? RUBY_FRAMEWORK_VERSION
|
31
|
+
path = if defined? RUBY_FRAMEWORK_VERSION
|
32
32
|
[
|
33
33
|
File.dirname(RbConfig::CONFIG['sitedir']),
|
34
34
|
'Gems',
|
35
35
|
RbConfig::CONFIG['ruby_version']
|
36
36
|
]
|
37
|
-
elsif RbConfig::CONFIG['rubylibprefix']
|
37
|
+
elsif RbConfig::CONFIG['rubylibprefix']
|
38
38
|
[
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
RbConfig::CONFIG['rubylibprefix'],
|
40
|
+
'gems',
|
41
|
+
RbConfig::CONFIG['ruby_version']
|
42
42
|
]
|
43
43
|
else
|
44
44
|
[
|
@@ -59,7 +59,7 @@ module Gem
|
|
59
59
|
# By default, the binary extensions are located side by side with their
|
60
60
|
# Ruby counterparts, therefore nil is returned
|
61
61
|
|
62
|
-
def self.default_ext_dir_for
|
62
|
+
def self.default_ext_dir_for(base_dir)
|
63
63
|
nil
|
64
64
|
end
|
65
65
|
|
@@ -103,7 +103,7 @@ module Gem
|
|
103
103
|
def self.default_exec_format
|
104
104
|
exec_format = RbConfig::CONFIG['ruby_install_name'].sub('ruby', '%s') rescue '%s'
|
105
105
|
|
106
|
-
unless exec_format =~ /%s/
|
106
|
+
unless exec_format =~ /%s/
|
107
107
|
raise Gem::Exception,
|
108
108
|
"[BUG] invalid exec_format #{exec_format.inspect}, no %s"
|
109
109
|
end
|
@@ -115,22 +115,15 @@ module Gem
|
|
115
115
|
# The default directory for binaries
|
116
116
|
|
117
117
|
def self.default_bindir
|
118
|
-
if defined? RUBY_FRAMEWORK_VERSION
|
118
|
+
if defined? RUBY_FRAMEWORK_VERSION # mac framework support
|
119
119
|
'/usr/bin'
|
120
120
|
else # generic install
|
121
121
|
RbConfig::CONFIG['bindir']
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
-
##
|
126
|
-
# A wrapper around RUBY_ENGINE const that may not be defined
|
127
|
-
|
128
125
|
def self.ruby_engine
|
129
|
-
|
130
|
-
RUBY_ENGINE
|
131
|
-
else
|
132
|
-
'ruby'
|
133
|
-
end
|
126
|
+
RUBY_ENGINE
|
134
127
|
end
|
135
128
|
|
136
129
|
##
|
@@ -165,7 +158,7 @@ module Gem
|
|
165
158
|
# Directory where vendor gems are installed.
|
166
159
|
|
167
160
|
def self.vendor_dir # :nodoc:
|
168
|
-
if vendor_dir = ENV['GEM_VENDOR']
|
161
|
+
if vendor_dir = ENV['GEM_VENDOR']
|
169
162
|
return vendor_dir.dup
|
170
163
|
end
|
171
164
|
|
@@ -176,7 +169,26 @@ module Gem
|
|
176
169
|
end
|
177
170
|
|
178
171
|
##
|
179
|
-
# Default options for gem commands.
|
172
|
+
# Default options for gem commands for Ruby packagers.
|
173
|
+
#
|
174
|
+
# The options here should be structured as an array of string "gem"
|
175
|
+
# command names as keys and a string of the default options as values.
|
176
|
+
#
|
177
|
+
# Example:
|
178
|
+
#
|
179
|
+
# def self.operating_system_defaults
|
180
|
+
# {
|
181
|
+
# 'install' => '--no-rdoc --no-ri --env-shebang',
|
182
|
+
# 'update' => '--no-rdoc --no-ri --env-shebang'
|
183
|
+
# }
|
184
|
+
# end
|
185
|
+
|
186
|
+
def self.operating_system_defaults
|
187
|
+
{}
|
188
|
+
end
|
189
|
+
|
190
|
+
##
|
191
|
+
# Default options for gem commands for Ruby implementers.
|
180
192
|
#
|
181
193
|
# The options here should be structured as an array of string "gem"
|
182
194
|
# command names as keys and a string of the default options as values.
|