rubygems-update 2.5.1 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +46 -0
- data/CONTRIBUTING.rdoc +98 -27
- data/History.txt +44 -1
- data/MAINTAINERS.md +4 -0
- data/Manifest.txt +4 -0
- data/POLICIES.rdoc +61 -0
- data/appveyor.yml +6 -1
- data/lib/gauntlet_rubygems.rb +1 -0
- data/lib/rubygems.rb +3 -2
- data/lib/rubygems/available_set.rb +1 -0
- data/lib/rubygems/basic_specification.rb +4 -4
- data/lib/rubygems/command.rb +7 -2
- data/lib/rubygems/command_manager.rb +1 -0
- data/lib/rubygems/commands/build_command.rb +5 -0
- data/lib/rubygems/commands/cert_command.rb +1 -0
- data/lib/rubygems/commands/check_command.rb +1 -0
- data/lib/rubygems/commands/cleanup_command.rb +1 -0
- data/lib/rubygems/commands/contents_command.rb +1 -0
- data/lib/rubygems/commands/dependency_command.rb +3 -2
- data/lib/rubygems/commands/environment_command.rb +3 -3
- data/lib/rubygems/commands/fetch_command.rb +1 -0
- data/lib/rubygems/commands/generate_index_command.rb +1 -0
- data/lib/rubygems/commands/help_command.rb +1 -0
- data/lib/rubygems/commands/install_command.rb +1 -0
- data/lib/rubygems/commands/list_command.rb +1 -0
- data/lib/rubygems/commands/lock_command.rb +1 -0
- data/lib/rubygems/commands/mirror_command.rb +1 -0
- data/lib/rubygems/commands/open_command.rb +1 -0
- data/lib/rubygems/commands/outdated_command.rb +1 -0
- data/lib/rubygems/commands/owner_command.rb +1 -0
- data/lib/rubygems/commands/pristine_command.rb +1 -0
- data/lib/rubygems/commands/push_command.rb +1 -0
- data/lib/rubygems/commands/query_command.rb +12 -5
- data/lib/rubygems/commands/rdoc_command.rb +1 -0
- data/lib/rubygems/commands/search_command.rb +1 -0
- data/lib/rubygems/commands/server_command.rb +1 -0
- data/lib/rubygems/commands/setup_command.rb +1 -0
- data/lib/rubygems/commands/sources_command.rb +1 -0
- data/lib/rubygems/commands/specification_command.rb +1 -0
- data/lib/rubygems/commands/stale_command.rb +1 -0
- data/lib/rubygems/commands/uninstall_command.rb +1 -0
- data/lib/rubygems/commands/unpack_command.rb +1 -0
- data/lib/rubygems/commands/update_command.rb +1 -0
- data/lib/rubygems/commands/which_command.rb +1 -0
- data/lib/rubygems/commands/yank_command.rb +11 -15
- data/lib/rubygems/compatibility.rb +1 -0
- data/lib/rubygems/config_file.rb +6 -4
- data/lib/rubygems/core_ext/kernel_gem.rb +1 -0
- data/lib/rubygems/core_ext/kernel_require.rb +1 -0
- data/lib/rubygems/defaults.rb +1 -0
- data/lib/rubygems/dependency.rb +3 -2
- data/lib/rubygems/dependency_installer.rb +1 -0
- data/lib/rubygems/dependency_list.rb +1 -0
- data/lib/rubygems/deprecate.rb +1 -0
- data/lib/rubygems/doctor.rb +1 -0
- data/lib/rubygems/errors.rb +1 -0
- data/lib/rubygems/exceptions.rb +2 -2
- data/lib/rubygems/ext.rb +1 -0
- data/lib/rubygems/ext/build_error.rb +1 -0
- data/lib/rubygems/ext/builder.rb +1 -0
- data/lib/rubygems/ext/cmake_builder.rb +1 -0
- data/lib/rubygems/ext/configure_builder.rb +1 -0
- data/lib/rubygems/ext/ext_conf_builder.rb +15 -4
- data/lib/rubygems/ext/rake_builder.rb +1 -0
- data/lib/rubygems/gem_runner.rb +1 -0
- data/lib/rubygems/gemcutter_utilities.rb +9 -3
- data/lib/rubygems/indexer.rb +1 -0
- data/lib/rubygems/install_default_message.rb +1 -0
- data/lib/rubygems/install_message.rb +1 -0
- data/lib/rubygems/install_update_options.rb +6 -0
- data/lib/rubygems/installer.rb +12 -5
- data/lib/rubygems/installer_test_case.rb +1 -0
- data/lib/rubygems/local_remote_options.rb +2 -1
- data/lib/rubygems/mock_gem_ui.rb +1 -0
- data/lib/rubygems/name_tuple.rb +2 -1
- data/lib/rubygems/package.rb +3 -2
- data/lib/rubygems/package/digest_io.rb +1 -0
- data/lib/rubygems/package/file_source.rb +1 -0
- data/lib/rubygems/package/io_source.rb +1 -0
- data/lib/rubygems/package/old.rb +4 -4
- data/lib/rubygems/package/source.rb +1 -0
- data/lib/rubygems/package/tar_header.rb +1 -0
- data/lib/rubygems/package/tar_reader.rb +1 -0
- data/lib/rubygems/package/tar_reader/entry.rb +1 -0
- data/lib/rubygems/package/tar_test_case.rb +1 -0
- data/lib/rubygems/package/tar_writer.rb +1 -0
- data/lib/rubygems/package_task.rb +1 -0
- data/lib/rubygems/path_support.rb +15 -5
- data/lib/rubygems/platform.rb +1 -0
- data/lib/rubygems/psych_additions.rb +1 -0
- data/lib/rubygems/psych_tree.rb +1 -0
- data/lib/rubygems/rdoc.rb +1 -0
- data/lib/rubygems/remote_fetcher.rb +1 -0
- data/lib/rubygems/request.rb +3 -2
- data/lib/rubygems/request/connection_pools.rb +1 -0
- data/lib/rubygems/request/http_pool.rb +1 -0
- data/lib/rubygems/request/https_pool.rb +1 -0
- data/lib/rubygems/request_set.rb +14 -8
- data/lib/rubygems/request_set/gem_dependency_api.rb +54 -6
- data/lib/rubygems/request_set/lockfile.rb +3 -3
- data/lib/rubygems/request_set/lockfile/parser.rb +18 -9
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -0
- data/lib/rubygems/requirement.rb +1 -0
- data/lib/rubygems/resolver.rb +2 -0
- data/lib/rubygems/resolver/activation_request.rb +18 -5
- data/lib/rubygems/resolver/api_set.rb +1 -0
- data/lib/rubygems/resolver/api_specification.rb +1 -0
- data/lib/rubygems/resolver/best_set.rb +1 -0
- data/lib/rubygems/resolver/composed_set.rb +1 -0
- data/lib/rubygems/resolver/conflict.rb +1 -0
- data/lib/rubygems/resolver/current_set.rb +1 -0
- data/lib/rubygems/resolver/dependency_request.rb +1 -0
- data/lib/rubygems/resolver/git_set.rb +1 -0
- data/lib/rubygems/resolver/git_specification.rb +1 -0
- data/lib/rubygems/resolver/index_set.rb +1 -0
- data/lib/rubygems/resolver/index_specification.rb +1 -0
- data/lib/rubygems/resolver/installed_specification.rb +1 -0
- data/lib/rubygems/resolver/installer_set.rb +1 -0
- data/lib/rubygems/resolver/local_specification.rb +1 -0
- data/lib/rubygems/resolver/lock_set.rb +4 -5
- data/lib/rubygems/resolver/lock_specification.rb +6 -2
- data/lib/rubygems/resolver/molinillo.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +5 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +10 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +6 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +3 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +2 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +8 -7
- data/lib/rubygems/resolver/requirement_list.rb +1 -0
- data/lib/rubygems/resolver/set.rb +1 -0
- data/lib/rubygems/resolver/source_set.rb +48 -0
- data/lib/rubygems/resolver/spec_specification.rb +1 -0
- data/lib/rubygems/resolver/specification.rb +1 -0
- data/lib/rubygems/resolver/stats.rb +1 -0
- data/lib/rubygems/resolver/vendor_set.rb +1 -0
- data/lib/rubygems/resolver/vendor_specification.rb +1 -0
- data/lib/rubygems/security.rb +3 -2
- data/lib/rubygems/security/policies.rb +1 -0
- data/lib/rubygems/security/policy.rb +2 -2
- data/lib/rubygems/security/signer.rb +1 -0
- data/lib/rubygems/security/trust_dir.rb +1 -0
- data/lib/rubygems/server.rb +1 -0
- data/lib/rubygems/source.rb +1 -0
- data/lib/rubygems/source/git.rb +1 -0
- data/lib/rubygems/source/installed.rb +1 -0
- data/lib/rubygems/source/local.rb +1 -0
- data/lib/rubygems/source/lock.rb +1 -0
- data/lib/rubygems/source/specific_file.rb +1 -0
- data/lib/rubygems/source/vendor.rb +1 -0
- data/lib/rubygems/source_list.rb +2 -1
- data/lib/rubygems/source_local.rb +1 -0
- data/lib/rubygems/source_specific_file.rb +1 -0
- data/lib/rubygems/spec_fetcher.rb +1 -0
- data/lib/rubygems/specification.rb +11 -6
- data/lib/rubygems/stub_specification.rb +1 -0
- data/lib/rubygems/syck_hack.rb +1 -0
- data/lib/rubygems/test_case.rb +15 -3
- data/lib/rubygems/test_utilities.rb +1 -0
- data/lib/rubygems/text.rb +1 -1
- data/lib/rubygems/uninstaller.rb +1 -0
- data/lib/rubygems/uri_formatter.rb +1 -0
- data/lib/rubygems/user_interaction.rb +1 -0
- data/lib/rubygems/util.rb +2 -1
- data/lib/rubygems/util/licenses.rb +14 -0
- data/lib/rubygems/util/list.rb +1 -0
- data/lib/rubygems/validator.rb +1 -0
- data/lib/rubygems/version.rb +5 -1
- data/lib/rubygems/version_option.rb +1 -0
- data/lib/ubygems.rb +1 -0
- data/setup.rb +1 -0
- data/test/rubygems/bad_rake.rb +1 -0
- data/test/rubygems/bogussources.rb +1 -0
- data/test/rubygems/fake_certlib/openssl.rb +1 -0
- data/test/rubygems/fix_openssl_warnings.rb +1 -0
- data/test/rubygems/foo/discover.rb +1 -0
- data/test/rubygems/good_rake.rb +1 -0
- data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -0
- data/test/rubygems/plugin/load/rubygems_plugin.rb +1 -0
- data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -0
- data/test/rubygems/rubygems/commands/crash_command.rb +1 -0
- data/test/rubygems/rubygems_plugin.rb +1 -0
- data/test/rubygems/sff/discover.rb +1 -0
- data/test/rubygems/simple_gem.rb +1 -0
- data/test/rubygems/test_bundled_ca.rb +39 -40
- data/test/rubygems/test_config.rb +1 -0
- data/test/rubygems/test_deprecate.rb +1 -0
- data/test/rubygems/test_gem.rb +1 -1
- data/test/rubygems/test_gem_available_set.rb +1 -0
- data/test/rubygems/test_gem_command.rb +1 -0
- data/test/rubygems/test_gem_command_manager.rb +1 -0
- data/test/rubygems/test_gem_commands_build_command.rb +11 -0
- data/test/rubygems/test_gem_commands_cert_command.rb +1 -0
- data/test/rubygems/test_gem_commands_check_command.rb +1 -0
- data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -0
- data/test/rubygems/test_gem_commands_contents_command.rb +1 -0
- data/test/rubygems/test_gem_commands_dependency_command.rb +1 -0
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -0
- data/test/rubygems/test_gem_commands_fetch_command.rb +1 -0
- data/test/rubygems/test_gem_commands_generate_index_command.rb +1 -0
- data/test/rubygems/test_gem_commands_help_command.rb +1 -0
- data/test/rubygems/test_gem_commands_install_command.rb +1 -0
- data/test/rubygems/test_gem_commands_list_command.rb +1 -0
- data/test/rubygems/test_gem_commands_lock_command.rb +1 -0
- data/test/rubygems/test_gem_commands_mirror.rb +1 -0
- data/test/rubygems/test_gem_commands_open_command.rb +1 -0
- data/test/rubygems/test_gem_commands_outdated_command.rb +1 -0
- data/test/rubygems/test_gem_commands_owner_command.rb +1 -0
- data/test/rubygems/test_gem_commands_pristine_command.rb +1 -0
- data/test/rubygems/test_gem_commands_push_command.rb +28 -0
- data/test/rubygems/test_gem_commands_query_command.rb +24 -0
- data/test/rubygems/test_gem_commands_search_command.rb +1 -0
- data/test/rubygems/test_gem_commands_server_command.rb +1 -0
- data/test/rubygems/test_gem_commands_setup_command.rb +1 -1
- data/test/rubygems/test_gem_commands_sources_command.rb +1 -0
- data/test/rubygems/test_gem_commands_specification_command.rb +1 -0
- data/test/rubygems/test_gem_commands_stale_command.rb +1 -0
- data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -0
- data/test/rubygems/test_gem_commands_unpack_command.rb +1 -0
- data/test/rubygems/test_gem_commands_update_command.rb +1 -0
- data/test/rubygems/test_gem_commands_which_command.rb +1 -0
- data/test/rubygems/test_gem_commands_yank_command.rb +13 -10
- data/test/rubygems/test_gem_config_file.rb +24 -0
- data/test/rubygems/test_gem_dependency.rb +1 -0
- data/test/rubygems/test_gem_dependency_installer.rb +1 -0
- data/test/rubygems/test_gem_dependency_list.rb +1 -0
- data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -0
- data/test/rubygems/test_gem_doctor.rb +1 -0
- data/test/rubygems/test_gem_ext_builder.rb +6 -1
- data/test/rubygems/test_gem_ext_cmake_builder.rb +1 -0
- data/test/rubygems/test_gem_ext_configure_builder.rb +1 -0
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +1 -0
- data/test/rubygems/test_gem_ext_rake_builder.rb +1 -0
- data/test/rubygems/test_gem_gem_runner.rb +1 -0
- data/test/rubygems/test_gem_gemcutter_utilities.rb +1 -0
- data/test/rubygems/test_gem_impossible_dependencies_error.rb +1 -0
- data/test/rubygems/test_gem_indexer.rb +1 -0
- data/test/rubygems/test_gem_install_update_options.rb +13 -0
- data/test/rubygems/test_gem_installer.rb +17 -4
- data/test/rubygems/test_gem_local_remote_options.rb +1 -0
- data/test/rubygems/test_gem_name_tuple.rb +1 -0
- data/test/rubygems/test_gem_package.rb +16 -9
- data/test/rubygems/test_gem_package_old.rb +1 -0
- data/test/rubygems/test_gem_package_tar_header.rb +1 -0
- data/test/rubygems/test_gem_package_tar_reader.rb +1 -0
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +2 -1
- data/test/rubygems/test_gem_package_tar_writer.rb +1 -0
- data/test/rubygems/test_gem_package_task.rb +1 -0
- data/test/rubygems/test_gem_path_support.rb +1 -0
- data/test/rubygems/test_gem_platform.rb +1 -0
- data/test/rubygems/test_gem_rdoc.rb +1 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +1 -0
- data/test/rubygems/test_gem_request.rb +1 -0
- data/test/rubygems/test_gem_request_connection_pools.rb +1 -0
- data/test/rubygems/test_gem_request_set.rb +3 -2
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +34 -45
- data/test/rubygems/test_gem_request_set_lockfile.rb +1 -0
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +9 -3
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -0
- data/test/rubygems/test_gem_requirement.rb +1 -0
- data/test/rubygems/test_gem_resolver.rb +1 -0
- data/test/rubygems/test_gem_resolver_activation_request.rb +1 -0
- data/test/rubygems/test_gem_resolver_api_set.rb +1 -0
- data/test/rubygems/test_gem_resolver_api_specification.rb +1 -0
- data/test/rubygems/test_gem_resolver_best_set.rb +1 -0
- data/test/rubygems/test_gem_resolver_composed_set.rb +1 -0
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -0
- data/test/rubygems/test_gem_resolver_dependency_request.rb +1 -0
- data/test/rubygems/test_gem_resolver_git_set.rb +1 -0
- data/test/rubygems/test_gem_resolver_git_specification.rb +1 -0
- data/test/rubygems/test_gem_resolver_index_set.rb +1 -0
- data/test/rubygems/test_gem_resolver_index_specification.rb +1 -0
- data/test/rubygems/test_gem_resolver_installed_specification.rb +1 -0
- data/test/rubygems/test_gem_resolver_installer_set.rb +1 -0
- data/test/rubygems/test_gem_resolver_local_specification.rb +1 -0
- data/test/rubygems/test_gem_resolver_lock_set.rb +1 -0
- data/test/rubygems/test_gem_resolver_lock_specification.rb +7 -6
- data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -0
- data/test/rubygems/test_gem_resolver_specification.rb +1 -0
- data/test/rubygems/test_gem_resolver_vendor_set.rb +1 -0
- data/test/rubygems/test_gem_resolver_vendor_specification.rb +1 -0
- data/test/rubygems/test_gem_security.rb +1 -0
- data/test/rubygems/test_gem_security_policy.rb +1 -0
- data/test/rubygems/test_gem_security_signer.rb +1 -0
- data/test/rubygems/test_gem_security_trust_dir.rb +1 -0
- data/test/rubygems/test_gem_server.rb +1 -0
- data/test/rubygems/test_gem_silent_ui.rb +1 -0
- data/test/rubygems/test_gem_source.rb +1 -0
- data/test/rubygems/test_gem_source_fetch_problem.rb +1 -0
- data/test/rubygems/test_gem_source_git.rb +1 -0
- data/test/rubygems/test_gem_source_installed.rb +1 -0
- data/test/rubygems/test_gem_source_list.rb +1 -0
- data/test/rubygems/test_gem_source_local.rb +1 -0
- data/test/rubygems/test_gem_source_lock.rb +1 -0
- data/test/rubygems/test_gem_source_specific_file.rb +1 -0
- data/test/rubygems/test_gem_source_vendor.rb +1 -0
- data/test/rubygems/test_gem_spec_fetcher.rb +1 -0
- data/test/rubygems/test_gem_specification.rb +80 -64
- data/test/rubygems/test_gem_stream_ui.rb +1 -0
- data/test/rubygems/test_gem_stub_specification.rb +1 -0
- data/test/rubygems/test_gem_text.rb +1 -0
- data/test/rubygems/test_gem_uninstaller.rb +1 -0
- data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +1 -0
- data/test/rubygems/test_gem_uri_formatter.rb +1 -0
- data/test/rubygems/test_gem_util.rb +1 -0
- data/test/rubygems/test_gem_validator.rb +1 -0
- data/test/rubygems/test_gem_version.rb +1 -0
- data/test/rubygems/test_gem_version_option.rb +1 -0
- data/test/rubygems/test_kernel.rb +1 -0
- data/test/rubygems/test_require.rb +2 -1
- data/util/create_certs.rb +1 -0
- data/util/create_encrypted_key.rb +1 -0
- data/util/generate_spdx_license_list.rb +15 -0
- data/util/update_bundled_ca_certificates.rb +1 -1
- metadata +12 -28
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gemtest +0 -0
- metadata.gz.sig +0 -2
@@ -1,5 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rubygems/resolver/molinillo/lib/molinillo/gem_metadata'
|
2
3
|
require 'rubygems/resolver/molinillo/lib/molinillo/errors'
|
3
4
|
require 'rubygems/resolver/molinillo/lib/molinillo/resolver'
|
4
5
|
require 'rubygems/resolver/molinillo/lib/molinillo/modules/ui'
|
5
6
|
require 'rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider'
|
7
|
+
|
8
|
+
# Gem::Resolver::Molinillo is a generic dependency resolution algorithm.
|
9
|
+
module Gem::Resolver::Molinillo
|
10
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'set'
|
2
3
|
require 'tsort'
|
3
4
|
|
@@ -14,8 +15,10 @@ module Gem::Resolver::Molinillo
|
|
14
15
|
|
15
16
|
include TSort
|
16
17
|
|
18
|
+
# @visibility private
|
17
19
|
alias_method :tsort_each_node, :each
|
18
20
|
|
21
|
+
# @visibility private
|
19
22
|
def tsort_each_child(vertex, &block)
|
20
23
|
vertex.successors.each(&block)
|
21
24
|
end
|
@@ -41,12 +44,14 @@ module Gem::Resolver::Molinillo
|
|
41
44
|
# by {Vertex#name}
|
42
45
|
attr_reader :vertices
|
43
46
|
|
47
|
+
# Initializes an empty dependency graph
|
44
48
|
def initialize
|
45
49
|
@vertices = {}
|
46
50
|
end
|
47
51
|
|
48
52
|
# Initializes a copy of a {DependencyGraph}, ensuring that all {#vertices}
|
49
53
|
# are properly copied.
|
54
|
+
# @param [DependencyGraph] other the graph to copy.
|
50
55
|
def initialize_copy(other)
|
51
56
|
super
|
52
57
|
@vertices = {}
|
@@ -100,6 +105,7 @@ module Gem::Resolver::Molinillo
|
|
100
105
|
vertex
|
101
106
|
end
|
102
107
|
|
108
|
+
# Adds a vertex with the given name, or updates the existing one.
|
103
109
|
# @param [String] name
|
104
110
|
# @param [Object] payload
|
105
111
|
# @return [Vertex] the vertex that was added to `self`
|
@@ -150,6 +156,8 @@ module Gem::Resolver::Molinillo
|
|
150
156
|
|
151
157
|
private
|
152
158
|
|
159
|
+
# Adds a new {Edge} to the dependency graph without checking for
|
160
|
+
# circularity.
|
153
161
|
def add_edge_no_circular(origin, destination, requirement)
|
154
162
|
edge = Edge.new(origin, destination, requirement)
|
155
163
|
origin.outgoing_edges << edge
|
@@ -174,6 +182,7 @@ module Gem::Resolver::Molinillo
|
|
174
182
|
attr_accessor :root
|
175
183
|
alias_method :root?, :root
|
176
184
|
|
185
|
+
# Initializes a vertex with the given name and payload.
|
177
186
|
# @param [String] name see {#name}
|
178
187
|
# @param [Object] payload see {#payload}
|
179
188
|
def initialize(name, payload)
|
@@ -240,6 +249,7 @@ module Gem::Resolver::Molinillo
|
|
240
249
|
successors.to_set == other.successors.to_set
|
241
250
|
end
|
242
251
|
|
252
|
+
# @param [Vertex] other the other vertex to compare to
|
243
253
|
# @return [Boolean] whether the two vertices are equal, determined
|
244
254
|
# solely by {#name} and {#payload} equality
|
245
255
|
def shallow_eql?(other)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Gem::Resolver::Molinillo
|
2
3
|
# An error that occurred during the resolution process
|
3
4
|
class ResolverError < StandardError; end
|
@@ -11,6 +12,7 @@ module Gem::Resolver::Molinillo
|
|
11
12
|
# @return [Array<Object>] the specifications that depended upon {#dependency}
|
12
13
|
attr_accessor :required_by
|
13
14
|
|
15
|
+
# Initializes a new error with the given missing dependency.
|
14
16
|
# @param [Object] dependency @see {#dependency}
|
15
17
|
# @param [Array<Object>] required_by @see {#required_by}
|
16
18
|
def initialize(dependency, required_by = [])
|
@@ -19,6 +21,8 @@ module Gem::Resolver::Molinillo
|
|
19
21
|
super()
|
20
22
|
end
|
21
23
|
|
24
|
+
# The error message for the missing dependency, including the specifications
|
25
|
+
# that had this dependency.
|
22
26
|
def message
|
23
27
|
sources = required_by.map { |r| "`#{r}`" }.join(' and ')
|
24
28
|
message = "Unable to find a specification for `#{dependency}`"
|
@@ -36,6 +40,7 @@ module Gem::Resolver::Molinillo
|
|
36
40
|
# [Set<Object>] the dependencies responsible for causing the error
|
37
41
|
attr_reader :dependencies
|
38
42
|
|
43
|
+
# Initializes a new error with the given circular vertices.
|
39
44
|
# @param [Array<DependencyGraph::Vertex>] nodes the nodes in the dependency
|
40
45
|
# that caused the error
|
41
46
|
def initialize(nodes)
|
@@ -50,6 +55,7 @@ module Gem::Resolver::Molinillo
|
|
50
55
|
# resolution to fail
|
51
56
|
attr_reader :conflicts
|
52
57
|
|
58
|
+
# Initializes a new error with the given version conflicts.
|
53
59
|
# @param [{String => Resolution::Conflict}] conflicts see {#conflicts}
|
54
60
|
def initialize(conflicts)
|
55
61
|
pairs = []
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Gem::Resolver::Molinillo
|
2
3
|
class Resolver
|
3
4
|
# A specific resolution from a given {Resolver}
|
@@ -38,6 +39,7 @@ module Gem::Resolver::Molinillo
|
|
38
39
|
# @return [Array] the dependencies that were explicitly required
|
39
40
|
attr_reader :original_requested
|
40
41
|
|
42
|
+
# Initializes a new resolution.
|
41
43
|
# @param [SpecificationProvider] specification_provider
|
42
44
|
# see {#specification_provider}
|
43
45
|
# @param [UI] resolver_ui see {#resolver_ui}
|
@@ -1,9 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph'
|
2
3
|
|
3
4
|
module Gem::Resolver::Molinillo
|
4
5
|
# This class encapsulates a dependency resolver.
|
5
6
|
# The resolver is responsible for determining which set of dependencies to
|
6
|
-
# activate, with feedback from the
|
7
|
+
# activate, with feedback from the {#specification_provider}
|
7
8
|
#
|
8
9
|
#
|
9
10
|
class Resolver
|
@@ -17,6 +18,7 @@ module Gem::Resolver::Molinillo
|
|
17
18
|
# during the resolution process
|
18
19
|
attr_reader :resolver_ui
|
19
20
|
|
21
|
+
# Initializes a new resolver.
|
20
22
|
# @param [SpecificationProvider] specification_provider
|
21
23
|
# see {#specification_provider}
|
22
24
|
# @param [UI] resolver_ui
|
@@ -1,12 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Gem::Resolver::Molinillo
|
2
3
|
# A state that a {Resolution} can be in
|
3
|
-
# @attr [String] name
|
4
|
-
# @attr [Array<Object>] requirements
|
5
|
-
# @attr [DependencyGraph] activated
|
6
|
-
# @attr [Object] requirement
|
7
|
-
# @attr [Object]
|
8
|
-
# @attr [Integer] depth
|
9
|
-
# @attr [Set<Object>] conflicts
|
4
|
+
# @attr [String] name the name of the current requirement
|
5
|
+
# @attr [Array<Object>] requirements currently unsatisfied requirements
|
6
|
+
# @attr [DependencyGraph] activated the graph of activated dependencies
|
7
|
+
# @attr [Object] requirement the current requirement
|
8
|
+
# @attr [Object] possibilities the possibilities to satisfy the current requirement
|
9
|
+
# @attr [Integer] depth the depth of the resolution
|
10
|
+
# @attr [Set<Object>] conflicts unresolved conflicts
|
10
11
|
ResolutionState = Struct.new(
|
11
12
|
:name,
|
12
13
|
:requirements,
|
@@ -0,0 +1,48 @@
|
|
1
|
+
##
|
2
|
+
# The SourceSet chooses the best available method to query a remote index.
|
3
|
+
#
|
4
|
+
# Kind off like BestSet but filters the sources for gems
|
5
|
+
|
6
|
+
class Gem::Resolver::SourceSet < Gem::Resolver::Set
|
7
|
+
|
8
|
+
##
|
9
|
+
# Creates a SourceSet for the given +sources+ or Gem::sources if none are
|
10
|
+
# specified. +sources+ must be a Gem::SourceList.
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
super()
|
14
|
+
|
15
|
+
@links = {}
|
16
|
+
@sets = {}
|
17
|
+
end
|
18
|
+
|
19
|
+
def find_all req # :nodoc:
|
20
|
+
if set = get_set(req.dependency.name)
|
21
|
+
set.find_all req
|
22
|
+
else
|
23
|
+
[]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# potentially no-op
|
28
|
+
def prefetch reqs # :nodoc:
|
29
|
+
reqs.each do |req|
|
30
|
+
if set = get_set(req.dependency.name)
|
31
|
+
set.prefetch reqs
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def add_source_gem name, source
|
37
|
+
@links[name] = source
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def get_set(name)
|
43
|
+
link = @links[name]
|
44
|
+
@sets[link] ||= Gem::Source.new(link).dependency_resolver_set if link
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
data/lib/rubygems/security.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#--
|
2
3
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
3
4
|
# All rights reserved.
|
@@ -339,7 +340,7 @@ module Gem::Security
|
|
339
340
|
# Digest algorithm used to sign gems
|
340
341
|
|
341
342
|
DIGEST_ALGORITHM =
|
342
|
-
if defined?(OpenSSL::Digest) then
|
343
|
+
if defined?(OpenSSL::Digest::SHA1) then
|
343
344
|
OpenSSL::Digest::SHA1
|
344
345
|
end
|
345
346
|
|
@@ -355,7 +356,7 @@ module Gem::Security
|
|
355
356
|
# Algorithm for creating the key pair used to sign gems
|
356
357
|
|
357
358
|
KEY_ALGORITHM =
|
358
|
-
if defined?(OpenSSL::PKey) then
|
359
|
+
if defined?(OpenSSL::PKey::RSA) then
|
359
360
|
OpenSSL::PKey::RSA
|
360
361
|
end
|
361
362
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rubygems/user_interaction'
|
2
3
|
|
3
4
|
##
|
@@ -157,7 +158,7 @@ class Gem::Security::Policy
|
|
157
158
|
path = Gem::Security.trust_dir.cert_path root
|
158
159
|
|
159
160
|
unless File.exist? path then
|
160
|
-
message = "root cert #{root.subject} is not trusted"
|
161
|
+
message = "root cert #{root.subject} is not trusted".dup
|
161
162
|
|
162
163
|
message << " (root of signing cert #{chain.last.subject})" if
|
163
164
|
chain.length > 1
|
@@ -292,4 +293,3 @@ class Gem::Security::Policy
|
|
292
293
|
alias to_s name # :nodoc:
|
293
294
|
|
294
295
|
end
|
295
|
-
|
data/lib/rubygems/server.rb
CHANGED
data/lib/rubygems/source.rb
CHANGED
data/lib/rubygems/source/git.rb
CHANGED
data/lib/rubygems/source/lock.rb
CHANGED
data/lib/rubygems/source_list.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rubygems/source'
|
2
3
|
|
3
4
|
##
|
@@ -9,7 +10,7 @@ require 'rubygems/source'
|
|
9
10
|
# Or by adding them:
|
10
11
|
#
|
11
12
|
# sources = Gem::SourceList.new
|
12
|
-
# sources
|
13
|
+
# sources << 'https://rubygems.example'
|
13
14
|
#
|
14
15
|
# The most common way to get a SourceList is Gem.sources.
|
15
16
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# -*- coding: utf-8 -*-
|
2
3
|
#--
|
3
4
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
@@ -1191,6 +1192,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1191
1192
|
def self.normalize_yaml_input(input)
|
1192
1193
|
result = input.respond_to?(:read) ? input.read : input
|
1193
1194
|
result = "--- " + result unless result =~ /\A--- /
|
1195
|
+
result = result.dup
|
1194
1196
|
result.gsub!(/ !!null \n/, " \n")
|
1195
1197
|
# date: 2011-04-26 00:00:00.000000000Z
|
1196
1198
|
# date: 2011-04-26 00:00:00.000000000 Z
|
@@ -2333,7 +2335,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2333
2335
|
|
2334
2336
|
def ruby_code(obj)
|
2335
2337
|
case obj
|
2336
|
-
when String then obj.dump
|
2338
|
+
when String then obj.dump + ".freeze"
|
2337
2339
|
when Array then '[' + obj.map { |x| ruby_code x }.join(", ") + ']'
|
2338
2340
|
when Hash then
|
2339
2341
|
seg = obj.keys.sort.map { |k| "#{k.to_s.dump} => #{obj[k].to_s.dump}" }
|
@@ -2523,14 +2525,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2523
2525
|
dependencies.each do |dep|
|
2524
2526
|
req = dep.requirements_list.inspect
|
2525
2527
|
dep.instance_variable_set :@type, :runtime if dep.type.nil? # HACK
|
2526
|
-
result << " s.add_#{dep.type}_dependency(%q<#{dep.name}
|
2528
|
+
result << " s.add_#{dep.type}_dependency(%q<#{dep.name}>.freeze, #{req})"
|
2527
2529
|
end
|
2528
2530
|
|
2529
2531
|
result << " else"
|
2530
2532
|
|
2531
2533
|
dependencies.each do |dep|
|
2532
2534
|
version_reqs_param = dep.requirements_list.inspect
|
2533
|
-
result << " s.add_dependency(%q<#{dep.name}
|
2535
|
+
result << " s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})"
|
2534
2536
|
end
|
2535
2537
|
|
2536
2538
|
result << ' end'
|
@@ -2538,7 +2540,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2538
2540
|
result << " else"
|
2539
2541
|
dependencies.each do |dep|
|
2540
2542
|
version_reqs_param = dep.requirements_list.inspect
|
2541
|
-
result << " s.add_dependency(%q<#{dep.name}
|
2543
|
+
result << " s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})"
|
2542
2544
|
end
|
2543
2545
|
result << " end"
|
2544
2546
|
end
|
@@ -2760,10 +2762,13 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2760
2762
|
end
|
2761
2763
|
|
2762
2764
|
if !Gem::Licenses.match?(license)
|
2763
|
-
|
2764
|
-
|
2765
|
+
suggestions = Gem::Licenses.suggestions(license)
|
2766
|
+
message = <<-warning
|
2767
|
+
license value '#{license}' is invalid. Use a license identifier from
|
2765
2768
|
http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard license.
|
2766
2769
|
warning
|
2770
|
+
message += "Did you mean #{suggestions.map { |s| "'#{s}'"}.join(', ')}?\n" unless suggestions.nil?
|
2771
|
+
warning(message)
|
2767
2772
|
end
|
2768
2773
|
}
|
2769
2774
|
|