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
data/lib/rubygems/request_set.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'tsort'
|
2
3
|
|
3
4
|
##
|
@@ -76,6 +77,11 @@ class Gem::RequestSet
|
|
76
77
|
|
77
78
|
attr_reader :vendor_set # :nodoc:
|
78
79
|
|
80
|
+
##
|
81
|
+
# The set of source gems imported via load_gemdeps.
|
82
|
+
|
83
|
+
attr_reader :source_set
|
84
|
+
|
79
85
|
##
|
80
86
|
# Creates a RequestSet for a list of Gem::Dependency objects, +deps+. You
|
81
87
|
# can then #resolve and #install the resolved list of dependencies.
|
@@ -105,6 +111,7 @@ class Gem::RequestSet
|
|
105
111
|
@sorted = nil
|
106
112
|
@specs = nil
|
107
113
|
@vendor_set = nil
|
114
|
+
@source_set = nil
|
108
115
|
|
109
116
|
yield self if block_given?
|
110
117
|
end
|
@@ -142,7 +149,6 @@ class Gem::RequestSet
|
|
142
149
|
return requests
|
143
150
|
end
|
144
151
|
|
145
|
-
cache_dir = options[:cache_dir] || Gem.dir
|
146
152
|
@prerelease = options[:prerelease]
|
147
153
|
|
148
154
|
requests = []
|
@@ -157,13 +163,11 @@ class Gem::RequestSet
|
|
157
163
|
end
|
158
164
|
end
|
159
165
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
yield req, inst if block_given?
|
166
|
+
spec = req.spec.install options do |installer|
|
167
|
+
yield req, installer if block_given?
|
168
|
+
end
|
165
169
|
|
166
|
-
requests <<
|
170
|
+
requests << spec
|
167
171
|
end
|
168
172
|
|
169
173
|
return requests if options[:gemdeps]
|
@@ -271,10 +275,11 @@ class Gem::RequestSet
|
|
271
275
|
def load_gemdeps path, without_groups = [], installing = false
|
272
276
|
@git_set = Gem::Resolver::GitSet.new
|
273
277
|
@vendor_set = Gem::Resolver::VendorSet.new
|
278
|
+
@source_set = Gem::Resolver::SourceSet.new
|
274
279
|
|
275
280
|
@git_set.root_dir = @install_dir
|
276
281
|
|
277
|
-
lock_file = "#{File.expand_path(path)}.lock".untaint
|
282
|
+
lock_file = "#{File.expand_path(path)}.lock".dup.untaint
|
278
283
|
begin
|
279
284
|
tokenizer = Gem::RequestSet::Lockfile::Tokenizer.from_file lock_file
|
280
285
|
parser = tokenizer.make_parser self, []
|
@@ -338,6 +343,7 @@ class Gem::RequestSet
|
|
338
343
|
@sets << set
|
339
344
|
@sets << @git_set
|
340
345
|
@sets << @vendor_set
|
346
|
+
@sets << @source_set
|
341
347
|
|
342
348
|
set = Gem::Resolver.compose_sets(*@sets)
|
343
349
|
set.remote = @remote
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
##
|
2
3
|
# A semi-compatible DSL for the Bundler Gemfile and Isolate gem dependencies
|
3
4
|
# files.
|
@@ -204,6 +205,7 @@ class Gem::RequestSet::GemDependencyAPI
|
|
204
205
|
@installing = false
|
205
206
|
@requires = Hash.new { |h, name| h[name] = [] }
|
206
207
|
@vendor_set = @set.vendor_set
|
208
|
+
@source_set = @set.source_set
|
207
209
|
@gem_sources = {}
|
208
210
|
@without_groups = []
|
209
211
|
|
@@ -362,6 +364,7 @@ class Gem::RequestSet::GemDependencyAPI
|
|
362
364
|
source_set ||= gem_path name, options
|
363
365
|
source_set ||= gem_git name, options
|
364
366
|
source_set ||= gem_git_source name, options
|
367
|
+
source_set ||= gem_source name, options
|
365
368
|
|
366
369
|
duplicate = @dependencies.include? name
|
367
370
|
|
@@ -407,11 +410,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
|
|
407
410
|
|
408
411
|
pin_gem_source name, :git, repository
|
409
412
|
|
410
|
-
reference =
|
411
|
-
reference ||= options.delete :ref
|
412
|
-
reference ||= options.delete :branch
|
413
|
-
reference ||= options.delete :tag
|
414
|
-
reference ||= 'master'
|
413
|
+
reference = gem_git_reference options
|
415
414
|
|
416
415
|
submodules = options.delete :submodules
|
417
416
|
|
@@ -420,6 +419,36 @@ Gem dependencies file #{@path} requires #{name} more than once.
|
|
420
419
|
true
|
421
420
|
end
|
422
421
|
|
422
|
+
##
|
423
|
+
# Handles the git options from +options+ for git gem.
|
424
|
+
#
|
425
|
+
# Returns reference for the git gem.
|
426
|
+
|
427
|
+
def gem_git_reference options # :nodoc:
|
428
|
+
ref = options.delete :ref
|
429
|
+
branch = options.delete :branch
|
430
|
+
tag = options.delete :tag
|
431
|
+
|
432
|
+
reference = nil
|
433
|
+
reference ||= ref
|
434
|
+
reference ||= branch
|
435
|
+
reference ||= tag
|
436
|
+
reference ||= 'master'
|
437
|
+
|
438
|
+
if ref && branch
|
439
|
+
warn <<-WARNING
|
440
|
+
Gem dependencies file #{@path} includes git reference for both ref and branch but only ref is used.
|
441
|
+
WARNING
|
442
|
+
end
|
443
|
+
if (ref||branch) && tag
|
444
|
+
warn <<-WARNING
|
445
|
+
Gem dependencies file #{@path} includes git reference for both ref/branch and tag but only ref/branch is used.
|
446
|
+
WARNING
|
447
|
+
end
|
448
|
+
|
449
|
+
reference
|
450
|
+
end
|
451
|
+
|
423
452
|
private :gem_git
|
424
453
|
|
425
454
|
##
|
@@ -480,6 +509,23 @@ Gem dependencies file #{@path} requires #{name} more than once.
|
|
480
509
|
|
481
510
|
private :gem_path
|
482
511
|
|
512
|
+
##
|
513
|
+
# Handles the source: option from +options+ for gem +name+.
|
514
|
+
#
|
515
|
+
# Returns +true+ if the source option was handled.
|
516
|
+
|
517
|
+
def gem_source name, options # :nodoc:
|
518
|
+
return unless source = options.delete(:source)
|
519
|
+
|
520
|
+
pin_gem_source name, :source, source
|
521
|
+
|
522
|
+
@source_set.add_source_gem name, source
|
523
|
+
|
524
|
+
true
|
525
|
+
end
|
526
|
+
|
527
|
+
private :gem_source
|
528
|
+
|
483
529
|
##
|
484
530
|
# Handles the platforms: option from +options+. Returns true if the
|
485
531
|
# platform matches the current platform.
|
@@ -526,6 +572,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
|
|
526
572
|
else
|
527
573
|
@requires[name] << name
|
528
574
|
end
|
575
|
+
raise ArgumentError, "Unhandled gem options #{options.inspect}" unless options.empty?
|
529
576
|
end
|
530
577
|
|
531
578
|
private :gem_requires
|
@@ -611,6 +658,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
|
|
611
658
|
|
612
659
|
add_dependencies groups, spec.development_dependencies
|
613
660
|
|
661
|
+
@vendor_set.add_vendor_gem spec.name, path
|
614
662
|
gem_requires spec.name, options
|
615
663
|
end
|
616
664
|
|
@@ -650,6 +698,7 @@ Gem dependencies file #{@path} requires #{name} more than once.
|
|
650
698
|
when :default then '(default)'
|
651
699
|
when :path then "path: #{source}"
|
652
700
|
when :git then "git: #{source}"
|
701
|
+
when :source then "source: #{source}"
|
653
702
|
else '(unknown)'
|
654
703
|
end
|
655
704
|
|
@@ -798,4 +847,3 @@ Gem dependencies file #{@path} requires #{name} more than once.
|
|
798
847
|
Gem::RequestSet::GemDepedencyAPI = self # :nodoc:
|
799
848
|
|
800
849
|
end
|
801
|
-
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
##
|
2
3
|
# Parses a gem.deps.rb.lock file and constructs a LockSet containing the
|
3
4
|
# dependencies found inside. If the lock file is missing no LockSet is
|
@@ -129,8 +130,8 @@ class Gem::RequestSet::Lockfile
|
|
129
130
|
[source.repository, source.rev_parse]
|
130
131
|
end
|
131
132
|
|
132
|
-
out << "GIT"
|
133
133
|
by_repository_revision.each do |(repository, revision), requests|
|
134
|
+
out << "GIT"
|
134
135
|
out << " remote: #{repository}"
|
135
136
|
out << " revision: #{revision}"
|
136
137
|
out << " specs:"
|
@@ -143,9 +144,8 @@ class Gem::RequestSet::Lockfile
|
|
143
144
|
out << " #{dep.name}#{dep.requirement.for_lockfile}"
|
144
145
|
end
|
145
146
|
end
|
147
|
+
out << nil
|
146
148
|
end
|
147
|
-
|
148
|
-
out << nil
|
149
149
|
end
|
150
150
|
|
151
151
|
def relative_path_from dest, base # :nodoc:
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
class Gem::RequestSet::Lockfile::Parser
|
2
3
|
###
|
3
4
|
# Parses lockfiles
|
@@ -324,15 +325,24 @@ class Gem::RequestSet::Lockfile::Parser
|
|
324
325
|
@tokens.peek
|
325
326
|
end
|
326
327
|
|
327
|
-
|
328
|
-
|
329
|
-
Gem::
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
}.compact.first
|
328
|
+
if [].respond_to? :flat_map
|
329
|
+
def pinned_requirement name # :nodoc:
|
330
|
+
requirement = Gem::Dependency.new name
|
331
|
+
specification = @set.sets.flat_map { |set|
|
332
|
+
set.find_all(requirement)
|
333
|
+
}.compact.first
|
334
334
|
|
335
|
-
|
335
|
+
specification && specification.version
|
336
|
+
end
|
337
|
+
else # FIXME: remove when 1.8 is dropped
|
338
|
+
def pinned_requirement name # :nodoc:
|
339
|
+
requirement = Gem::Dependency.new name
|
340
|
+
specification = @set.sets.map { |set|
|
341
|
+
set.find_all(requirement)
|
342
|
+
}.flatten(1).compact.first
|
343
|
+
|
344
|
+
specification && specification.version
|
345
|
+
end
|
336
346
|
end
|
337
347
|
|
338
348
|
##
|
@@ -342,4 +352,3 @@ class Gem::RequestSet::Lockfile::Parser
|
|
342
352
|
@tokens.unshift token
|
343
353
|
end
|
344
354
|
end
|
345
|
-
|
data/lib/rubygems/requirement.rb
CHANGED
data/lib/rubygems/resolver.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rubygems/dependency'
|
2
3
|
require 'rubygems/exceptions'
|
3
4
|
require 'rubygems/util'
|
@@ -278,6 +279,7 @@ require 'rubygems/resolver/index_set'
|
|
278
279
|
require 'rubygems/resolver/installer_set'
|
279
280
|
require 'rubygems/resolver/lock_set'
|
280
281
|
require 'rubygems/resolver/vendor_set'
|
282
|
+
require 'rubygems/resolver/source_set'
|
281
283
|
|
282
284
|
require 'rubygems/resolver/specification'
|
283
285
|
require 'rubygems/resolver/spec_specification'
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
##
|
2
3
|
# Specifies a Specification object that should be activated. Also contains a
|
3
4
|
# dependency that was used to introduce this activation.
|
@@ -49,15 +50,27 @@ class Gem::Resolver::ActivationRequest
|
|
49
50
|
# Downloads a gem at +path+ and returns the file path.
|
50
51
|
|
51
52
|
def download path
|
52
|
-
|
53
|
+
Gem.ensure_gem_subdirectories path
|
54
|
+
|
55
|
+
if @spec.respond_to? :sources
|
56
|
+
exception = nil
|
57
|
+
path = @spec.sources.find{ |source|
|
58
|
+
begin
|
59
|
+
source.download full_spec, path
|
60
|
+
rescue exception
|
61
|
+
end
|
62
|
+
}
|
63
|
+
return path if path
|
64
|
+
raise exception if exception
|
65
|
+
|
66
|
+
elsif @spec.respond_to? :source
|
53
67
|
source = @spec.source
|
68
|
+
source.download full_spec, path
|
69
|
+
|
54
70
|
else
|
55
71
|
source = Gem.sources.first
|
72
|
+
source.download full_spec, path
|
56
73
|
end
|
57
|
-
|
58
|
-
Gem.ensure_gem_subdirectories path
|
59
|
-
|
60
|
-
source.download full_spec, path
|
61
74
|
end
|
62
75
|
|
63
76
|
##
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
##
|
2
3
|
# A set of gems from a gem dependencies lockfile.
|
3
4
|
|
@@ -27,11 +28,9 @@ class Gem::Resolver::LockSet < Gem::Resolver::Set
|
|
27
28
|
|
28
29
|
def add name, version, platform # :nodoc:
|
29
30
|
version = Gem::Version.new version
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
platform
|
34
|
-
end
|
31
|
+
specs = [
|
32
|
+
Gem::Resolver::LockSpecification.new(self, name, version, @sources, platform)
|
33
|
+
]
|
35
34
|
|
36
35
|
@specs.concat specs
|
37
36
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
##
|
2
3
|
# The LockSpecification comes from a lockfile (Gem::RequestSet::Lockfile).
|
3
4
|
#
|
@@ -6,13 +7,16 @@
|
|
6
7
|
|
7
8
|
class Gem::Resolver::LockSpecification < Gem::Resolver::Specification
|
8
9
|
|
9
|
-
|
10
|
+
attr_reader :sources
|
11
|
+
|
12
|
+
def initialize set, name, version, sources, platform
|
10
13
|
super()
|
11
14
|
|
12
15
|
@name = name
|
13
16
|
@platform = platform
|
14
17
|
@set = set
|
15
|
-
@source =
|
18
|
+
@source = sources.first
|
19
|
+
@sources = sources
|
16
20
|
@version = version
|
17
21
|
|
18
22
|
@dependencies = []
|