rubygems-update 3.2.15 → 3.2.20
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/CHANGELOG.md +56 -9
- data/CONTRIBUTING.md +2 -2
- data/Manifest.txt +4 -0
- data/Rakefile +8 -14
- data/bundler/CHANGELOG.md +86 -6
- data/bundler/bundler.gemspec +2 -3
- data/bundler/lib/bundler.rb +1 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +16 -35
- data/bundler/lib/bundler/cli/check.rb +4 -2
- data/bundler/lib/bundler/cli/common.rb +15 -2
- data/bundler/lib/bundler/cli/gem.rb +9 -1
- data/bundler/lib/bundler/cli/outdated.rb +10 -11
- data/bundler/lib/bundler/compact_index_client/updater.rb +9 -5
- data/bundler/lib/bundler/current_ruby.rb +1 -0
- data/bundler/lib/bundler/definition.rb +27 -84
- data/bundler/lib/bundler/feature_flag.rb +0 -2
- data/bundler/lib/bundler/fetcher.rb +2 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +8 -4
- data/bundler/lib/bundler/fetcher/index.rb +0 -1
- data/bundler/lib/bundler/friendly_errors.rb +2 -4
- data/bundler/lib/bundler/gem_helper.rb +16 -0
- data/bundler/lib/bundler/index.rb +1 -2
- data/bundler/lib/bundler/injector.rb +2 -2
- data/bundler/lib/bundler/inline.rb +1 -1
- data/bundler/lib/bundler/lazy_specification.rb +3 -3
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +21 -10
- data/bundler/lib/bundler/man/bundle-config.1.ronn +21 -11
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/plugin.rb +2 -2
- data/bundler/lib/bundler/plugin/api/source.rb +14 -0
- data/bundler/lib/bundler/resolver.rb +13 -96
- data/bundler/lib/bundler/resolver/spec_group.rb +0 -24
- data/bundler/lib/bundler/retry.rb +1 -1
- data/bundler/lib/bundler/rubygems_ext.rb +2 -2
- data/bundler/lib/bundler/rubygems_integration.rb +4 -3
- data/bundler/lib/bundler/settings.rb +74 -12
- data/bundler/lib/bundler/source.rb +11 -0
- data/bundler/lib/bundler/source/rubygems.rb +23 -10
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +64 -0
- data/bundler/lib/bundler/source_list.rb +33 -10
- data/bundler/lib/bundler/source_map.rb +58 -0
- data/bundler/lib/bundler/spec_set.rb +18 -7
- data/bundler/lib/bundler/templates/Gemfile +1 -1
- data/bundler/lib/bundler/templates/gems.rb +1 -1
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -4
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +1 -1
- data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +1 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems.rb +4 -4
- data/lib/rubygems/command.rb +2 -0
- data/lib/rubygems/commands/build_command.rb +1 -1
- data/lib/rubygems/commands/install_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +1 -1
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/deprecate.rb +3 -1
- data/lib/rubygems/ext/ext_conf_builder.rb +4 -4
- data/lib/rubygems/indexer.rb +1 -1
- data/lib/rubygems/installer.rb +9 -2
- data/lib/rubygems/package.rb +1 -8
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +1 -1
- data/lib/rubygems/specification.rb +0 -2
- data/lib/rubygems/specification_policy.rb +5 -4
- data/lib/rubygems/test_case.rb +106 -18
- data/lib/rubygems/test_utilities.rb +1 -1
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/packages/ascii_binder-0.1.10.1.gem +0 -0
- data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
- data/test/rubygems/test_bundled_ca.rb +2 -2
- data/test/rubygems/test_deprecate.rb +49 -5
- data/test/rubygems/test_gem.rb +33 -31
- data/test/rubygems/test_gem_bundler_version_finder.rb +3 -5
- data/test/rubygems/test_gem_command.rb +13 -1
- data/test/rubygems/test_gem_command_manager.rb +5 -5
- data/test/rubygems/test_gem_commands_build_command.rb +10 -10
- data/test/rubygems/test_gem_commands_cert_command.rb +36 -36
- data/test/rubygems/test_gem_commands_check_command.rb +5 -5
- data/test/rubygems/test_gem_commands_cleanup_command.rb +24 -24
- data/test/rubygems/test_gem_commands_contents_command.rb +3 -3
- data/test/rubygems/test_gem_commands_dependency_command.rb +2 -2
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -1
- data/test/rubygems/test_gem_commands_fetch_command.rb +9 -9
- data/test/rubygems/test_gem_commands_help_command.rb +8 -1
- data/test/rubygems/test_gem_commands_install_command.rb +60 -60
- data/test/rubygems/test_gem_commands_list_command.rb +1 -1
- data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
- data/test/rubygems/test_gem_commands_open_command.rb +8 -9
- data/test/rubygems/test_gem_commands_owner_command.rb +3 -3
- data/test/rubygems/test_gem_commands_pristine_command.rb +14 -14
- data/test/rubygems/test_gem_commands_push_command.rb +6 -6
- data/test/rubygems/test_gem_commands_query_command.rb +7 -7
- data/test/rubygems/test_gem_commands_server_command.rb +2 -2
- data/test/rubygems/test_gem_commands_setup_command.rb +21 -21
- data/test/rubygems/test_gem_commands_signin_command.rb +6 -6
- data/test/rubygems/test_gem_commands_sources_command.rb +5 -5
- data/test/rubygems/test_gem_commands_specification_command.rb +6 -6
- data/test/rubygems/test_gem_commands_uninstall_command.rb +4 -4
- data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
- data/test/rubygems/test_gem_commands_update_command.rb +10 -10
- data/test/rubygems/test_gem_commands_which_command.rb +3 -3
- data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
- data/test/rubygems/test_gem_config_file.rb +9 -9
- data/test/rubygems/test_gem_dependency.rb +12 -6
- data/test/rubygems/test_gem_dependency_installer.rb +4 -4
- data/test/rubygems/test_gem_doctor.rb +30 -30
- data/test/rubygems/test_gem_ext_builder.rb +20 -20
- data/test/rubygems/test_gem_ext_cmake_builder.rb +4 -4
- data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +14 -13
- data/test/rubygems/test_gem_ext_rake_builder.rb +1 -1
- data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -8
- data/test/rubygems/test_gem_install_update_options.rb +9 -9
- data/test/rubygems/test_gem_installer.rb +182 -140
- data/test/rubygems/test_gem_local_remote_options.rb +1 -1
- data/test/rubygems/test_gem_package.rb +49 -49
- data/test/rubygems/test_gem_package_old.rb +9 -9
- data/test/rubygems/test_gem_package_tar_header.rb +5 -5
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +8 -8
- data/test/rubygems/test_gem_package_tar_writer.rb +18 -20
- data/test/rubygems/test_gem_package_task.rb +2 -2
- data/test/rubygems/test_gem_path_support.rb +1 -1
- data/test/rubygems/test_gem_rdoc.rb +9 -9
- data/test/rubygems/test_gem_remote_fetcher.rb +17 -18
- data/test/rubygems/test_gem_request.rb +2 -2
- data/test/rubygems/test_gem_request_connection_pools.rb +1 -1
- data/test/rubygems/test_gem_request_set.rb +15 -14
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +16 -16
- data/test/rubygems/test_gem_request_set_lockfile.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +3 -3
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +4 -4
- data/test/rubygems/test_gem_requirement.rb +13 -13
- data/test/rubygems/test_gem_resolver.rb +11 -11
- data/test/rubygems/test_gem_resolver_best_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_set.rb +1 -1
- data/test/rubygems/test_gem_resolver_git_specification.rb +2 -2
- data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +4 -4
- data/test/rubygems/test_gem_resolver_local_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_specification.rb +1 -1
- data/test/rubygems/test_gem_resolver_vendor_set.rb +2 -2
- data/test/rubygems/test_gem_security.rb +5 -5
- data/test/rubygems/test_gem_security_policy.rb +27 -27
- data/test/rubygems/test_gem_security_signer.rb +7 -7
- data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
- data/test/rubygems/test_gem_server.rb +2 -2
- data/test/rubygems/test_gem_silent_ui.rb +9 -9
- data/test/rubygems/test_gem_source.rb +2 -2
- data/test/rubygems/test_gem_source_fetch_problem.rb +1 -1
- data/test/rubygems/test_gem_source_git.rb +11 -11
- data/test/rubygems/test_gem_source_specific_file.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +1 -1
- data/test/rubygems/test_gem_specification.rb +86 -106
- data/test/rubygems/test_gem_stream_ui.rb +1 -1
- data/test/rubygems/test_gem_stub_specification.rb +4 -4
- data/test/rubygems/test_gem_uninstaller.rb +16 -16
- data/test/rubygems/test_gem_util.rb +8 -6
- data/test/rubygems/test_gem_version.rb +4 -13
- data/test/rubygems/test_kernel.rb +6 -4
- data/test/rubygems/test_project_sanity.rb +1 -1
- data/test/rubygems/test_remote_fetch_error.rb +1 -1
- data/test/rubygems/test_require.rb +13 -13
- data/test/test_changelog_generator.rb +1 -2
- metadata +7 -3
|
@@ -11,9 +11,11 @@ module Bundler
|
|
|
11
11
|
def run
|
|
12
12
|
Bundler.settings.set_command_option_if_given :path, options[:path]
|
|
13
13
|
|
|
14
|
+
definition = Bundler.definition
|
|
15
|
+
definition.validate_runtime!
|
|
16
|
+
|
|
14
17
|
begin
|
|
15
|
-
definition
|
|
16
|
-
definition.validate_runtime!
|
|
18
|
+
definition.resolve_only_locally!
|
|
17
19
|
not_installed = definition.missing_specs
|
|
18
20
|
rescue GemNotFound, VersionConflict
|
|
19
21
|
Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
|
|
@@ -36,10 +36,15 @@ module Bundler
|
|
|
36
36
|
def self.without_groups_message(command)
|
|
37
37
|
command_in_past_tense = command == :install ? "installed" : "updated"
|
|
38
38
|
groups = Bundler.settings[:without]
|
|
39
|
+
"Gems in the #{verbalize_groups(groups)} were not #{command_in_past_tense}."
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.verbalize_groups(groups)
|
|
43
|
+
groups.map!{|g| "'#{g}'" }
|
|
39
44
|
group_list = [groups[0...-1].join(", "), groups[-1..-1]].
|
|
40
45
|
reject {|s| s.to_s.empty? }.join(" and ")
|
|
41
46
|
group_str = groups.size == 1 ? "group" : "groups"
|
|
42
|
-
"
|
|
47
|
+
"#{group_str} #{group_list}"
|
|
43
48
|
end
|
|
44
49
|
|
|
45
50
|
def self.select_spec(name, regex_match = nil)
|
|
@@ -53,7 +58,13 @@ module Bundler
|
|
|
53
58
|
|
|
54
59
|
case specs.count
|
|
55
60
|
when 0
|
|
56
|
-
|
|
61
|
+
dep_in_other_group = Bundler.definition.current_dependencies.find {|dep|dep.name == name }
|
|
62
|
+
|
|
63
|
+
if dep_in_other_group
|
|
64
|
+
raise GemNotFound, "Could not find gem '#{name}', because it's in the #{verbalize_groups(dep_in_other_group.groups)}, configured to be ignored."
|
|
65
|
+
else
|
|
66
|
+
raise GemNotFound, gem_not_found_message(name, Bundler.definition.dependencies)
|
|
67
|
+
end
|
|
57
68
|
when 1
|
|
58
69
|
specs.first
|
|
59
70
|
else
|
|
@@ -83,6 +94,8 @@ module Bundler
|
|
|
83
94
|
end
|
|
84
95
|
|
|
85
96
|
def self.ensure_all_gems_in_lockfile!(names, locked_gems = Bundler.locked_gems)
|
|
97
|
+
return unless locked_gems
|
|
98
|
+
|
|
86
99
|
locked_names = locked_gems.specs.map(&:name).uniq
|
|
87
100
|
names.-(locked_names).each do |g|
|
|
88
101
|
raise GemNotFound, gem_not_found_message(g, locked_names)
|
|
@@ -42,9 +42,17 @@ module Bundler
|
|
|
42
42
|
use_git = Bundler.git_present? && options[:git]
|
|
43
43
|
|
|
44
44
|
git_author_name = use_git ? `git config user.name`.chomp : ""
|
|
45
|
-
|
|
45
|
+
git_username = use_git ? `git config github.user`.chomp : ""
|
|
46
46
|
git_user_email = use_git ? `git config user.email`.chomp : ""
|
|
47
47
|
|
|
48
|
+
github_username = if options[:github_username].nil?
|
|
49
|
+
git_username
|
|
50
|
+
elsif options[:github_username] == false
|
|
51
|
+
""
|
|
52
|
+
else
|
|
53
|
+
options[:github_username]
|
|
54
|
+
end
|
|
55
|
+
|
|
48
56
|
config = {
|
|
49
57
|
:name => name,
|
|
50
58
|
:underscored_name => underscored_name,
|
|
@@ -72,7 +72,7 @@ module Bundler
|
|
|
72
72
|
gemfile_specs + dependency_specs
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
specs.sort_by(&:name).each do |current_spec|
|
|
75
|
+
specs.sort_by(&:name).uniq(&:name).each do |current_spec|
|
|
76
76
|
next unless gems.empty? || gems.include?(current_spec.name)
|
|
77
77
|
|
|
78
78
|
active_spec = retrieve_active_spec(definition, current_spec)
|
|
@@ -146,17 +146,16 @@ module Bundler
|
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
def retrieve_active_spec(definition, current_spec)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
else
|
|
152
|
-
active_specs = definition.find_indexed_specs(current_spec)
|
|
153
|
-
if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
|
|
154
|
-
active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
|
155
|
-
end
|
|
156
|
-
active_spec = active_specs.last
|
|
157
|
-
end
|
|
149
|
+
active_spec = definition.resolve.find_by_name_and_platform(current_spec.name, current_spec.platform)
|
|
150
|
+
return unless active_spec
|
|
158
151
|
|
|
159
|
-
active_spec
|
|
152
|
+
return active_spec if strict
|
|
153
|
+
|
|
154
|
+
active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
|
|
155
|
+
if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
|
|
156
|
+
active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
|
157
|
+
end
|
|
158
|
+
active_specs.last
|
|
160
159
|
end
|
|
161
160
|
|
|
162
161
|
def print_gems(gems_list)
|
|
@@ -50,16 +50,20 @@ module Bundler
|
|
|
50
50
|
|
|
51
51
|
content = response.body
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
etag = (response["ETag"] || "").gsub(%r{\AW/}, "")
|
|
54
|
+
correct_response = SharedHelpers.filesystem_access(local_temp_path) do
|
|
54
55
|
if response.is_a?(Net::HTTPPartialContent) && local_temp_path.size.nonzero?
|
|
55
56
|
local_temp_path.open("a") {|f| f << slice_body(content, 1..-1) }
|
|
57
|
+
|
|
58
|
+
etag_for(local_temp_path) == etag
|
|
56
59
|
else
|
|
57
60
|
local_temp_path.open("wb") {|f| f << content }
|
|
61
|
+
|
|
62
|
+
etag.length.zero? || etag_for(local_temp_path) == etag
|
|
58
63
|
end
|
|
59
64
|
end
|
|
60
65
|
|
|
61
|
-
|
|
62
|
-
if etag.length.zero? || etag_for(local_temp_path) == etag
|
|
66
|
+
if correct_response
|
|
63
67
|
SharedHelpers.filesystem_access(local_path) do
|
|
64
68
|
FileUtils.mv(local_temp_path, local_path)
|
|
65
69
|
end
|
|
@@ -92,11 +96,11 @@ module Bundler
|
|
|
92
96
|
|
|
93
97
|
def checksum_for_file(path)
|
|
94
98
|
return nil unless path.file?
|
|
95
|
-
# This must use
|
|
99
|
+
# This must use File.read instead of Digest.file().hexdigest
|
|
96
100
|
# because we need to preserve \n line endings on windows when calculating
|
|
97
101
|
# the checksum
|
|
98
102
|
SharedHelpers.filesystem_access(path, :read) do
|
|
99
|
-
SharedHelpers.digest(:MD5).hexdigest(
|
|
103
|
+
SharedHelpers.digest(:MD5).hexdigest(File.read(path))
|
|
100
104
|
end
|
|
101
105
|
end
|
|
102
106
|
end
|
|
@@ -160,17 +160,21 @@ module Bundler
|
|
|
160
160
|
@disable_multisource
|
|
161
161
|
end
|
|
162
162
|
|
|
163
|
+
def resolve_only_locally!
|
|
164
|
+
@remote = false
|
|
165
|
+
sources.local_only!
|
|
166
|
+
resolve
|
|
167
|
+
end
|
|
168
|
+
|
|
163
169
|
def resolve_with_cache!
|
|
164
|
-
raise "Specs already loaded" if @specs
|
|
165
170
|
sources.cached!
|
|
166
|
-
|
|
171
|
+
resolve
|
|
167
172
|
end
|
|
168
173
|
|
|
169
174
|
def resolve_remotely!
|
|
170
|
-
return if @specs
|
|
171
175
|
@remote = true
|
|
172
176
|
sources.remote!
|
|
173
|
-
|
|
177
|
+
resolve
|
|
174
178
|
end
|
|
175
179
|
|
|
176
180
|
# For given dependency list returns a SpecSet with Gemspec of all the required
|
|
@@ -187,10 +191,10 @@ module Bundler
|
|
|
187
191
|
gem_name, gem_version = extract_gem_info(e)
|
|
188
192
|
locked_gem = @locked_specs[gem_name].last
|
|
189
193
|
raise if locked_gem.nil? || locked_gem.version.to_s != gem_version || !@remote
|
|
190
|
-
raise GemNotFound, "Your bundle is locked to #{locked_gem}, but that version
|
|
191
|
-
"be found in
|
|
192
|
-
"
|
|
193
|
-
"
|
|
194
|
+
raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
|
|
195
|
+
"no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
|
|
196
|
+
"You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
|
|
197
|
+
"removed in order to install."
|
|
194
198
|
end
|
|
195
199
|
unless specs["bundler"].any?
|
|
196
200
|
bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
|
|
@@ -221,7 +225,6 @@ module Bundler
|
|
|
221
225
|
Bundler.ui.debug "The definition is missing #{missing.map(&:full_name)}"
|
|
222
226
|
true
|
|
223
227
|
rescue BundlerError => e
|
|
224
|
-
@index = nil
|
|
225
228
|
@resolve = nil
|
|
226
229
|
@specs = nil
|
|
227
230
|
@gem_version_promoter = nil
|
|
@@ -284,50 +287,6 @@ module Bundler
|
|
|
284
287
|
end
|
|
285
288
|
end
|
|
286
289
|
|
|
287
|
-
def index
|
|
288
|
-
@index ||= Index.build do |idx|
|
|
289
|
-
dependency_names = @dependencies.map(&:name)
|
|
290
|
-
|
|
291
|
-
sources.all_sources.each do |source|
|
|
292
|
-
source.dependency_names = dependency_names - pinned_spec_names(source)
|
|
293
|
-
idx.add_source source.specs
|
|
294
|
-
dependency_names.concat(source.unmet_deps).uniq!
|
|
295
|
-
end
|
|
296
|
-
|
|
297
|
-
double_check_for_index(idx, dependency_names)
|
|
298
|
-
end
|
|
299
|
-
end
|
|
300
|
-
|
|
301
|
-
# Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
|
|
302
|
-
# sources A and B. At this point, the API request will have found all the versions of Bar in source A,
|
|
303
|
-
# but will not have found any versions of Bar from source B, which is a problem if the requested version
|
|
304
|
-
# of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
|
|
305
|
-
# each spec we found, we add all possible versions from all sources to the index.
|
|
306
|
-
def double_check_for_index(idx, dependency_names)
|
|
307
|
-
pinned_names = pinned_spec_names
|
|
308
|
-
loop do
|
|
309
|
-
idxcount = idx.size
|
|
310
|
-
|
|
311
|
-
names = :names # do this so we only have to traverse to get dependency_names from the index once
|
|
312
|
-
unmet_dependency_names = lambda do
|
|
313
|
-
return names unless names == :names
|
|
314
|
-
new_names = sources.all_sources.map(&:dependency_names_to_double_check)
|
|
315
|
-
return names = nil if new_names.compact!
|
|
316
|
-
names = new_names.flatten(1).concat(dependency_names)
|
|
317
|
-
names.uniq!
|
|
318
|
-
names -= pinned_names
|
|
319
|
-
names
|
|
320
|
-
end
|
|
321
|
-
|
|
322
|
-
sources.all_sources.each do |source|
|
|
323
|
-
source.double_check_for(unmet_dependency_names)
|
|
324
|
-
end
|
|
325
|
-
|
|
326
|
-
break if idxcount == idx.size
|
|
327
|
-
end
|
|
328
|
-
end
|
|
329
|
-
private :double_check_for_index
|
|
330
|
-
|
|
331
290
|
def has_rubygems_remotes?
|
|
332
291
|
sources.rubygems_sources.any? {|s| s.remotes.any? }
|
|
333
292
|
end
|
|
@@ -534,14 +493,6 @@ module Bundler
|
|
|
534
493
|
end
|
|
535
494
|
end
|
|
536
495
|
|
|
537
|
-
def find_resolved_spec(current_spec)
|
|
538
|
-
specs.find_by_name_and_platform(current_spec.name, current_spec.platform)
|
|
539
|
-
end
|
|
540
|
-
|
|
541
|
-
def find_indexed_specs(current_spec)
|
|
542
|
-
index[current_spec.name].select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
|
|
543
|
-
end
|
|
544
|
-
|
|
545
496
|
attr_reader :sources
|
|
546
497
|
private :sources
|
|
547
498
|
|
|
@@ -558,6 +509,10 @@ module Bundler
|
|
|
558
509
|
|
|
559
510
|
private
|
|
560
511
|
|
|
512
|
+
def precompute_source_requirements_for_indirect_dependencies?
|
|
513
|
+
sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && sources.no_aggregate_global_source?
|
|
514
|
+
end
|
|
515
|
+
|
|
561
516
|
def current_ruby_platform_locked?
|
|
562
517
|
return false unless generic_local_platform == Gem::Platform::RUBY
|
|
563
518
|
|
|
@@ -683,9 +638,9 @@ module Bundler
|
|
|
683
638
|
changes = false
|
|
684
639
|
|
|
685
640
|
# If there is a RubyGems source in both
|
|
686
|
-
locked_gem_sources.each do |
|
|
641
|
+
locked_gem_sources.each do |locked_gem_source|
|
|
687
642
|
# Merge the remotes from the Gemfile into the Gemfile.lock
|
|
688
|
-
changes |=
|
|
643
|
+
changes |= locked_gem_source.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
|
|
689
644
|
end
|
|
690
645
|
|
|
691
646
|
changes
|
|
@@ -904,26 +859,22 @@ module Bundler
|
|
|
904
859
|
end
|
|
905
860
|
|
|
906
861
|
def source_requirements
|
|
907
|
-
# Load all specs from remote sources
|
|
908
|
-
index
|
|
909
|
-
|
|
910
862
|
# Record the specs available in each gem's source, so that those
|
|
911
863
|
# specs will be available later when the resolver knows where to
|
|
912
864
|
# look for that gemspec (or its dependencies)
|
|
913
|
-
source_requirements =
|
|
865
|
+
source_requirements = if precompute_source_requirements_for_indirect_dependencies?
|
|
866
|
+
{ :default => sources.default_source }.merge(source_map.all_requirements)
|
|
867
|
+
else
|
|
868
|
+
{ :default => Source::RubygemsAggregate.new(sources, source_map) }.merge(source_map.direct_requirements)
|
|
869
|
+
end
|
|
914
870
|
metadata_dependencies.each do |dep|
|
|
915
871
|
source_requirements[dep.name] = sources.metadata_source
|
|
916
872
|
end
|
|
917
|
-
source_requirements[:
|
|
918
|
-
source_requirements[:default_bundler] = source_requirements["bundler"] || source_requirements[:default]
|
|
873
|
+
source_requirements[:default_bundler] = source_requirements["bundler"] || sources.default_source
|
|
919
874
|
source_requirements["bundler"] = sources.metadata_source # needs to come last to override
|
|
920
875
|
source_requirements
|
|
921
876
|
end
|
|
922
877
|
|
|
923
|
-
def pinned_spec_names(skip = nil)
|
|
924
|
-
dependency_source_requirements.reject {|_, source| source == skip }.keys
|
|
925
|
-
end
|
|
926
|
-
|
|
927
878
|
def requested_groups
|
|
928
879
|
groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
|
|
929
880
|
end
|
|
@@ -959,7 +910,7 @@ module Bundler
|
|
|
959
910
|
end
|
|
960
911
|
|
|
961
912
|
def additional_base_requirements_for_resolve
|
|
962
|
-
return [] unless @locked_gems
|
|
913
|
+
return [] unless @locked_gems
|
|
963
914
|
dependencies_by_name = dependencies.inject({}) {|memo, dep| memo.update(dep.name => dep) }
|
|
964
915
|
@locked_gems.specs.reduce({}) do |requirements, locked_spec|
|
|
965
916
|
name = locked_spec.name
|
|
@@ -979,16 +930,8 @@ module Bundler
|
|
|
979
930
|
Bundler.settings[:allow_deployment_source_credential_changes] && source.equivalent_remotes?(sources.rubygems_remotes)
|
|
980
931
|
end
|
|
981
932
|
|
|
982
|
-
def
|
|
983
|
-
@
|
|
984
|
-
source_requirements = {}
|
|
985
|
-
default = sources.default_source
|
|
986
|
-
dependencies.each do |dep|
|
|
987
|
-
dep_source = dep.source || default
|
|
988
|
-
source_requirements[dep.name] = dep_source
|
|
989
|
-
end
|
|
990
|
-
source_requirements
|
|
991
|
-
end
|
|
933
|
+
def source_map
|
|
934
|
+
@source_map ||= SourceMap.new(sources, dependencies)
|
|
992
935
|
end
|
|
993
936
|
end
|
|
994
937
|
end
|
|
@@ -32,10 +32,8 @@ module Bundler
|
|
|
32
32
|
settings_flag(:cache_all) { bundler_3_mode? }
|
|
33
33
|
settings_flag(:default_install_uses_path) { bundler_3_mode? }
|
|
34
34
|
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
|
|
35
|
-
settings_flag(:disable_multisource) { bundler_3_mode? }
|
|
36
35
|
settings_flag(:forget_cli_options) { bundler_3_mode? }
|
|
37
36
|
settings_flag(:global_gem_cache) { bundler_3_mode? }
|
|
38
|
-
settings_flag(:only_update_to_newer_versions) { bundler_3_mode? }
|
|
39
37
|
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
|
|
40
38
|
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
|
|
41
39
|
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
|
@@ -47,7 +47,8 @@ module Bundler
|
|
|
47
47
|
remote_uri = filter_uri(remote_uri)
|
|
48
48
|
super "Authentication is required for #{remote_uri}.\n" \
|
|
49
49
|
"Please supply credentials for this source. You can do this by running:\n" \
|
|
50
|
-
"
|
|
50
|
+
"`bundle config set --global #{remote_uri} username:password`\n" \
|
|
51
|
+
"or by storing the credentials in the `#{Settings.key_for(remote_uri)}` environment variable"
|
|
51
52
|
end
|
|
52
53
|
end
|
|
53
54
|
# This error is raised if HTTP authentication is provided, but incorrect.
|
|
@@ -14,8 +14,10 @@ module Bundler
|
|
|
14
14
|
def fetch(uri, headers = {}, counter = 0)
|
|
15
15
|
raise HTTPError, "Too many redirects" if counter >= redirect_limit
|
|
16
16
|
|
|
17
|
+
filtered_uri = URICredentialsFilter.credential_filtered_uri(uri)
|
|
18
|
+
|
|
17
19
|
response = request(uri, headers)
|
|
18
|
-
Bundler.ui.debug("HTTP #{response.code} #{response.message} #{
|
|
20
|
+
Bundler.ui.debug("HTTP #{response.code} #{response.message} #{filtered_uri}")
|
|
19
21
|
|
|
20
22
|
case response
|
|
21
23
|
when Net::HTTPSuccess, Net::HTTPNotModified
|
|
@@ -40,7 +42,7 @@ module Bundler
|
|
|
40
42
|
raise BadAuthenticationError, uri.host if uri.userinfo
|
|
41
43
|
raise AuthenticationRequiredError, uri.host
|
|
42
44
|
when Net::HTTPNotFound
|
|
43
|
-
raise FallbackError, "Net::HTTPNotFound: #{
|
|
45
|
+
raise FallbackError, "Net::HTTPNotFound: #{filtered_uri}"
|
|
44
46
|
else
|
|
45
47
|
raise HTTPError, "#{response.class}#{": #{response.body}" unless response.body.empty?}"
|
|
46
48
|
end
|
|
@@ -49,7 +51,9 @@ module Bundler
|
|
|
49
51
|
def request(uri, headers)
|
|
50
52
|
validate_uri_scheme!(uri)
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
filtered_uri = URICredentialsFilter.credential_filtered_uri(uri)
|
|
55
|
+
|
|
56
|
+
Bundler.ui.debug "HTTP GET #{filtered_uri}"
|
|
53
57
|
req = Net::HTTP::Get.new uri.request_uri, headers
|
|
54
58
|
if uri.user
|
|
55
59
|
user = CGI.unescape(uri.user)
|
|
@@ -69,7 +73,7 @@ module Bundler
|
|
|
69
73
|
raise NetworkDownError, "Could not reach host #{uri.host}. Check your network " \
|
|
70
74
|
"connection and try again."
|
|
71
75
|
else
|
|
72
|
-
raise HTTPError, "Network error while fetching #{
|
|
76
|
+
raise HTTPError, "Network error while fetching #{filtered_uri}" \
|
|
73
77
|
" (#{e})"
|
|
74
78
|
end
|
|
75
79
|
end
|
|
@@ -49,8 +49,6 @@ module Bundler
|
|
|
49
49
|
"Alternatively, you can increase the amount of memory the JVM is able to use by running Bundler with jruby -J-Xmx1024m -S bundle (JRuby defaults to 500MB)."
|
|
50
50
|
else request_issue_report_for(error)
|
|
51
51
|
end
|
|
52
|
-
rescue StandardError
|
|
53
|
-
raise error
|
|
54
52
|
end
|
|
55
53
|
|
|
56
54
|
def exit_status(error)
|
|
@@ -111,8 +109,8 @@ module Bundler
|
|
|
111
109
|
First, try this link to see if there are any existing issue reports for this error:
|
|
112
110
|
#{issues_url(e)}
|
|
113
111
|
|
|
114
|
-
If there aren't any reports for this error yet, please
|
|
115
|
-
https://github.com/rubygems/rubygems/issues/new?labels=Bundler
|
|
112
|
+
If there aren't any reports for this error yet, please copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
|
|
113
|
+
https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md
|
|
116
114
|
EOS
|
|
117
115
|
end
|
|
118
116
|
|