rubygems-update 3.2.0.rc.2 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +54 -51
- data/Manifest.txt +32 -29
- data/Rakefile +3 -1
- data/bundler/CHANGELOG.md +35 -1
- data/bundler/UPGRADING.md +1 -1
- data/bundler/lib/bundler.rb +4 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli.rb +5 -2
- data/bundler/lib/bundler/cli/binstubs.rb +6 -2
- data/bundler/lib/bundler/cli/exec.rb +3 -3
- data/bundler/lib/bundler/cli/outdated.rb +2 -4
- data/bundler/lib/bundler/compact_index_client/updater.rb +5 -5
- data/bundler/lib/bundler/definition.rb +4 -9
- data/bundler/lib/bundler/env.rb +1 -1
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/fetcher/index.rb +2 -3
- data/bundler/lib/bundler/friendly_errors.rb +15 -0
- data/bundler/lib/bundler/index.rb +5 -1
- data/bundler/lib/bundler/injector.rb +9 -2
- data/bundler/lib/bundler/installer.rb +7 -5
- data/bundler/lib/bundler/lazy_specification.rb +5 -7
- data/bundler/lib/bundler/man/.document +1 -0
- data/bundler/{man → lib/bundler/man}/bundle-add.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-binstubs.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-cache.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-check.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-clean.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-config.1.ronn +1 -9
- data/bundler/{man → lib/bundler/man}/bundle-doctor.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-exec.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-gem.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-info.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-init.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-inject.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-install.1.ronn +1 -1
- data/bundler/{man → lib/bundler/man}/bundle-list.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-lock.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-open.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-outdated.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-platform.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-pristine.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-remove.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-show.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-update.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle-viz.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/bundle.1.ronn +0 -0
- data/bundler/{man → lib/bundler/man}/gemfile.5.ronn +0 -0
- data/bundler/lib/bundler/plugin/api/source.rb +1 -1
- data/bundler/lib/bundler/plugin/dsl.rb +1 -1
- data/bundler/lib/bundler/resolver.rb +2 -3
- data/bundler/lib/bundler/rubygems_integration.rb +4 -0
- data/bundler/lib/bundler/settings.rb +0 -1
- data/bundler/lib/bundler/source/git/git_proxy.rb +1 -1
- data/bundler/lib/bundler/spec_set.rb +1 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +0 -1
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -2
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -0
- data/bundler/lib/bundler/uri_credentials_filter.rb +2 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +38 -40
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +4 -7
- data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/bundler/lib/bundler/vendored_tmpdir.rb +4 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/man/bundle-add.1 +1 -1
- data/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/man/bundle-cache.1 +1 -1
- data/bundler/man/bundle-check.1 +1 -1
- data/bundler/man/bundle-clean.1 +1 -1
- data/bundler/man/bundle-config.1 +2 -5
- data/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/man/bundle-exec.1 +1 -1
- data/bundler/man/bundle-gem.1 +1 -1
- data/bundler/man/bundle-info.1 +1 -1
- data/bundler/man/bundle-init.1 +1 -1
- data/bundler/man/bundle-inject.1 +1 -1
- data/bundler/man/bundle-install.1 +2 -2
- data/bundler/man/bundle-list.1 +1 -1
- data/bundler/man/bundle-lock.1 +1 -1
- data/bundler/man/bundle-open.1 +1 -1
- data/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/man/bundle-platform.1 +1 -1
- data/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/man/bundle-remove.1 +1 -1
- data/bundler/man/bundle-show.1 +1 -1
- data/bundler/man/bundle-update.1 +1 -1
- data/bundler/man/bundle-viz.1 +1 -1
- data/bundler/man/bundle.1 +1 -1
- data/bundler/man/gemfile.5 +1 -1
- data/bundler/man/index.txt +25 -0
- data/lib/rubygems.rb +6 -2
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/command_manager.rb +2 -2
- data/lib/rubygems/commands/build_command.rb +37 -20
- data/lib/rubygems/commands/cert_command.rb +1 -1
- data/lib/rubygems/commands/help_command.rb +2 -0
- data/lib/rubygems/commands/owner_command.rb +10 -2
- data/lib/rubygems/commands/pristine_command.rb +1 -1
- data/lib/rubygems/commands/push_command.rb +7 -3
- data/lib/rubygems/commands/query_command.rb +17 -0
- data/lib/rubygems/commands/server_command.rb +4 -0
- data/lib/rubygems/commands/setup_command.rb +25 -45
- data/lib/rubygems/commands/sources_command.rb +6 -2
- data/lib/rubygems/commands/specification_command.rb +6 -0
- data/lib/rubygems/commands/yank_command.rb +4 -4
- data/lib/rubygems/core_ext/kernel_require.rb +3 -0
- data/lib/rubygems/core_ext/kernel_warn.rb +6 -7
- data/lib/rubygems/defaults.rb +2 -2
- data/lib/rubygems/dependency.rb +1 -1
- data/lib/rubygems/dependency_installer.rb +4 -3
- data/lib/rubygems/ext/builder.rb +13 -32
- data/lib/rubygems/ext/cmake_builder.rb +4 -4
- data/lib/rubygems/ext/configure_builder.rb +4 -4
- data/lib/rubygems/ext/ext_conf_builder.rb +19 -14
- data/lib/rubygems/ext/rake_builder.rb +3 -3
- data/lib/rubygems/gemcutter_utilities.rb +90 -14
- data/lib/rubygems/indexer.rb +0 -1
- data/lib/rubygems/install_update_options.rb +2 -2
- data/lib/rubygems/installer.rb +12 -9
- data/lib/rubygems/installer_test_case.rb +7 -6
- data/lib/rubygems/name_tuple.rb +1 -1
- data/lib/rubygems/openssl.rb +4 -4
- data/lib/rubygems/package.rb +3 -2
- data/lib/rubygems/package/tar_header.rb +1 -1
- data/lib/rubygems/package/tar_test_case.rb +1 -1
- data/lib/rubygems/platform.rb +18 -7
- data/lib/rubygems/query_utils.rb +0 -9
- data/lib/rubygems/remote_fetcher.rb +1 -2
- data/lib/rubygems/request.rb +4 -3
- data/lib/rubygems/request_set/gem_dependency_api.rb +4 -4
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver.rb +1 -1
- data/lib/rubygems/resolver/activation_request.rb +9 -1
- data/lib/rubygems/resolver/api_specification.rb +5 -1
- data/lib/rubygems/resolver/conflict.rb +1 -1
- data/lib/rubygems/resolver/dependency_request.rb +1 -1
- data/lib/rubygems/resolver/index_specification.rb +11 -0
- data/lib/rubygems/resolver/installer_set.rb +1 -2
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +6 -5
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +39 -5
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +7 -6
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +4 -3
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +43 -10
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +75 -7
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +506 -165
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -2
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +8 -4
- data/lib/rubygems/resolver/specification.rb +1 -1
- data/lib/rubygems/s3_uri_signer.rb +1 -1
- data/lib/rubygems/security.rb +1 -2
- data/lib/rubygems/security/policy.rb +1 -1
- data/lib/rubygems/security/signer.rb +1 -1
- data/lib/rubygems/server.rb +1 -1
- data/lib/rubygems/source.rb +10 -4
- data/lib/rubygems/spec_fetcher.rb +1 -1
- data/lib/rubygems/specification.rb +8 -8
- data/lib/rubygems/ssl_certs/{index.rubygems.org → rubygems.org}/GlobalSignRootCA.pem +0 -0
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
- data/lib/rubygems/stub_specification.rb +1 -1
- data/lib/rubygems/test_case.rb +13 -26
- data/lib/rubygems/uri_formatter.rb +2 -1
- data/lib/rubygems/version_option.rb +6 -0
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/test_bundled_ca.rb +9 -5
- data/test/rubygems/test_gem.rb +3 -3
- data/test/rubygems/test_gem_commands_build_command.rb +197 -5
- data/test/rubygems/test_gem_commands_cert_command.rb +2 -2
- data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +2 -2
- data/test/rubygems/test_gem_commands_help_command.rb +15 -2
- data/test/rubygems/test_gem_commands_install_command.rb +1 -1
- data/test/rubygems/test_gem_commands_owner_command.rb +49 -1
- data/test/rubygems/test_gem_commands_pristine_command.rb +2 -2
- data/test/rubygems/test_gem_commands_push_command.rb +31 -5
- data/test/rubygems/test_gem_commands_query_command.rb +3 -3
- data/test/rubygems/test_gem_commands_setup_command.rb +13 -18
- data/test/rubygems/test_gem_commands_signin_command.rb +27 -3
- data/test/rubygems/test_gem_commands_sources_command.rb +60 -0
- data/test/rubygems/test_gem_commands_specification_command.rb +28 -0
- data/test/rubygems/test_gem_commands_update_command.rb +2 -2
- data/test/rubygems/test_gem_commands_yank_command.rb +31 -1
- data/test/rubygems/test_gem_dependency_installer.rb +36 -2
- data/test/rubygems/test_gem_dependency_list.rb +2 -2
- data/test/rubygems/test_gem_ext_builder.rb +10 -14
- data/test/rubygems/test_gem_ext_cmake_builder.rb +3 -9
- data/test/rubygems/test_gem_ext_configure_builder.rb +3 -9
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +9 -26
- data/test/rubygems/test_gem_ext_rake_builder.rb +5 -13
- data/test/rubygems/test_gem_gem_runner.rb +5 -4
- data/test/rubygems/test_gem_gemcutter_utilities.rb +3 -3
- data/test/rubygems/test_gem_install_update_options.rb +15 -3
- data/test/rubygems/test_gem_installer.rb +74 -11
- data/test/rubygems/test_gem_package.rb +8 -8
- data/test/rubygems/test_gem_package_old.rb +4 -4
- data/test/rubygems/test_gem_package_tar_writer.rb +1 -1
- data/test/rubygems/test_gem_platform.rb +63 -4
- data/test/rubygems/test_gem_remote_fetcher.rb +14 -18
- data/test/rubygems/test_gem_request.rb +2 -2
- data/test/rubygems/test_gem_request_set_lockfile.rb +4 -4
- data/test/rubygems/test_gem_resolver_api_set.rb +8 -8
- data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
- data/test/rubygems/test_gem_resolver_vendor_set.rb +1 -1
- data/test/rubygems/test_gem_security.rb +2 -2
- data/test/rubygems/test_gem_security_policy.rb +2 -2
- data/test/rubygems/test_gem_security_signer.rb +2 -2
- data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
- data/test/rubygems/test_gem_source.rb +5 -0
- data/test/rubygems/test_gem_source_subpath_problem.rb +49 -0
- data/test/rubygems/test_gem_specification.rb +5 -4
- data/test/rubygems/test_gem_uninstaller.rb +7 -7
- data/test/rubygems/test_gem_validator.rb +1 -1
- data/test/rubygems/test_gem_version_option.rb +1 -1
- data/test/rubygems/test_require.rb +50 -9
- metadata +35 -32
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
@@ -76,8 +76,6 @@ module Bundler
|
|
76
76
|
next unless gems.empty? || gems.include?(current_spec.name)
|
77
77
|
|
78
78
|
active_spec = retrieve_active_spec(definition, current_spec)
|
79
|
-
next unless active_spec
|
80
|
-
|
81
79
|
next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options)
|
82
80
|
|
83
81
|
gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
|
@@ -146,8 +144,6 @@ module Bundler
|
|
146
144
|
end
|
147
145
|
|
148
146
|
def retrieve_active_spec(definition, current_spec)
|
149
|
-
return unless current_spec.match_platform(Bundler.local_platform)
|
150
|
-
|
151
147
|
if strict
|
152
148
|
active_spec = definition.find_resolved_spec(current_spec)
|
153
149
|
else
|
@@ -233,6 +229,8 @@ module Bundler
|
|
233
229
|
end
|
234
230
|
|
235
231
|
def update_present_via_semver_portions(current_spec, active_spec, options)
|
232
|
+
return false if active_spec.nil?
|
233
|
+
|
236
234
|
current_major = current_spec.version.segments.first
|
237
235
|
active_major = active_spec.version.segments.first
|
238
236
|
|
@@ -22,13 +22,13 @@ module Bundler
|
|
22
22
|
|
23
23
|
def initialize(fetcher)
|
24
24
|
@fetcher = fetcher
|
25
|
-
|
25
|
+
require_relative "../vendored_tmpdir"
|
26
26
|
end
|
27
27
|
|
28
28
|
def update(local_path, remote_path, retrying = nil)
|
29
29
|
headers = {}
|
30
30
|
|
31
|
-
Dir.mktmpdir("bundler-compact-index-") do |local_temp_dir|
|
31
|
+
Bundler::Dir.mktmpdir("bundler-compact-index-") do |local_temp_dir|
|
32
32
|
local_temp_path = Pathname.new(local_temp_dir).join(local_path.basename)
|
33
33
|
|
34
34
|
# first try to fetch any new bytes on the existing file
|
@@ -66,8 +66,8 @@ module Bundler
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
|
70
|
-
if etag_for(local_temp_path) ==
|
69
|
+
etag = (response["ETag"] || "").gsub(%r{\AW/}, "")
|
70
|
+
if etag.length.zero? || etag_for(local_temp_path) == etag
|
71
71
|
SharedHelpers.filesystem_access(local_path) do
|
72
72
|
FileUtils.mv(local_temp_path, local_path)
|
73
73
|
end
|
@@ -75,7 +75,7 @@ module Bundler
|
|
75
75
|
end
|
76
76
|
|
77
77
|
if retrying
|
78
|
-
raise MisMatchedChecksumError.new(remote_path,
|
78
|
+
raise MisMatchedChecksumError.new(remote_path, etag, etag_for(local_temp_path))
|
79
79
|
end
|
80
80
|
|
81
81
|
update(local_path, remote_path, :retrying)
|
@@ -118,7 +118,7 @@ module Bundler
|
|
118
118
|
end
|
119
119
|
@unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
|
120
120
|
|
121
|
-
|
121
|
+
add_current_platform unless Bundler.frozen_bundle?
|
122
122
|
|
123
123
|
converge_path_sources_to_gemspec_sources
|
124
124
|
@path_changes = converge_paths
|
@@ -547,17 +547,12 @@ module Bundler
|
|
547
547
|
|
548
548
|
private
|
549
549
|
|
550
|
-
def
|
551
|
-
|
552
|
-
add_platform(platform)
|
553
|
-
end
|
550
|
+
def add_current_platform
|
551
|
+
current_platforms.each {|platform| add_platform(platform) }
|
554
552
|
end
|
555
553
|
|
556
554
|
def current_platforms
|
557
|
-
[].
|
558
|
-
platforms << local_platform if Bundler.feature_flag.specific_platform?
|
559
|
-
platforms << generic_local_platform
|
560
|
-
end
|
555
|
+
[local_platform, generic_local_platform].uniq
|
561
556
|
end
|
562
557
|
|
563
558
|
def change_reason
|
data/bundler/lib/bundler/env.rb
CHANGED
@@ -105,7 +105,7 @@ module Bundler
|
|
105
105
|
out << [" User Home", Gem.user_home]
|
106
106
|
out << [" User Path", Gem.user_dir]
|
107
107
|
out << [" Bin Dir", Gem.bindir]
|
108
|
-
if defined?(OpenSSL)
|
108
|
+
if defined?(OpenSSL::SSL)
|
109
109
|
out << ["OpenSSL"]
|
110
110
|
out << [" Compiled", OpenSSL::OPENSSL_VERSION] if defined?(OpenSSL::OPENSSL_VERSION)
|
111
111
|
out << [" Loaded", OpenSSL::OPENSSL_LIBRARY_VERSION] if defined?(OpenSSL::OPENSSL_LIBRARY_VERSION)
|
@@ -41,7 +41,6 @@ module Bundler
|
|
41
41
|
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
|
42
42
|
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
43
43
|
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
44
|
-
settings_flag(:specific_platform) { bundler_3_mode? }
|
45
44
|
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
46
45
|
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
|
47
46
|
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
@@ -8,7 +8,7 @@ module Bundler
|
|
8
8
|
class Index < Base
|
9
9
|
def specs(_gem_names)
|
10
10
|
Bundler.rubygems.fetch_all_remote_specs(remote)
|
11
|
-
rescue Gem::RemoteFetcher::FetchError
|
11
|
+
rescue Gem::RemoteFetcher::FetchError => e
|
12
12
|
case e.message
|
13
13
|
when /certificate verify failed/
|
14
14
|
raise CertificateFailureError.new(display_uri)
|
@@ -19,8 +19,7 @@ module Bundler
|
|
19
19
|
raise BadAuthenticationError, remote_uri if remote_uri.userinfo
|
20
20
|
raise AuthenticationRequiredError, remote_uri
|
21
21
|
else
|
22
|
-
|
23
|
-
raise HTTPError, "Could not fetch specs from #{display_uri}"
|
22
|
+
raise HTTPError, "Could not fetch specs from #{display_uri} due to underlying error <#{e.message}>"
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
@@ -6,6 +6,18 @@ module Bundler
|
|
6
6
|
module FriendlyErrors
|
7
7
|
module_function
|
8
8
|
|
9
|
+
def enable!
|
10
|
+
@disabled = false
|
11
|
+
end
|
12
|
+
|
13
|
+
def disabled?
|
14
|
+
@disabled
|
15
|
+
end
|
16
|
+
|
17
|
+
def disable!
|
18
|
+
@disabled = true
|
19
|
+
end
|
20
|
+
|
9
21
|
def log_error(error)
|
10
22
|
case error
|
11
23
|
when YamlSyntaxError
|
@@ -114,10 +126,13 @@ module Bundler
|
|
114
126
|
end
|
115
127
|
|
116
128
|
def self.with_friendly_errors
|
129
|
+
FriendlyErrors.enable!
|
117
130
|
yield
|
118
131
|
rescue SignalException
|
119
132
|
raise
|
120
133
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
134
|
+
raise if FriendlyErrors.disabled?
|
135
|
+
|
121
136
|
FriendlyErrors.log_error(e)
|
122
137
|
exit FriendlyErrors.exit_status(e)
|
123
138
|
end
|
@@ -195,7 +195,11 @@ module Bundler
|
|
195
195
|
if base # allow all platforms when searching from a lockfile
|
196
196
|
dependency.matches_spec?(spec)
|
197
197
|
else
|
198
|
-
|
198
|
+
if Gem::Platform.respond_to? :match_spec?
|
199
|
+
dependency.matches_spec?(spec) && Gem::Platform.match_spec?(spec)
|
200
|
+
else
|
201
|
+
dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform)
|
202
|
+
end
|
199
203
|
end
|
200
204
|
end
|
201
205
|
|
@@ -179,11 +179,11 @@ module Bundler
|
|
179
179
|
# @param [Pathname] gemfile_path The Gemfile from which to remove dependencies.
|
180
180
|
def remove_gems_from_gemfile(gems, gemfile_path)
|
181
181
|
patterns = /gem\s+(['"])#{Regexp.union(gems)}\1|gem\s*\((['"])#{Regexp.union(gems)}\2\)/
|
182
|
-
|
183
182
|
new_gemfile = []
|
184
183
|
multiline_removal = false
|
185
184
|
IO.readlines(gemfile_path).each do |line|
|
186
|
-
|
185
|
+
match_data = line.match(patterns)
|
186
|
+
if match_data && is_not_within_comment?(line, match_data)
|
187
187
|
multiline_removal = line.rstrip.end_with?(",")
|
188
188
|
# skip lines which match the regex
|
189
189
|
next
|
@@ -207,6 +207,13 @@ module Bundler
|
|
207
207
|
new_gemfile.join.chomp
|
208
208
|
end
|
209
209
|
|
210
|
+
# @param [String] line Individual line of gemfile content.
|
211
|
+
# @param [MatchData] match_data Data about Regex match.
|
212
|
+
def is_not_within_comment?(line, match_data)
|
213
|
+
match_start_index = match_data.offset(0).first
|
214
|
+
!line[0..match_start_index].include?("#")
|
215
|
+
end
|
216
|
+
|
210
217
|
# @param [Array] gemfile Array of gemfile contents.
|
211
218
|
# @param [String] block_name Name of block name to look for.
|
212
219
|
def remove_nested_blocks(gemfile, block_name)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "erb"
|
4
3
|
require "rubygems/dependency_installer"
|
5
4
|
require_relative "worker"
|
6
5
|
require_relative "installer/parallel_installer"
|
@@ -136,6 +135,7 @@ module Bundler
|
|
136
135
|
end
|
137
136
|
|
138
137
|
mode = Bundler::WINDOWS ? "wb:UTF-8" : "w"
|
138
|
+
require "erb"
|
139
139
|
content = if RUBY_VERSION >= "2.6"
|
140
140
|
ERB.new(template, :trim_mode => "-").result(binding)
|
141
141
|
else
|
@@ -143,7 +143,7 @@ module Bundler
|
|
143
143
|
end
|
144
144
|
|
145
145
|
File.write(binstub_path, content, :mode => mode, :perm => 0o777 & ~File.umask)
|
146
|
-
if Bundler::WINDOWS
|
146
|
+
if Bundler::WINDOWS || options[:all_platforms]
|
147
147
|
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
148
148
|
File.write("#{binstub_path}.cmd", prefix + content, :mode => mode)
|
149
149
|
end
|
@@ -164,7 +164,7 @@ module Bundler
|
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
167
|
-
def generate_standalone_bundler_executable_stubs(spec)
|
167
|
+
def generate_standalone_bundler_executable_stubs(spec, options = {})
|
168
168
|
# double-assignment to avoid warnings about variables that will be used by ERB
|
169
169
|
bin_path = Bundler.bin_path
|
170
170
|
unless path = Bundler.settings[:path]
|
@@ -182,6 +182,7 @@ module Bundler
|
|
182
182
|
executable_path = executable_path
|
183
183
|
|
184
184
|
mode = Bundler::WINDOWS ? "wb:UTF-8" : "w"
|
185
|
+
require "erb"
|
185
186
|
content = if RUBY_VERSION >= "2.6"
|
186
187
|
ERB.new(template, :trim_mode => "-").result(binding)
|
187
188
|
else
|
@@ -189,7 +190,7 @@ module Bundler
|
|
189
190
|
end
|
190
191
|
|
191
192
|
File.write("#{bin_path}/#{executable}", content, :mode => mode, :perm => 0o755)
|
192
|
-
if Bundler::WINDOWS
|
193
|
+
if Bundler::WINDOWS || options[:all_platforms]
|
193
194
|
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
194
195
|
File.write("#{bin_path}/#{executable}.cmd", prefix + content, :mode => mode)
|
195
196
|
end
|
@@ -243,6 +244,7 @@ module Bundler
|
|
243
244
|
end
|
244
245
|
end.flatten
|
245
246
|
Bundler.rubygems.load_plugin_files(path_plugin_files)
|
247
|
+
Bundler.rubygems.load_env_plugins
|
246
248
|
end
|
247
249
|
|
248
250
|
def ensure_specs_are_compatible!
|
@@ -297,7 +299,7 @@ module Bundler
|
|
297
299
|
|
298
300
|
# returns whether or not a re-resolve was needed
|
299
301
|
def resolve_if_needed(options)
|
300
|
-
if !@definition.unlocking? && !options["force"] && !
|
302
|
+
if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
|
301
303
|
return false if @definition.nothing_changed? && !@definition.missing_specs?
|
302
304
|
end
|
303
305
|
|
@@ -79,19 +79,17 @@ module Bundler
|
|
79
79
|
@specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
|
80
80
|
source.gemspec.tap {|s| s.source = source }
|
81
81
|
else
|
82
|
-
search_object =
|
82
|
+
search_object = if source.is_a?(Source::Path)
|
83
|
+
Dependency.new(name, version)
|
84
|
+
else
|
85
|
+
self
|
86
|
+
end
|
83
87
|
platform_object = Gem::Platform.new(platform)
|
84
88
|
candidates = source.specs.search(search_object)
|
85
89
|
same_platform_candidates = candidates.select do |spec|
|
86
90
|
MatchPlatform.platforms_match?(spec.platform, platform_object)
|
87
91
|
end
|
88
92
|
search = same_platform_candidates.last || candidates.last
|
89
|
-
if search && Gem::Platform.new(search.platform) != platform_object && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
|
90
|
-
Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
|
91
|
-
"because it has different dependencies from the #{platform} version. " \
|
92
|
-
"To use the platform-specific version of the gem, run `bundle config set --local specific_platform true` and install again."
|
93
|
-
search = source.specs.search(self).last
|
94
|
-
end
|
95
93
|
search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
|
96
94
|
search
|
97
95
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
# Ignore all files in this directory
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -250,14 +250,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
|
|
250
250
|
be changed in the next major version.
|
251
251
|
* `silence_root_warning` (`BUNDLE_SILENCE_ROOT_WARNING`):
|
252
252
|
Silence the warning Bundler prints when installing gems as root.
|
253
|
-
* `specific_platform` (`BUNDLE_SPECIFIC_PLATFORM`):
|
254
|
-
Allow bundler to resolve for the specific running platform and store it in
|
255
|
-
the lockfile, instead of only using a generic platform.
|
256
|
-
A specific platform is the exact platform triple reported by
|
257
|
-
`Gem::Platform.local`, such as `x86_64-darwin-16` or `universal-java-1.8`.
|
258
|
-
On the other hand, generic platforms are those such as `ruby`, `mswin`, or
|
259
|
-
`java`. In this example, `x86_64-darwin-16` would map to `ruby` and
|
260
|
-
`universal-java-1.8` to `java`.
|
261
253
|
* `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
|
262
254
|
Path to a designated CA certificate file or folder containing multiple
|
263
255
|
certificates for trusted CAs in PEM format.
|
@@ -371,7 +363,7 @@ Or you can set the credentials as an environment variable like this:
|
|
371
363
|
|
372
364
|
For gems with a git source with HTTP(S) URL you can specify credentials like so:
|
373
365
|
|
374
|
-
bundle config set --global https://github.com/
|
366
|
+
bundle config set --global https://github.com/rubygems/rubygems.git username:password
|
375
367
|
|
376
368
|
Or you can set the credentials as an environment variable like so:
|
377
369
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -105,7 +105,7 @@ automatically and that requires `bundler` to silently remember them. Since
|
|
105
105
|
|
106
106
|
* `--local`:
|
107
107
|
Do not attempt to connect to `rubygems.org`. Instead, Bundler will use the
|
108
|
-
gems already present in Rubygems' cache or in `vendor/cache`. Note that if
|
108
|
+
gems already present in Rubygems' cache or in `vendor/cache`. Note that if an
|
109
109
|
appropriate platform-specific gem exists on `rubygems.org` it will not be
|
110
110
|
found.
|
111
111
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -10,7 +10,7 @@ module Bundler
|
|
10
10
|
# So that we don't have to override all there methods to dummy ones
|
11
11
|
# explicitly.
|
12
12
|
# They will be handled by method_missing
|
13
|
-
[:gemspec, :gem, :
|
13
|
+
[:gemspec, :gem, :install_if, :platforms, :env].each {|m| undef_method m }
|
14
14
|
|
15
15
|
# This lists the plugins that was added automatically and not specified by
|
16
16
|
# the user.
|
@@ -158,9 +158,8 @@ module Bundler
|
|
158
158
|
# spec group.
|
159
159
|
sg_ruby = sg.copy_for(Gem::Platform::RUBY)
|
160
160
|
selected_sgs << sg_ruby if sg_ruby
|
161
|
-
all_platforms = @platforms + [platform]
|
162
|
-
next if all_platforms.to_a == [Gem::Platform::RUBY]
|
163
161
|
sg_all_platforms = nil
|
162
|
+
all_platforms = @platforms + [platform]
|
164
163
|
self.class.sort_platforms(all_platforms).reverse_each do |other_platform|
|
165
164
|
if sg_all_platforms.nil?
|
166
165
|
sg_all_platforms = sg.copy_for(other_platform)
|
@@ -302,7 +301,7 @@ module Bundler
|
|
302
301
|
versions_with_platforms = specs.map {|s| [s.version, s.platform] }
|
303
302
|
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
|
304
303
|
message << if versions_with_platforms.any?
|
305
|
-
"The source contains '#{name}'
|
304
|
+
"The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}"
|
306
305
|
else
|
307
306
|
"The source does not contain any versions of '#{name}'"
|
308
307
|
end
|
@@ -227,6 +227,10 @@ module Bundler
|
|
227
227
|
Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files)
|
228
228
|
end
|
229
229
|
|
230
|
+
def load_env_plugins
|
231
|
+
Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
|
232
|
+
end
|
233
|
+
|
230
234
|
def ui=(obj)
|
231
235
|
Gem::DefaultUserInteraction.ui = obj
|
232
236
|
end
|
@@ -118,7 +118,7 @@ module Bundler
|
|
118
118
|
git_retry %(clone --no-checkout --quiet "#{path}" "#{destination}")
|
119
119
|
File.chmod(((File.stat(destination).mode | 0o777) & ~File.umask), destination)
|
120
120
|
rescue Errno::EEXIST => e
|
121
|
-
file_path = e.message[%r{.*?(
|
121
|
+
file_path = e.message[%r{.*?((?:[a-zA-Z]:)?/.*)}, 1]
|
122
122
|
raise GitError, "Bundler could not install a gem because it needs to " \
|
123
123
|
"create a directory, but a file exists - #{file_path}. Please delete " \
|
124
124
|
"this file and try again."
|