bundler 1.17.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 +799 -571
- data/LICENSE.md +18 -19
- data/README.md +9 -8
- data/bundler.gemspec +8 -25
- data/exe/bundle +19 -3
- data/lib/bundler.rb +202 -87
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/capistrano.rb +4 -4
- data/lib/bundler/cli.rb +178 -140
- data/lib/bundler/cli/add.rb +28 -16
- data/lib/bundler/cli/cache.rb +25 -13
- data/lib/bundler/cli/common.rb +11 -12
- data/lib/bundler/cli/config.rb +161 -86
- data/lib/bundler/cli/console.rb +1 -1
- 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 +11 -10
- data/lib/bundler/cli/issue.rb +3 -3
- 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 +32 -12
- 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 +9 -7
- data/lib/bundler/definition.rb +35 -26
- data/lib/bundler/dependency.rb +16 -4
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/dsl.rb +16 -40
- data/lib/bundler/env.rb +8 -13
- data/lib/bundler/environment_preserver.rb +0 -1
- data/lib/bundler/feature_flag.rb +23 -34
- 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 +5 -2
- data/lib/bundler/fetcher/index.rb +5 -3
- data/lib/bundler/friendly_errors.rb +6 -7
- data/lib/bundler/gem_helper.rb +40 -25
- 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 +10 -8
- 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 -8
- 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 +42 -29
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/api/source.rb +4 -6
- data/lib/bundler/plugin/index.rb +14 -3
- 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 -67
- data/lib/bundler/rubygems_gem_installer.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +142 -402
- data/lib/bundler/runtime.rb +2 -9
- data/lib/bundler/settings.rb +22 -51
- data/lib/bundler/setup.rb +7 -13
- data/lib/bundler/shared_helpers.rb +51 -77
- 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 +9 -5
- 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 +23 -12
- data/lib/bundler/stub_specification.rb +18 -30
- data/lib/bundler/templates/Executable.bundler +23 -14
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +3 -3
- data/lib/bundler/templates/newgem/Gemfile.tt +8 -2
- data/lib/bundler/templates/newgem/README.md.tt +4 -3
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -27
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +1 -1
- 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 +273 -147
- 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 +27 -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 +16 -7
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
- data/lib/bundler/vendor/thor/lib/thor/base.rb +54 -43
- data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
- data/lib/bundler/vendor/thor/lib/thor/error.rb +78 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
- 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 +20 -5
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +15 -14
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +62 -8
- 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 +2 -2
- 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 +36 -36
- data/man/bundle-config.1.txt +66 -67
- data/man/bundle-config.ronn +42 -40
- 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 +2 -2
- data/man/bundle-init.1.txt +2 -2
- data/man/bundle-init.ronn +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 +7 -3
- data/man/bundle.1.txt +11 -8
- data/man/bundle.ronn +5 -2
- data/man/gemfile.5 +17 -20
- data/man/gemfile.5.ronn +14 -18
- data/man/gemfile.5.txt +108 -112
- data/man/index.txt +1 -1
- metadata +34 -110
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -14
- 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/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,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "shared_helpers"
|
4
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."
|
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
|
|
@@ -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 2, "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."
|
@@ -476,7 +453,7 @@ repo_name ||= user_name
|
|
476
453
|
"should come from that source"
|
477
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
|
@@ -484,13 +461,12 @@ repo_name ||= user_name
|
|
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} }"
|
@@ -498,8 +474,8 @@ repo_name ||= user_name
|
|
498
474
|
"do |repo_name|\n#{replacement.to_s.gsub(/^/, " ")}\n end"
|
499
475
|
end
|
500
476
|
|
501
|
-
Bundler::SharedHelpers.major_deprecation
|
502
|
-
The :#{name} git source is deprecated, and will be removed in
|
477
|
+
Bundler::SharedHelpers.major_deprecation 3, <<-EOS
|
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 2.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,15 +69,9 @@ module Bundler
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def self.ruby_version
|
72
|
-
str = String.new(
|
73
|
-
|
74
|
-
|
75
|
-
str << " patchlevel #{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
|
76
|
-
str << ") [#{RUBY_PLATFORM}]"
|
77
|
-
else
|
78
|
-
str << "p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
|
79
|
-
str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]"
|
80
|
-
end
|
72
|
+
str = String.new(RUBY_VERSION)
|
73
|
+
str << "p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
|
74
|
+
str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]"
|
81
75
|
end
|
82
76
|
|
83
77
|
def self.git_version
|
@@ -106,8 +100,9 @@ module Bundler
|
|
106
100
|
out << [" Full Path", Gem.ruby]
|
107
101
|
out << [" Config Dir", Pathname.new(Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE).dirname]
|
108
102
|
out << ["RubyGems", Gem::VERSION]
|
109
|
-
out << [" Gem Home",
|
110
|
-
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]
|
111
106
|
out << [" User Path", Gem.user_dir]
|
112
107
|
out << [" Bin Dir", Gem.bindir]
|
113
108
|
if defined?(OpenSSL)
|
data/lib/bundler/feature_flag.rb
CHANGED
@@ -19,7 +19,7 @@ module Bundler
|
|
19
19
|
def self.settings_method(name, key, &default)
|
20
20
|
define_method(name) do
|
21
21
|
value = Bundler.settings[key]
|
22
|
-
value = instance_eval(&default) if value.nil?
|
22
|
+
value = instance_eval(&default) if value.nil?
|
23
23
|
value
|
24
24
|
end
|
25
25
|
end
|
@@ -27,40 +27,29 @@ module Bundler
|
|
27
27
|
|
28
28
|
(1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
|
29
29
|
|
30
|
-
settings_flag(:allow_bundler_dependency_conflicts) {
|
31
|
-
settings_flag(:allow_offline_install) {
|
32
|
-
settings_flag(:auto_clean_without_path) {
|
33
|
-
settings_flag(:auto_config_jobs) {
|
34
|
-
settings_flag(:cache_all) {
|
35
|
-
settings_flag(:
|
36
|
-
settings_flag(:
|
37
|
-
settings_flag(:
|
38
|
-
settings_flag(:
|
39
|
-
settings_flag(:
|
40
|
-
settings_flag(:
|
41
|
-
settings_flag(:
|
42
|
-
settings_flag(:global_path_appends_ruby_scope) { bundler_2_mode? }
|
43
|
-
settings_flag(:global_gem_cache) { bundler_2_mode? }
|
44
|
-
settings_flag(:init_gems_rb) { bundler_2_mode? }
|
45
|
-
settings_flag(:list_command) { bundler_2_mode? }
|
46
|
-
settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_2_mode? }
|
47
|
-
settings_flag(:only_update_to_newer_versions) { bundler_2_mode? }
|
48
|
-
settings_flag(:path_relative_to_cwd) { bundler_2_mode? }
|
30
|
+
settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
|
31
|
+
settings_flag(:allow_offline_install) { bundler_3_mode? }
|
32
|
+
settings_flag(:auto_clean_without_path) { bundler_3_mode? }
|
33
|
+
settings_flag(:auto_config_jobs) { bundler_3_mode? }
|
34
|
+
settings_flag(:cache_all) { bundler_3_mode? }
|
35
|
+
settings_flag(:default_install_uses_path) { bundler_3_mode? }
|
36
|
+
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
|
37
|
+
settings_flag(:disable_multisource) { bundler_3_mode? }
|
38
|
+
settings_flag(:forget_cli_options) { bundler_3_mode? }
|
39
|
+
settings_flag(:global_gem_cache) { bundler_3_mode? }
|
40
|
+
settings_flag(:only_update_to_newer_versions) { bundler_3_mode? }
|
41
|
+
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
|
49
42
|
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
|
50
|
-
settings_flag(:
|
51
|
-
settings_flag(:
|
52
|
-
settings_flag(:
|
53
|
-
settings_flag(:
|
54
|
-
settings_flag(:
|
55
|
-
settings_flag(:
|
56
|
-
settings_flag(:
|
57
|
-
settings_flag(:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
settings_option(:default_cli_command) { bundler_2_mode? ? :cli_help : :install }
|
62
|
-
|
63
|
-
settings_method(:github_https?, "github.https") { bundler_2_mode? }
|
43
|
+
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
44
|
+
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
45
|
+
settings_flag(:skip_default_git_sources) { bundler_3_mode? }
|
46
|
+
settings_flag(:specific_platform) { bundler_3_mode? }
|
47
|
+
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
48
|
+
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
|
49
|
+
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
50
|
+
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
|
51
|
+
|
52
|
+
settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
|
64
53
|
|
65
54
|
def initialize(bundler_version)
|
66
55
|
@bundler_version = Gem::Version.create(bundler_version)
|
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,10 +34,13 @@ 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
|
-
raise FallbackError, "Net::HTTPNotFound"
|
43
|
+
raise FallbackError, "Net::HTTPNotFound: #{URICredentialsFilter.credential_filtered_uri(uri)}"
|
41
44
|
else
|
42
45
|
raise HTTPError, "#{response.class}#{": #{response.body}" unless response.body.empty?}"
|
43
46
|
end
|
@@ -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
|