bundler 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +735 -574
- data/LICENSE.md +18 -19
- data/README.md +8 -7
- data/bundler.gemspec +5 -23
- data/exe/bundle +19 -3
- data/lib/bundler.rb +202 -87
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/capistrano.rb +5 -5
- data/lib/bundler/cli.rb +179 -143
- data/lib/bundler/cli/add.rb +28 -16
- data/lib/bundler/cli/cache.rb +25 -13
- data/lib/bundler/cli/common.rb +10 -11
- data/lib/bundler/cli/config.rb +161 -86
- data/lib/bundler/cli/console.rb +2 -2
- data/lib/bundler/cli/doctor.rb +4 -4
- data/lib/bundler/cli/exec.rb +15 -18
- data/lib/bundler/cli/gem.rb +5 -5
- data/lib/bundler/cli/info.rb +17 -5
- data/lib/bundler/cli/init.rb +1 -1
- data/lib/bundler/cli/install.rb +3 -3
- data/lib/bundler/cli/issue.rb +1 -1
- data/lib/bundler/cli/open.rb +10 -6
- data/lib/bundler/cli/outdated.rb +85 -81
- data/lib/bundler/cli/plugin.rb +9 -2
- data/lib/bundler/cli/pristine.rb +1 -1
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +31 -11
- data/lib/bundler/compact_index_client.rb +25 -9
- data/lib/bundler/compact_index_client/updater.rb +2 -6
- data/lib/bundler/current_ruby.rb +8 -7
- data/lib/bundler/definition.rb +33 -26
- data/lib/bundler/dependency.rb +16 -4
- data/lib/bundler/deployment.rb +2 -2
- data/lib/bundler/dsl.rb +19 -43
- data/lib/bundler/env.rb +6 -5
- data/lib/bundler/environment_preserver.rb +0 -1
- data/lib/bundler/feature_flag.rb +1 -13
- data/lib/bundler/fetcher.rb +16 -13
- data/lib/bundler/fetcher/compact_index.rb +26 -12
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +4 -1
- data/lib/bundler/fetcher/index.rb +5 -3
- data/lib/bundler/friendly_errors.rb +6 -7
- data/lib/bundler/gem_helper.rb +14 -14
- data/lib/bundler/gem_helpers.rb +2 -4
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +3 -3
- data/lib/bundler/graph.rb +2 -2
- data/lib/bundler/injector.rb +3 -1
- data/lib/bundler/inline.rb +40 -30
- data/lib/bundler/installer.rb +7 -14
- data/lib/bundler/installer/gem_installer.rb +5 -1
- data/lib/bundler/installer/parallel_installer.rb +4 -4
- data/lib/bundler/installer/standalone.rb +1 -2
- data/lib/bundler/lazy_specification.rb +2 -3
- data/lib/bundler/lockfile_parser.rb +14 -21
- data/lib/bundler/match_platform.rb +1 -1
- data/lib/bundler/mirror.rb +3 -3
- data/lib/bundler/plugin.rb +29 -18
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/api/source.rb +4 -6
- data/lib/bundler/plugin/index.rb +10 -2
- data/lib/bundler/plugin/installer.rb +28 -15
- data/lib/bundler/psyched_yaml.rb +1 -1
- data/lib/bundler/remote_specification.rb +0 -2
- data/lib/bundler/resolver.rb +72 -24
- data/lib/bundler/resolver/spec_group.rb +3 -2
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_version.rb +4 -19
- data/lib/bundler/rubygems_ext.rb +11 -66
- data/lib/bundler/rubygems_gem_installer.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +133 -410
- data/lib/bundler/runtime.rb +2 -9
- data/lib/bundler/settings.rb +22 -52
- data/lib/bundler/setup.rb +7 -13
- data/lib/bundler/shared_helpers.rb +46 -74
- data/lib/bundler/similarity_detector.rb +2 -2
- data/lib/bundler/source.rb +5 -5
- data/lib/bundler/source/git.rb +24 -17
- data/lib/bundler/source/git/git_proxy.rb +38 -41
- data/lib/bundler/source/metadata.rb +7 -2
- data/lib/bundler/source/path.rb +13 -8
- data/lib/bundler/source/rubygems.rb +14 -8
- data/lib/bundler/source/rubygems/remote.rb +2 -3
- data/lib/bundler/source_list.rb +9 -12
- data/lib/bundler/spec_set.rb +1 -6
- data/lib/bundler/stub_specification.rb +18 -30
- data/lib/bundler/templates/Executable.bundler +22 -13
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +3 -3
- data/lib/bundler/templates/newgem/Gemfile.tt +8 -0
- data/lib/bundler/templates/newgem/README.md.tt +4 -3
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -18
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -1
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/ui/shell.rb +4 -8
- data/lib/bundler/uri_credentials_filter.rb +7 -3
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +134 -111
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +6 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +30 -8
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +4 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +273 -304
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/thor/lib/thor.rb +19 -4
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +17 -12
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
- data/lib/bundler/vendor/thor/lib/thor/base.rb +51 -39
- data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
- data/lib/bundler/vendor/thor/lib/thor/error.rb +14 -18
- data/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +13 -3
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +13 -12
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +10 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +6 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendored_fileutils.rb +1 -6
- data/lib/bundler/vendored_molinillo.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +7 -5
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +1 -20
- data/lib/bundler/version_ranges.rb +51 -5
- data/lib/bundler/vlad.rb +3 -3
- data/lib/bundler/worker.rb +1 -3
- data/lib/bundler/yaml_serializer.rb +2 -3
- data/man/bundle-add.1 +10 -2
- data/man/bundle-add.1.txt +11 -5
- data/man/bundle-add.ronn +7 -1
- data/man/bundle-binstubs.1 +2 -2
- data/man/bundle-binstubs.1.txt +2 -2
- data/man/bundle-binstubs.ronn +1 -1
- data/man/bundle-cache.1 +55 -0
- data/man/bundle-cache.1.txt +78 -0
- data/man/{bundle-package.ronn → bundle-cache.ronn} +15 -15
- data/man/bundle-check.1 +1 -1
- data/man/bundle-check.1.txt +6 -6
- data/man/bundle-clean.1 +1 -1
- data/man/bundle-clean.1.txt +1 -1
- data/man/bundle-config.1 +35 -35
- data/man/bundle-config.1.txt +65 -66
- data/man/bundle-config.ronn +41 -39
- data/man/bundle-doctor.1 +1 -1
- data/man/bundle-doctor.1.txt +1 -1
- data/man/bundle-exec.1 +2 -2
- data/man/bundle-exec.1.txt +2 -2
- data/man/bundle-exec.ronn +1 -1
- data/man/bundle-gem.1 +1 -1
- data/man/bundle-gem.1.txt +3 -3
- data/man/bundle-info.1 +1 -1
- data/man/bundle-info.1.txt +1 -1
- data/man/bundle-init.1 +1 -1
- data/man/bundle-init.1.txt +1 -1
- data/man/bundle-inject.1 +1 -1
- data/man/bundle-inject.1.txt +1 -1
- data/man/bundle-install.1 +8 -5
- data/man/bundle-install.1.txt +56 -51
- data/man/bundle-install.ronn +9 -4
- data/man/bundle-list.1 +1 -1
- data/man/bundle-list.1.txt +1 -1
- data/man/bundle-lock.1 +1 -1
- data/man/bundle-lock.1.txt +16 -16
- data/man/bundle-open.1 +1 -1
- data/man/bundle-open.1.txt +1 -1
- data/man/bundle-outdated.1 +1 -1
- data/man/bundle-outdated.1.txt +1 -1
- data/man/bundle-platform.1 +1 -1
- data/man/bundle-platform.1.txt +1 -1
- data/man/bundle-pristine.1 +1 -1
- data/man/bundle-pristine.1.txt +1 -1
- data/man/bundle-remove.1 +1 -1
- data/man/bundle-remove.1.txt +1 -1
- data/man/bundle-show.1 +1 -1
- data/man/bundle-show.1.txt +1 -1
- data/man/bundle-update.1 +4 -4
- data/man/bundle-update.1.txt +64 -65
- data/man/bundle-update.ronn +3 -3
- data/man/bundle-viz.1 +1 -1
- data/man/bundle-viz.1.txt +1 -1
- data/man/bundle.1 +2 -2
- data/man/bundle.1.txt +7 -7
- data/man/bundle.ronn +1 -1
- data/man/gemfile.5 +12 -15
- data/man/gemfile.5.ronn +9 -13
- data/man/gemfile.5.txt +103 -107
- data/man/index.txt +1 -1
- metadata +30 -120
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -13
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/ssl_certs/.document +0 -1
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +0 -5
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/man/bundle-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
data/lib/bundler/deployment.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
Bundler::SharedHelpers.major_deprecation
|
3
|
+
require_relative "shared_helpers"
|
4
|
+
Bundler::SharedHelpers.major_deprecation 2, "Bundler no longer integrates with " \
|
5
5
|
"Capistrano, but Capistrano provides its own integration with " \
|
6
6
|
"Bundler via the capistrano-bundler gem. Use it instead."
|
7
7
|
|
data/lib/bundler/dsl.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative "dependency"
|
4
|
+
require_relative "ruby_dsl"
|
5
5
|
|
6
6
|
module Bundler
|
7
7
|
class Dsl
|
@@ -44,8 +44,8 @@ module Bundler
|
|
44
44
|
@gemfile = expanded_gemfile_path
|
45
45
|
@gemfiles << expanded_gemfile_path
|
46
46
|
contents ||= Bundler.read_file(@gemfile.to_s)
|
47
|
-
instance_eval(contents.dup.untaint, gemfile.to_s, 1)
|
48
|
-
rescue Exception => e
|
47
|
+
instance_eval(contents.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" }, gemfile.to_s, 1)
|
48
|
+
rescue Exception => e # rubocop:disable Lint/RescueException
|
49
49
|
message = "There was an error " \
|
50
50
|
"#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " \
|
51
51
|
"`#{File.basename gemfile.to_s}`: #{e.message}"
|
@@ -128,7 +128,7 @@ module Bundler
|
|
128
128
|
else
|
129
129
|
Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
|
130
130
|
"You should probably keep only one of them.\n" \
|
131
|
-
"Remove any duplicate entries and specify the gem only once
|
131
|
+
"Remove any duplicate entries and specify the gem only once.\n" \
|
132
132
|
"While it's not a problem now, it could cause errors if you change the version of one of them later."
|
133
133
|
end
|
134
134
|
|
@@ -194,7 +194,7 @@ module Bundler
|
|
194
194
|
" end\n\n"
|
195
195
|
|
196
196
|
raise DeprecatedError, msg if Bundler.feature_flag.disable_multisource?
|
197
|
-
SharedHelpers.major_deprecation(
|
197
|
+
SharedHelpers.major_deprecation(2, msg.strip)
|
198
198
|
end
|
199
199
|
|
200
200
|
source_options = normalize_hash(options).merge(
|
@@ -290,37 +290,16 @@ module Bundler
|
|
290
290
|
warn_deprecated_git_source(:github, <<-'RUBY'.strip, 'Change any "reponame" :github sources to "username/reponame".')
|
291
291
|
"https://github.com/#{repo_name}.git"
|
292
292
|
RUBY
|
293
|
-
# It would be better to use https instead of the git protocol, but this
|
294
|
-
# can break deployment of existing locked bundles when switching between
|
295
|
-
# different versions of Bundler. The change will be made in 2.0, which
|
296
|
-
# does not guarantee compatibility with the 1.x series.
|
297
|
-
#
|
298
|
-
# See https://github.com/bundler/bundler/pull/2569 for discussion
|
299
|
-
#
|
300
|
-
# This can be overridden by adding this code to your Gemfiles:
|
301
|
-
#
|
302
|
-
# git_source(:github) do |repo_name|
|
303
|
-
# repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
|
304
|
-
# "https://github.com/#{repo_name}.git"
|
305
|
-
# end
|
306
293
|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
|
307
|
-
|
308
|
-
if Bundler.feature_flag.github_https?
|
309
|
-
Bundler::SharedHelpers.major_deprecation 3, "The `github.https` setting will be removed"
|
310
|
-
"https://github.com/#{repo_name}.git"
|
311
|
-
else
|
312
|
-
"git://github.com/#{repo_name}.git"
|
313
|
-
end
|
294
|
+
"https://github.com/#{repo_name}.git"
|
314
295
|
end
|
315
296
|
|
316
|
-
# TODO: 2.0 remove this deprecated git source
|
317
297
|
git_source(:gist) do |repo_name|
|
318
298
|
warn_deprecated_git_source(:gist, '"https://gist.github.com/#{repo_name}.git"')
|
319
299
|
|
320
300
|
"https://gist.github.com/#{repo_name}.git"
|
321
301
|
end
|
322
302
|
|
323
|
-
# TODO: 2.0 remove this deprecated git source
|
324
303
|
git_source(:bitbucket) do |repo_name|
|
325
304
|
warn_deprecated_git_source(:bitbucket, <<-'RUBY'.strip)
|
326
305
|
user_name, repo_name = repo_name.split("/")
|
@@ -363,9 +342,7 @@ repo_name ||= user_name
|
|
363
342
|
if name =~ /\s/
|
364
343
|
raise GemfileError, %('#{name}' is not a valid gem name because it contains whitespace)
|
365
344
|
end
|
366
|
-
if name.empty?
|
367
|
-
raise GemfileError, %(an empty gem name is not valid)
|
368
|
-
end
|
345
|
+
raise GemfileError, %(an empty gem name is not valid) if name.empty?
|
369
346
|
|
370
347
|
normalize_hash(opts)
|
371
348
|
|
@@ -443,10 +420,10 @@ repo_name ||= user_name
|
|
443
420
|
message = String.new
|
444
421
|
message << "You passed #{invalid_keys.map {|k| ":" + k }.join(", ")} "
|
445
422
|
message << if invalid_keys.size > 1
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
423
|
+
"as options for #{command}, but they are invalid."
|
424
|
+
else
|
425
|
+
"as an option for #{command}, but it is invalid."
|
426
|
+
end
|
450
427
|
|
451
428
|
message << " Valid options are: #{valid_keys.join(", ")}."
|
452
429
|
message << " You may be able to resolve this by upgrading Bundler to the newest version."
|
@@ -456,7 +433,7 @@ repo_name ||= user_name
|
|
456
433
|
def normalize_source(source)
|
457
434
|
case source
|
458
435
|
when :gemcutter, :rubygems, :rubyforge
|
459
|
-
Bundler::SharedHelpers.major_deprecation
|
436
|
+
Bundler::SharedHelpers.major_deprecation 2, "The source :#{source} is deprecated because HTTP " \
|
460
437
|
"requests are insecure.\nPlease change your source to 'https://" \
|
461
438
|
"rubygems.org' if possible, or 'http://rubygems.org' if not."
|
462
439
|
"http://rubygems.org"
|
@@ -474,23 +451,22 @@ repo_name ||= user_name
|
|
474
451
|
msg = "This Gemfile contains multiple primary sources. " \
|
475
452
|
"Each source after the first must include a block to indicate which gems " \
|
476
453
|
"should come from that source"
|
477
|
-
unless Bundler.feature_flag.
|
454
|
+
unless Bundler.feature_flag.bundler_2_mode?
|
478
455
|
msg += ". To downgrade this error to a warning, run " \
|
479
|
-
"`bundle config
|
456
|
+
"`bundle config unset disable_multisource`"
|
480
457
|
end
|
481
458
|
raise GemfileEvalError, msg
|
482
459
|
else
|
483
|
-
Bundler::SharedHelpers.major_deprecation
|
460
|
+
Bundler::SharedHelpers.major_deprecation 2, "Your Gemfile contains multiple primary sources. " \
|
484
461
|
"Using `source` more than once without a block is a security risk, and " \
|
485
462
|
"may result in installing unexpected gems. To resolve this warning, use " \
|
486
463
|
"a block to indicate which gems should come from the secondary source. " \
|
487
|
-
"To upgrade this warning to an error, run `bundle config " \
|
464
|
+
"To upgrade this warning to an error, run `bundle config set " \
|
488
465
|
"disable_multisource true`."
|
489
466
|
end
|
490
467
|
end
|
491
468
|
|
492
469
|
def warn_deprecated_git_source(name, replacement, additional_message = nil)
|
493
|
-
# TODO: 2.0 remove deprecation
|
494
470
|
additional_message &&= " #{additional_message}"
|
495
471
|
replacement = if replacement.count("\n").zero?
|
496
472
|
"{|repo_name| #{replacement} }"
|
@@ -499,7 +475,7 @@ repo_name ||= user_name
|
|
499
475
|
end
|
500
476
|
|
501
477
|
Bundler::SharedHelpers.major_deprecation 3, <<-EOS
|
502
|
-
The :#{name} git source is deprecated, and will be removed in
|
478
|
+
The :#{name} git source is deprecated, and will be removed in the future.#{additional_message} Add this code to the top of your Gemfile to ensure it continues to work:
|
503
479
|
|
504
480
|
git_source(:#{name}) #{replacement}
|
505
481
|
|
@@ -601,7 +577,7 @@ The :#{name} git source is deprecated, and will be removed in Bundler 3.0.#{addi
|
|
601
577
|
description = self.description
|
602
578
|
if dsl_path && description =~ /((#{Regexp.quote File.expand_path(dsl_path)}|#{Regexp.quote dsl_path.to_s}):\d+)/
|
603
579
|
trace_line = Regexp.last_match[1]
|
604
|
-
description = description.sub(/#{Regexp.quote trace_line}:\s*/, "").sub("\n", " - ")
|
580
|
+
description = description.sub(/\n.*\n(\.\.\.)? *\^~+$/, "").sub(/#{Regexp.quote trace_line}:\s*/, "").sub("\n", " - ")
|
605
581
|
end
|
606
582
|
[trace_line, description]
|
607
583
|
end
|
data/lib/bundler/env.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative "rubygems_integration"
|
4
|
+
require_relative "source/git/git_proxy"
|
5
5
|
|
6
6
|
module Bundler
|
7
7
|
class Env
|
@@ -69,7 +69,7 @@ module Bundler
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def self.ruby_version
|
72
|
-
str = String.new(
|
72
|
+
str = String.new(RUBY_VERSION)
|
73
73
|
str << "p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
|
74
74
|
str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]"
|
75
75
|
end
|
@@ -100,8 +100,9 @@ module Bundler
|
|
100
100
|
out << [" Full Path", Gem.ruby]
|
101
101
|
out << [" Config Dir", Pathname.new(Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE).dirname]
|
102
102
|
out << ["RubyGems", Gem::VERSION]
|
103
|
-
out << [" Gem Home",
|
104
|
-
out << [" Gem Path",
|
103
|
+
out << [" Gem Home", Gem.dir]
|
104
|
+
out << [" Gem Path", Gem.path.join(File::PATH_SEPARATOR)]
|
105
|
+
out << [" User Home", Gem.user_home]
|
105
106
|
out << [" User Path", Gem.user_dir]
|
106
107
|
out << [" Bin Dir", Gem.bindir]
|
107
108
|
if defined?(OpenSSL)
|
data/lib/bundler/feature_flag.rb
CHANGED
@@ -32,37 +32,25 @@ module Bundler
|
|
32
32
|
settings_flag(:auto_clean_without_path) { bundler_3_mode? }
|
33
33
|
settings_flag(:auto_config_jobs) { bundler_3_mode? }
|
34
34
|
settings_flag(:cache_all) { bundler_3_mode? }
|
35
|
-
settings_flag(:cache_command_is_package) { bundler_3_mode? }
|
36
|
-
settings_flag(:console_command) { !bundler_3_mode? }
|
37
35
|
settings_flag(:default_install_uses_path) { bundler_3_mode? }
|
38
36
|
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
|
39
37
|
settings_flag(:disable_multisource) { bundler_3_mode? }
|
40
|
-
settings_flag(:error_on_stderr) { bundler_2_mode? }
|
41
38
|
settings_flag(:forget_cli_options) { bundler_3_mode? }
|
42
|
-
settings_flag(:global_path_appends_ruby_scope) { bundler_3_mode? }
|
43
39
|
settings_flag(:global_gem_cache) { bundler_3_mode? }
|
44
|
-
settings_flag(:init_gems_rb) { bundler_3_mode? }
|
45
|
-
settings_flag(:list_command) { bundler_3_mode? }
|
46
|
-
settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_3_mode? }
|
47
|
-
settings_flag(:lockfile_upgrade_warning) { bundler_3_mode? }
|
48
40
|
settings_flag(:only_update_to_newer_versions) { bundler_3_mode? }
|
49
41
|
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
|
50
42
|
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
|
51
|
-
settings_flag(:prefer_gems_rb) { bundler_3_mode? }
|
52
43
|
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
53
44
|
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
54
45
|
settings_flag(:skip_default_git_sources) { bundler_3_mode? }
|
55
46
|
settings_flag(:specific_platform) { bundler_3_mode? }
|
56
47
|
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
57
48
|
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
|
58
|
-
settings_flag(:update_requires_all_flag) {
|
49
|
+
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
59
50
|
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
|
60
|
-
settings_flag(:viz_command) { !bundler_3_mode? }
|
61
51
|
|
62
52
|
settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
|
63
53
|
|
64
|
-
settings_method(:github_https?, "github.https") { bundler_2_mode? }
|
65
|
-
|
66
54
|
def initialize(bundler_version)
|
67
55
|
@bundler_version = Gem::Version.create(bundler_version)
|
68
56
|
end
|
data/lib/bundler/fetcher.rb
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "vendored_persistent"
|
4
4
|
require "cgi"
|
5
5
|
require "securerandom"
|
6
6
|
require "zlib"
|
7
|
+
require "rubygems/request"
|
7
8
|
|
8
9
|
module Bundler
|
9
10
|
# Handles all the fetching with the rubygems server
|
10
11
|
class Fetcher
|
11
|
-
autoload :CompactIndex, "
|
12
|
-
autoload :Downloader, "
|
13
|
-
autoload :Dependency, "
|
14
|
-
autoload :Index, "
|
12
|
+
autoload :CompactIndex, File.expand_path("fetcher/compact_index", __dir__)
|
13
|
+
autoload :Downloader, File.expand_path("fetcher/downloader", __dir__)
|
14
|
+
autoload :Dependency, File.expand_path("fetcher/dependency", __dir__)
|
15
|
+
autoload :Index, File.expand_path("fetcher/index", __dir__)
|
15
16
|
|
16
17
|
# This error is raised when it looks like the network is down
|
17
18
|
class NetworkDownError < HTTPError; end
|
19
|
+
# This error is raised if we should rate limit our requests to the API
|
20
|
+
class TooManyRequestsError < HTTPError; end
|
18
21
|
# This error is raised if the API returns a 413 (only printed in verbose)
|
19
22
|
class FallbackError < HTTPError; end
|
20
23
|
# This is the error raised if OpenSSL fails the cert verification
|
@@ -44,7 +47,7 @@ module Bundler
|
|
44
47
|
remote_uri = filter_uri(remote_uri)
|
45
48
|
super "Authentication is required for #{remote_uri}.\n" \
|
46
49
|
"Please supply credentials for this source. You can do this by running:\n" \
|
47
|
-
" bundle config #{remote_uri} username:password"
|
50
|
+
" bundle config set #{remote_uri} username:password"
|
48
51
|
end
|
49
52
|
end
|
50
53
|
# This error is raised if HTTP authentication is provided, but incorrect.
|
@@ -94,9 +97,10 @@ module Bundler
|
|
94
97
|
spec -= [nil, "ruby", ""]
|
95
98
|
spec_file_name = "#{spec.join "-"}.gemspec"
|
96
99
|
|
97
|
-
uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
|
100
|
+
uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
|
98
101
|
if uri.scheme == "file"
|
99
|
-
|
102
|
+
path = Bundler.rubygems.correct_for_windows_path(uri.path)
|
103
|
+
Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
|
100
104
|
elsif cached_spec_path = gemspec_cached_path(spec_file_name)
|
101
105
|
Bundler.load_gemspec(cached_spec_path)
|
102
106
|
else
|
@@ -226,7 +230,7 @@ module Bundler
|
|
226
230
|
"GO_SERVER_URL" => "go",
|
227
231
|
"SNAP_CI" => "snap",
|
228
232
|
"CI_NAME" => ENV["CI_NAME"],
|
229
|
-
"CI" => "ci"
|
233
|
+
"CI" => "ci",
|
230
234
|
}
|
231
235
|
env_cis.find_all {|env, _| ENV[env] }.map {|_, ci| ci }
|
232
236
|
end
|
@@ -238,9 +242,9 @@ module Bundler
|
|
238
242
|
Bundler.settings[:ssl_client_cert]
|
239
243
|
raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
|
240
244
|
|
241
|
-
con = PersistentHTTP.new "bundler", :ENV
|
245
|
+
con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
|
242
246
|
if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
|
243
|
-
con.proxy = URI.parse(gem_proxy) if gem_proxy != :no_proxy
|
247
|
+
con.proxy = Bundler::URI.parse(gem_proxy) if gem_proxy != :no_proxy
|
244
248
|
end
|
245
249
|
|
246
250
|
if remote_uri.scheme == "https"
|
@@ -293,8 +297,7 @@ module Bundler
|
|
293
297
|
end
|
294
298
|
else
|
295
299
|
store.set_default_paths
|
296
|
-
|
297
|
-
Dir.glob(certs).each {|c| store.add_file c }
|
300
|
+
Gem::Request.get_cert_files.each {|c| store.add_file c }
|
298
301
|
end
|
299
302
|
store
|
300
303
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative "base"
|
4
|
+
require_relative "../worker"
|
5
5
|
|
6
6
|
module Bundler
|
7
|
-
autoload :CompactIndexClient, "
|
7
|
+
autoload :CompactIndexClient, File.expand_path("../compact_index_client", __dir__)
|
8
8
|
|
9
9
|
class Fetcher
|
10
10
|
class CompactIndex < Base
|
@@ -39,7 +39,13 @@ module Bundler
|
|
39
39
|
until remaining_gems.empty?
|
40
40
|
log_specs "Looking up gems #{remaining_gems.inspect}"
|
41
41
|
|
42
|
-
deps =
|
42
|
+
deps = begin
|
43
|
+
parallel_compact_index_client.dependencies(remaining_gems)
|
44
|
+
rescue TooManyRequestsError
|
45
|
+
@bundle_worker.stop if @bundle_worker
|
46
|
+
@bundle_worker = nil # reset it. Not sure if necessary
|
47
|
+
serial_compact_index_client.dependencies(remaining_gems)
|
48
|
+
end
|
43
49
|
next_gems = deps.map {|d| d[3].map(&:first).flatten(1) }.flatten(1).uniq
|
44
50
|
deps.each {|dep| gem_info << dep }
|
45
51
|
complete_gems.concat(deps.map(&:first)).uniq!
|
@@ -80,18 +86,26 @@ module Bundler
|
|
80
86
|
private
|
81
87
|
|
82
88
|
def compact_index_client
|
83
|
-
@compact_index_client ||=
|
89
|
+
@compact_index_client ||=
|
84
90
|
SharedHelpers.filesystem_access(cache_path) do
|
85
91
|
CompactIndexClient.new(cache_path, client_fetcher)
|
86
|
-
end.tap do |client|
|
87
|
-
client.in_parallel = lambda do |inputs, &blk|
|
88
|
-
func = lambda {|object, _index| blk.call(object) }
|
89
|
-
worker = bundle_worker(func)
|
90
|
-
inputs.each {|input| worker.enq(input) }
|
91
|
-
inputs.map { worker.deq }
|
92
|
-
end
|
93
92
|
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def parallel_compact_index_client
|
96
|
+
compact_index_client.execution_mode = lambda do |inputs, &blk|
|
97
|
+
func = lambda {|object, _index| blk.call(object) }
|
98
|
+
worker = bundle_worker(func)
|
99
|
+
inputs.each {|input| worker.enq(input) }
|
100
|
+
inputs.map { worker.deq }
|
94
101
|
end
|
102
|
+
|
103
|
+
compact_index_client
|
104
|
+
end
|
105
|
+
|
106
|
+
def serial_compact_index_client
|
107
|
+
compact_index_client.sequential_execution_mode!
|
108
|
+
compact_index_client
|
95
109
|
end
|
96
110
|
|
97
111
|
def bundle_worker(func = nil)
|
@@ -21,7 +21,7 @@ module Bundler
|
|
21
21
|
when Net::HTTPSuccess, Net::HTTPNotModified
|
22
22
|
response
|
23
23
|
when Net::HTTPRedirection
|
24
|
-
new_uri = URI.parse(response["location"])
|
24
|
+
new_uri = Bundler::URI.parse(response["location"])
|
25
25
|
if new_uri.host == uri.host
|
26
26
|
new_uri.user = uri.user
|
27
27
|
new_uri.password = uri.password
|
@@ -34,7 +34,10 @@ module Bundler
|
|
34
34
|
fetch(uri, new_headers)
|
35
35
|
when Net::HTTPRequestEntityTooLarge
|
36
36
|
raise FallbackError, response.body
|
37
|
+
when Net::HTTPTooManyRequests
|
38
|
+
raise TooManyRequestsError, response.body
|
37
39
|
when Net::HTTPUnauthorized
|
40
|
+
raise BadAuthenticationError, uri.host if uri.userinfo
|
38
41
|
raise AuthenticationRequiredError, uri.host
|
39
42
|
when Net::HTTPNotFound
|
40
43
|
raise FallbackError, "Net::HTTPNotFound: #{URICredentialsFilter.credential_filtered_uri(uri)}"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "base"
|
4
4
|
require "rubygems/remote_fetcher"
|
5
5
|
|
6
6
|
module Bundler
|
@@ -13,6 +13,7 @@ module Bundler
|
|
13
13
|
when /certificate verify failed/
|
14
14
|
raise CertificateFailureError.new(display_uri)
|
15
15
|
when /401/
|
16
|
+
raise BadAuthenticationError, remote_uri if remote_uri.userinfo
|
16
17
|
raise AuthenticationRequiredError, remote_uri
|
17
18
|
when /403/
|
18
19
|
raise BadAuthenticationError, remote_uri if remote_uri.userinfo
|
@@ -27,9 +28,10 @@ module Bundler
|
|
27
28
|
spec -= [nil, "ruby", ""]
|
28
29
|
spec_file_name = "#{spec.join "-"}.gemspec"
|
29
30
|
|
30
|
-
uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
|
31
|
+
uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
|
31
32
|
if uri.scheme == "file"
|
32
|
-
|
33
|
+
path = Bundler.rubygems.correct_for_windows_path(uri.path)
|
34
|
+
Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
|
33
35
|
elsif cached_spec_path = gemspec_cached_path(spec_file_name)
|
34
36
|
Bundler.load_gemspec(cached_spec_path)
|
35
37
|
else
|
@@ -1,8 +1,6 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
5
|
-
require "bundler/vendored_thor"
|
3
|
+
require_relative "vendored_thor"
|
6
4
|
|
7
5
|
module Bundler
|
8
6
|
module FriendlyErrors
|
@@ -17,7 +15,7 @@ module Bundler
|
|
17
15
|
Bundler.ui.error error.message
|
18
16
|
when GemRequireError
|
19
17
|
Bundler.ui.error error.message
|
20
|
-
Bundler.ui.trace error.orig_exception
|
18
|
+
Bundler.ui.trace error.orig_exception
|
21
19
|
when BundlerError
|
22
20
|
Bundler.ui.error error.message, :wrap => true
|
23
21
|
Bundler.ui.trace error
|
@@ -29,7 +27,7 @@ module Bundler
|
|
29
27
|
Bundler.ui.warn <<-WARN, :wrap => true
|
30
28
|
You must recompile Ruby with OpenSSL support or change the sources in your \
|
31
29
|
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL \
|
32
|
-
using RVM are available at
|
30
|
+
using RVM are available at https://rvm.io/packages/openssl.
|
33
31
|
WARN
|
34
32
|
Bundler.ui.trace error
|
35
33
|
when Interrupt
|
@@ -45,7 +43,7 @@ module Bundler
|
|
45
43
|
"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)."
|
46
44
|
else request_issue_report_for(error)
|
47
45
|
end
|
48
|
-
rescue
|
46
|
+
rescue StandardError
|
49
47
|
raise error
|
50
48
|
end
|
51
49
|
|
@@ -115,6 +113,7 @@ module Bundler
|
|
115
113
|
def issues_url(exception)
|
116
114
|
message = exception.message.lines.first.tr(":", " ").chomp
|
117
115
|
message = message.split("-").first if exception.is_a?(Errno)
|
116
|
+
require "cgi"
|
118
117
|
"https://github.com/bundler/bundler/search?q=" \
|
119
118
|
"#{CGI.escape(message)}&type=Issues"
|
120
119
|
end
|
@@ -124,7 +123,7 @@ module Bundler
|
|
124
123
|
yield
|
125
124
|
rescue SignalException
|
126
125
|
raise
|
127
|
-
rescue Exception => e
|
126
|
+
rescue Exception => e # rubocop:disable Lint/RescueException
|
128
127
|
FriendlyErrors.log_error(e)
|
129
128
|
exit FriendlyErrors.exit_status(e)
|
130
129
|
end
|