rubygems-update 3.5.23 → 3.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +74 -0
- data/Manifest.txt +23 -16
- data/README.md +15 -10
- data/bundler/CHANGELOG.md +66 -0
- data/bundler/bundler.gemspec +2 -2
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/console.rb +0 -4
- data/bundler/lib/bundler/cli/doctor.rb +4 -4
- data/bundler/lib/bundler/cli/exec.rb +1 -0
- data/bundler/lib/bundler/cli/gem.rb +1 -1
- data/bundler/lib/bundler/cli/info.rb +2 -2
- data/bundler/lib/bundler/cli/inject.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +4 -0
- data/bundler/lib/bundler/cli/lock.rb +20 -1
- data/bundler/lib/bundler/cli/pristine.rb +1 -1
- data/bundler/lib/bundler/cli/show.rb +2 -2
- data/bundler/lib/bundler/cli.rb +22 -53
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
- data/bundler/lib/bundler/compact_index_client/updater.rb +0 -11
- data/bundler/lib/bundler/definition.rb +155 -74
- data/bundler/lib/bundler/dependency.rb +1 -1
- data/bundler/lib/bundler/dsl.rb +2 -13
- data/bundler/lib/bundler/endpoint_specification.rb +10 -1
- data/bundler/lib/bundler/errors.rb +10 -0
- data/bundler/lib/bundler/feature_flag.rb +1 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +10 -3
- data/bundler/lib/bundler/gem_helpers.rb +21 -5
- data/bundler/lib/bundler/injector.rb +2 -2
- data/bundler/lib/bundler/installer/standalone.rb +2 -2
- data/bundler/lib/bundler/installer.rb +4 -38
- data/bundler/lib/bundler/lazy_specification.rb +65 -24
- data/bundler/lib/bundler/lockfile_parser.rb +9 -1
- data/bundler/lib/bundler/man/bundle-add.1 +13 -10
- data/bundler/lib/bundler/man/bundle-add.1.ronn +12 -9
- data/bundler/lib/bundler/man/bundle-binstubs.1 +7 -4
- data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
- data/bundler/lib/bundler/man/bundle-cache.1 +30 -2
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
- data/bundler/lib/bundler/man/bundle-check.1 +3 -3
- data/bundler/lib/bundler/man/bundle-check.1.ronn +4 -2
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +3 -1
- data/bundler/lib/bundler/man/bundle-config.1.ronn +2 -0
- data/bundler/lib/bundler/man/bundle-console.1 +2 -4
- data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
- data/bundler/lib/bundler/man/bundle-doctor.1 +2 -2
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-env.1 +9 -0
- data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-exec.1 +5 -2
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
- data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/bundler/lib/bundler/man/bundle-gem.1 +17 -5
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +27 -6
- data/bundler/lib/bundler/man/bundle-help.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +5 -2
- data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
- data/bundler/lib/bundler/man/bundle-init.1 +3 -3
- data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
- data/bundler/lib/bundler/man/bundle-inject.1 +10 -2
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +9 -1
- data/bundler/lib/bundler/man/bundle-install.1 +14 -11
- data/bundler/lib/bundler/man/bundle-install.1.ronn +21 -16
- data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
- data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
- data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +21 -6
- data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
- data/bundler/lib/bundler/man/bundle-open.1 +2 -2
- data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +8 -5
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +5 -2
- data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
- data/bundler/lib/bundler/man/bundle-update.1 +13 -7
- data/bundler/lib/bundler/man/bundle-update.1.ronn +14 -6
- data/bundler/lib/bundler/man/bundle-version.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +4 -4
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/materialization.rb +59 -0
- data/bundler/lib/bundler/plugin/events.rb +24 -0
- data/bundler/lib/bundler/plugin/installer.rb +1 -1
- data/bundler/lib/bundler/process_lock.rb +1 -1
- data/bundler/lib/bundler/remote_specification.rb +6 -1
- data/bundler/lib/bundler/resolver/base.rb +2 -6
- data/bundler/lib/bundler/resolver/candidate.rb +2 -2
- data/bundler/lib/bundler/resolver/spec_group.rb +4 -3
- data/bundler/lib/bundler/resolver.rb +5 -5
- data/bundler/lib/bundler/rubygems_ext.rb +28 -28
- data/bundler/lib/bundler/rubygems_gem_installer.rb +0 -1
- data/bundler/lib/bundler/rubygems_integration.rb +21 -11
- data/bundler/lib/bundler/runtime.rb +27 -7
- data/bundler/lib/bundler/self_manager.rb +2 -3
- data/bundler/lib/bundler/settings.rb +1 -0
- data/bundler/lib/bundler/shared_helpers.rb +2 -2
- data/bundler/lib/bundler/source/git/git_proxy.rb +0 -6
- data/bundler/lib/bundler/source/git.rb +56 -31
- data/bundler/lib/bundler/source/path.rb +2 -2
- data/bundler/lib/bundler/source_list.rb +1 -1
- data/bundler/lib/bundler/spec_set.rb +81 -56
- data/bundler/lib/bundler/stub_specification.rb +8 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/bundler/lib/bundler/uri_credentials_filter.rb +1 -1
- data/bundler/lib/bundler/vendor/fileutils/COPYING +56 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
- data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +11 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
- data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +37 -16
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
- data/bundler/lib/bundler/vendored_securerandom.rb +0 -2
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +37 -13
- data/{CONTRIBUTING.md → doc/rubygems/CONTRIBUTING.md} +9 -9
- data/{POLICIES.md → doc/rubygems/POLICIES.md} +11 -11
- data/lib/rubygems/basic_specification.rb +5 -4
- data/lib/rubygems/commands/cleanup_command.rb +2 -2
- data/lib/rubygems/commands/contents_command.rb +4 -4
- data/lib/rubygems/commands/exec_command.rb +3 -0
- data/lib/rubygems/commands/pristine_command.rb +2 -2
- data/lib/rubygems/commands/push_command.rb +29 -5
- data/lib/rubygems/commands/rdoc_command.rb +2 -2
- data/lib/rubygems/commands/rebuild_command.rb +0 -2
- data/lib/rubygems/commands/setup_command.rb +1 -16
- data/lib/rubygems/commands/unpack_command.rb +0 -6
- data/lib/rubygems/commands/update_command.rb +2 -8
- data/lib/rubygems/config_file.rb +12 -0
- data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/exceptions.rb +0 -6
- data/lib/rubygems/ext/builder.rb +6 -4
- data/lib/rubygems/ext/cargo_builder.rb +7 -4
- data/lib/rubygems/ext/cmake_builder.rb +7 -2
- data/lib/rubygems/ext/configure_builder.rb +7 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
- data/lib/rubygems/ext/rake_builder.rb +6 -1
- data/lib/rubygems/install_update_options.rb +5 -0
- data/lib/rubygems/installer.rb +2 -2
- data/lib/rubygems/platform.rb +4 -3
- data/lib/rubygems/psych_tree.rb +4 -0
- data/lib/rubygems/query_utils.rb +1 -1
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/requirement.rb +0 -4
- data/lib/rubygems/resolver/composed_set.rb +3 -3
- data/lib/rubygems/resolver/git_set.rb +0 -1
- data/lib/rubygems/resolver/index_set.rb +2 -2
- data/lib/rubygems/resolver.rb +3 -3
- data/lib/rubygems/source/git.rb +13 -10
- data/lib/rubygems/spec_fetcher.rb +16 -5
- data/lib/rubygems/specification.rb +37 -31
- data/lib/rubygems/target_rbconfig.rb +50 -0
- data/lib/rubygems/uri.rb +1 -1
- data/lib/rubygems/util/licenses.rb +10 -1
- data/lib/rubygems/vendor/net-http/COPYING +56 -0
- data/lib/rubygems/vendor/net-http/lib/net/http/header.rb +1 -1
- data/lib/rubygems/vendor/net-http/lib/net/http/requests.rb +5 -0
- data/lib/rubygems/vendor/net-http/lib/net/http.rb +120 -36
- data/lib/rubygems/vendor/optparse/lib/optparse/ac.rb +16 -0
- data/lib/rubygems/vendor/optparse/lib/optparse/kwargs.rb +8 -3
- data/lib/rubygems/vendor/optparse/lib/optparse/version.rb +9 -0
- data/lib/rubygems/vendor/optparse/lib/optparse.rb +147 -51
- data/lib/rubygems/vendor/resolv/COPYING +56 -0
- data/lib/rubygems/vendor/resolv/lib/resolv.rb +50 -37
- data/lib/rubygems/vendor/securerandom/COPYING +56 -0
- data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +11 -5
- data/lib/rubygems/vendor/timeout/COPYING +56 -0
- data/lib/rubygems/vendor/timeout/lib/timeout.rb +9 -10
- data/lib/rubygems/vendor/uri/COPYING +56 -0
- data/lib/rubygems/vendor/uri/lib/uri/common.rb +37 -16
- data/lib/rubygems/vendor/uri/lib/uri/file.rb +3 -3
- data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +1 -1
- data/lib/rubygems/vendor/uri/lib/uri/generic.rb +16 -26
- data/lib/rubygems/vendor/uri/lib/uri/http.rb +2 -2
- data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
- data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/lib/rubygems/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/rubygems/vendor/uri/lib/uri.rb +9 -9
- data/lib/rubygems/vendored_securerandom.rb +0 -1
- data/lib/rubygems/version.rb +0 -4
- data/lib/rubygems.rb +30 -21
- data/rubygems-update.gemspec +5 -5
- data/setup.rb +1 -1
- metadata +36 -27
- data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
- data/bundler/lib/bundler/vendor/securerandom/LICENSE.txt +0 -22
- data/bundler/lib/bundler/vendor/securerandom/lib/random/formatter.rb +0 -373
- data/bundler/lib/bundler/vendor/uri/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/net-http/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/net-http/lib/net/http/backward.rb +0 -40
- data/lib/rubygems/vendor/resolv/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/securerandom/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/securerandom/lib/random/formatter.rb +0 -373
- data/lib/rubygems/vendor/timeout/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/uri/LICENSE.txt +0 -22
- /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
- /data/{bundler → doc/bundler}/UPGRADING.md +0 -0
- /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
data/bundler/lib/bundler/cli.rb
CHANGED
@@ -217,7 +217,7 @@ module Bundler
|
|
217
217
|
method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
|
218
218
|
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
219
219
|
method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
|
220
|
-
method_option "local", type: :boolean, banner:
|
220
|
+
method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
|
221
221
|
method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
|
222
222
|
method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
|
223
223
|
method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
|
@@ -227,8 +227,8 @@ module Bundler
|
|
227
227
|
method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
|
228
228
|
method_option "standalone", type: :array, lazy_default: [], banner: "Make a bundle that can work without the Bundler runtime"
|
229
229
|
method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
|
230
|
-
method_option "trust-policy", alias: "P", type: :string, banner:
|
231
|
-
|
230
|
+
method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of #{Bundler.rubygems.security_policy_keys.join("|")}"
|
231
|
+
method_option "target-rbconfig", type: :string, banner: "Path to rbconfig.rb for the deployment target platform"
|
232
232
|
method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
|
233
233
|
method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
|
234
234
|
def install
|
@@ -286,10 +286,8 @@ module Bundler
|
|
286
286
|
Show lists the names and versions of all gems that are required by your Gemfile.
|
287
287
|
Calling show with [GEM] will list the exact location of that gem on your machine.
|
288
288
|
D
|
289
|
-
method_option "paths", type: :boolean,
|
290
|
-
|
291
|
-
method_option "outdated", type: :boolean,
|
292
|
-
banner: "Show verbose output including whether gems are outdated."
|
289
|
+
method_option "paths", type: :boolean, banner: "List the paths of all gems that are required by your Gemfile."
|
290
|
+
method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
|
293
291
|
def show(gem_name = nil)
|
294
292
|
if ARGV.include?("--outdated")
|
295
293
|
message = "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement"
|
@@ -398,9 +396,7 @@ module Bundler
|
|
398
396
|
end
|
399
397
|
|
400
398
|
desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
|
401
|
-
method_option "all", type: :boolean,
|
402
|
-
default: Bundler.feature_flag.cache_all?,
|
403
|
-
banner: "Include all sources (including path and git)."
|
399
|
+
method_option "all", type: :boolean, default: Bundler.feature_flag.cache_all?, banner: "Include all sources (including path and git)."
|
404
400
|
method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
|
405
401
|
method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
|
406
402
|
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
@@ -438,8 +434,8 @@ module Bundler
|
|
438
434
|
map aliases_for("cache")
|
439
435
|
|
440
436
|
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
441
|
-
method_option :keep_file_descriptors, type: :boolean, default: true
|
442
|
-
method_option :gemfile, type: :string, required: false
|
437
|
+
method_option :keep_file_descriptors, type: :boolean, default: true, banner: "Passes all file descriptors to the new processes. Default is true, and setting it to false is deprecated"
|
438
|
+
method_option :gemfile, type: :string, required: false, banner: "Use the specified gemfile instead of Gemfile"
|
443
439
|
long_desc <<-D
|
444
440
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
445
441
|
bundle exec you can require and call the bundled gems as if they were installed
|
@@ -480,12 +476,10 @@ module Bundler
|
|
480
476
|
Open.new(options, name).run
|
481
477
|
end
|
482
478
|
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
Console.new(options, group).run
|
488
|
-
end
|
479
|
+
desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
|
480
|
+
def console(group = nil)
|
481
|
+
require_relative "cli/console"
|
482
|
+
Console.new(options, group).run
|
489
483
|
end
|
490
484
|
|
491
485
|
desc "version", "Prints Bundler version information"
|
@@ -537,55 +531,28 @@ module Bundler
|
|
537
531
|
end
|
538
532
|
end
|
539
533
|
|
540
|
-
old_gem = instance_method(:gem)
|
541
|
-
|
542
534
|
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
|
543
535
|
method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
|
544
536
|
method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
|
545
|
-
method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR",
|
546
|
-
lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
|
547
|
-
desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
|
537
|
+
method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR", lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
|
548
538
|
method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
|
549
539
|
method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
|
550
540
|
method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
|
551
541
|
method_option :rubocop, type: :boolean, desc: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
|
552
542
|
method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
|
553
|
-
method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library",
|
554
|
-
|
555
|
-
|
556
|
-
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "",
|
557
|
-
enum: %w[github gitlab circle],
|
558
|
-
desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
|
559
|
-
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "",
|
560
|
-
enum: %w[rubocop standard],
|
561
|
-
desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
|
543
|
+
method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library", enum: %w[rspec minitest test-unit], desc: "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
|
544
|
+
method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
|
545
|
+
method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
|
562
546
|
method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
|
563
547
|
|
564
548
|
def gem(name)
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
def gem_command.run(instance, args = [])
|
569
|
-
arity = 1 # name
|
549
|
+
require_relative "cli/gem"
|
550
|
+
cmd_args = args + [self]
|
551
|
+
cmd_args.unshift(options)
|
570
552
|
|
571
|
-
|
572
|
-
cmd_args = args + [instance]
|
573
|
-
cmd_args.unshift(instance.options)
|
574
|
-
|
575
|
-
cmd = begin
|
576
|
-
Gem.new(*cmd_args)
|
577
|
-
rescue ArgumentError => e
|
578
|
-
instance.class.handle_argument_error(self, e, args, arity)
|
579
|
-
end
|
580
|
-
|
581
|
-
cmd.run
|
582
|
-
end
|
553
|
+
Gem.new(*cmd_args).run
|
583
554
|
end
|
584
555
|
|
585
|
-
undef_method(:gem)
|
586
|
-
define_method(:gem, old_gem)
|
587
|
-
private :gem
|
588
|
-
|
589
556
|
def self.source_root
|
590
557
|
File.expand_path("templates", __dir__)
|
591
558
|
end
|
@@ -621,8 +588,10 @@ module Bundler
|
|
621
588
|
method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
|
622
589
|
method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
|
623
590
|
method_option "full-index", type: :boolean, default: false, banner: "Fall back to using the single-file index of all gems"
|
591
|
+
method_option "add-checksums", type: :boolean, default: false, banner: "Adds checksums to the lockfile"
|
624
592
|
method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
|
625
593
|
method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
|
594
|
+
method_option "normalize-platforms", type: :boolean, default: false, banner: "Normalize lockfile platforms"
|
626
595
|
method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
|
627
596
|
method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
|
628
597
|
method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
|
@@ -28,7 +28,6 @@ module Bundler
|
|
28
28
|
|
29
29
|
CacheFile.copy(local_path) do |file|
|
30
30
|
etag = etag_path.read.tap(&:chomp!) if etag_path.file?
|
31
|
-
etag ||= generate_etag(etag_path, file) # Remove this after 2.5.0 has been out for a while.
|
32
31
|
|
33
32
|
# Subtract a byte to ensure the range won't be empty.
|
34
33
|
# Avoids 416 (Range Not Satisfiable) responses.
|
@@ -67,16 +66,6 @@ module Bundler
|
|
67
66
|
etag_path.read.tap(&:chomp!) if etag_path.file?
|
68
67
|
end
|
69
68
|
|
70
|
-
# When first releasing this opaque etag feature, we want to generate the old MD5 etag
|
71
|
-
# based on the content of the file. After that it will always use the saved opaque etag.
|
72
|
-
# This transparently saves existing users with good caches from updating a bunch of files.
|
73
|
-
# Remove this behavior after 2.5.0 has been out for a while.
|
74
|
-
def generate_etag(etag_path, file)
|
75
|
-
etag = file.md5.hexdigest
|
76
|
-
CacheFile.write(etag_path, etag)
|
77
|
-
etag
|
78
|
-
end
|
79
|
-
|
80
69
|
def etag_from_response(response)
|
81
70
|
return unless response["ETag"]
|
82
71
|
etag = response["ETag"].delete_prefix("W/")
|
@@ -13,13 +13,13 @@ module Bundler
|
|
13
13
|
|
14
14
|
attr_reader(
|
15
15
|
:dependencies,
|
16
|
+
:locked_checksums,
|
16
17
|
:locked_deps,
|
17
18
|
:locked_gems,
|
18
19
|
:platforms,
|
19
20
|
:ruby_version,
|
20
21
|
:lockfile,
|
21
22
|
:gemfiles,
|
22
|
-
:locked_checksums,
|
23
23
|
:sources
|
24
24
|
)
|
25
25
|
|
@@ -89,6 +89,7 @@ module Bundler
|
|
89
89
|
@lockfile_contents = Bundler.read_file(lockfile)
|
90
90
|
@locked_gems = LockfileParser.new(@lockfile_contents)
|
91
91
|
@locked_platforms = @locked_gems.platforms
|
92
|
+
@most_specific_locked_platform = @locked_gems.most_specific_locked_platform
|
92
93
|
@platforms = @locked_platforms.dup
|
93
94
|
@locked_bundler_version = @locked_gems.bundler_version
|
94
95
|
@locked_ruby_version = @locked_gems.ruby_version
|
@@ -108,15 +109,16 @@ module Bundler
|
|
108
109
|
end
|
109
110
|
else
|
110
111
|
@unlock = {}
|
111
|
-
@platforms = []
|
112
112
|
@locked_gems = nil
|
113
|
+
@locked_platforms = []
|
114
|
+
@most_specific_locked_platform = nil
|
115
|
+
@platforms = []
|
113
116
|
@locked_deps = {}
|
114
117
|
@locked_specs = SpecSet.new([])
|
115
118
|
@originally_locked_deps = {}
|
116
119
|
@originally_locked_specs = @locked_specs
|
117
120
|
@locked_sources = []
|
118
|
-
@
|
119
|
-
@locked_checksums = Bundler.feature_flag.bundler_3_mode?
|
121
|
+
@locked_checksums = Bundler.feature_flag.lockfile_checksums?
|
120
122
|
end
|
121
123
|
|
122
124
|
locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
|
@@ -150,7 +152,7 @@ module Bundler
|
|
150
152
|
@gems_to_unlock = @explicit_unlocks.any? ? @explicit_unlocks : @dependencies.map(&:name)
|
151
153
|
else
|
152
154
|
eager_unlock = @explicit_unlocks.map {|name| Dependency.new(name, ">= 0") }
|
153
|
-
@gems_to_unlock = @locked_specs.for(eager_unlock,
|
155
|
+
@gems_to_unlock = @locked_specs.for(eager_unlock, platforms).map(&:name).uniq
|
154
156
|
end
|
155
157
|
|
156
158
|
@dependency_changes = converge_dependencies
|
@@ -175,16 +177,45 @@ module Bundler
|
|
175
177
|
resolve
|
176
178
|
end
|
177
179
|
|
180
|
+
#
|
181
|
+
# Setup sources according to the given options and the state of the
|
182
|
+
# definition.
|
183
|
+
#
|
184
|
+
# @return [Boolean] Whether fetching remote information will be necessary or not
|
185
|
+
#
|
186
|
+
def setup_domain!(options = {})
|
187
|
+
prefer_local! if options[:"prefer-local"]
|
188
|
+
|
189
|
+
if options[:add_checksums] || (!options[:local] && install_needed?)
|
190
|
+
remotely!
|
191
|
+
true
|
192
|
+
else
|
193
|
+
Bundler.settings.set_command_option(:jobs, 1) unless install_needed? # to avoid the overhead of Bundler::Worker
|
194
|
+
with_cache!
|
195
|
+
false
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
178
199
|
def resolve_with_cache!
|
200
|
+
with_cache!
|
201
|
+
|
202
|
+
resolve
|
203
|
+
end
|
204
|
+
|
205
|
+
def with_cache!
|
179
206
|
sources.local!
|
180
207
|
sources.cached!
|
181
|
-
resolve
|
182
208
|
end
|
183
209
|
|
184
210
|
def resolve_remotely!
|
211
|
+
remotely!
|
212
|
+
|
213
|
+
resolve
|
214
|
+
end
|
215
|
+
|
216
|
+
def remotely!
|
185
217
|
sources.cached!
|
186
218
|
sources.remote!
|
187
|
-
resolve
|
188
219
|
end
|
189
220
|
|
190
221
|
def prefer_local!
|
@@ -210,7 +241,7 @@ module Bundler
|
|
210
241
|
end
|
211
242
|
|
212
243
|
def missing_specs
|
213
|
-
resolve.
|
244
|
+
resolve.missing_specs_for(requested_dependencies)
|
214
245
|
end
|
215
246
|
|
216
247
|
def missing_specs?
|
@@ -274,11 +305,7 @@ module Bundler
|
|
274
305
|
groups.map!(&:to_sym)
|
275
306
|
deps = current_dependencies # always returns a new array
|
276
307
|
deps.select! do |d|
|
277
|
-
|
278
|
-
d.groups.intersect?(groups)
|
279
|
-
else
|
280
|
-
!(d.groups & groups).empty?
|
281
|
-
end
|
308
|
+
d.groups.intersect?(groups)
|
282
309
|
end
|
283
310
|
deps
|
284
311
|
end
|
@@ -316,11 +343,11 @@ module Bundler
|
|
316
343
|
end
|
317
344
|
|
318
345
|
def spec_git_paths
|
319
|
-
sources.git_sources.
|
346
|
+
sources.git_sources.filter_map {|s| File.realpath(s.path) if File.exist?(s.path) }
|
320
347
|
end
|
321
348
|
|
322
349
|
def groups
|
323
|
-
dependencies.
|
350
|
+
dependencies.flat_map(&:groups).uniq
|
324
351
|
end
|
325
352
|
|
326
353
|
def lock(file_or_preserve_unknown_sections = false, preserve_unknown_sections_or_unused = false)
|
@@ -465,6 +492,12 @@ module Bundler
|
|
465
492
|
"Add the current platform to the lockfile with\n`bundle lock --add-platform #{local_platform}` and try again."
|
466
493
|
end
|
467
494
|
|
495
|
+
def normalize_platforms
|
496
|
+
@platforms = resolve.normalize_platforms!(current_dependencies, platforms)
|
497
|
+
|
498
|
+
@resolve = SpecSet.new(resolve.for(current_dependencies, @platforms))
|
499
|
+
end
|
500
|
+
|
468
501
|
def add_platform(platform)
|
469
502
|
return if @platforms.include?(platform)
|
470
503
|
|
@@ -479,29 +512,12 @@ module Bundler
|
|
479
512
|
raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}"
|
480
513
|
end
|
481
514
|
|
482
|
-
def most_specific_locked_platform
|
483
|
-
@platforms.min_by do |bundle_platform|
|
484
|
-
platform_specificity_match(bundle_platform, local_platform)
|
485
|
-
end
|
486
|
-
end
|
487
|
-
|
488
515
|
def nothing_changed?
|
489
|
-
|
490
|
-
|
491
|
-
!@source_changes &&
|
492
|
-
!@dependency_changes &&
|
493
|
-
!@current_platform_missing &&
|
494
|
-
@new_platforms.empty? &&
|
495
|
-
!@path_changes &&
|
496
|
-
!@local_changes &&
|
497
|
-
!@missing_lockfile_dep &&
|
498
|
-
!@unlocking_bundler &&
|
499
|
-
!@locked_spec_with_missing_deps &&
|
500
|
-
!@locked_spec_with_invalid_deps
|
516
|
+
!something_changed?
|
501
517
|
end
|
502
518
|
|
503
519
|
def no_resolve_needed?
|
504
|
-
!
|
520
|
+
!resolve_needed?
|
505
521
|
end
|
506
522
|
|
507
523
|
def unlocking?
|
@@ -510,8 +526,39 @@ module Bundler
|
|
510
526
|
|
511
527
|
attr_writer :source_requirements
|
512
528
|
|
529
|
+
def add_checksums
|
530
|
+
@locked_checksums = true
|
531
|
+
|
532
|
+
setup_domain!(add_checksums: true)
|
533
|
+
|
534
|
+
specs # force materialization to real specifications, so that checksums are fetched
|
535
|
+
end
|
536
|
+
|
513
537
|
private
|
514
538
|
|
539
|
+
def install_needed?
|
540
|
+
resolve_needed? || missing_specs?
|
541
|
+
end
|
542
|
+
|
543
|
+
def something_changed?
|
544
|
+
return true unless lockfile_exists?
|
545
|
+
|
546
|
+
@source_changes ||
|
547
|
+
@dependency_changes ||
|
548
|
+
@current_platform_missing ||
|
549
|
+
@new_platforms.any? ||
|
550
|
+
@path_changes ||
|
551
|
+
@local_changes ||
|
552
|
+
@missing_lockfile_dep ||
|
553
|
+
@unlocking_bundler ||
|
554
|
+
@locked_spec_with_missing_deps ||
|
555
|
+
@locked_spec_with_invalid_deps
|
556
|
+
end
|
557
|
+
|
558
|
+
def resolve_needed?
|
559
|
+
unlocking? || something_changed?
|
560
|
+
end
|
561
|
+
|
515
562
|
def should_add_extra_platforms?
|
516
563
|
!lockfile_exists? && generic_local_platform_is_ruby? && !Bundler.settings[:force_ruby_platform]
|
517
564
|
end
|
@@ -555,7 +602,7 @@ module Bundler
|
|
555
602
|
end
|
556
603
|
|
557
604
|
def resolver
|
558
|
-
@resolver ||= Resolver.new(resolution_packages, gem_version_promoter)
|
605
|
+
@resolver ||= Resolver.new(resolution_packages, gem_version_promoter, @most_specific_locked_platform)
|
559
606
|
end
|
560
607
|
|
561
608
|
def expanded_dependencies
|
@@ -564,7 +611,7 @@ module Bundler
|
|
564
611
|
|
565
612
|
def dependencies_with_bundler
|
566
613
|
return dependencies unless @unlocking_bundler
|
567
|
-
return dependencies if dependencies.
|
614
|
+
return dependencies if dependencies.any? {|d| d.name == "bundler" }
|
568
615
|
|
569
616
|
[Dependency.new("bundler", @unlocking_bundler)] + dependencies
|
570
617
|
end
|
@@ -580,22 +627,46 @@ module Bundler
|
|
580
627
|
end
|
581
628
|
end
|
582
629
|
|
583
|
-
def filter_specs(specs, deps)
|
584
|
-
SpecSet.new(specs).for(deps,
|
630
|
+
def filter_specs(specs, deps, skips: [])
|
631
|
+
SpecSet.new(specs).for(deps, platforms, skips: skips)
|
585
632
|
end
|
586
633
|
|
587
634
|
def materialize(dependencies)
|
588
|
-
|
589
|
-
|
635
|
+
# Tracks potential endless loops trying to re-resolve.
|
636
|
+
# TODO: Remove as dead code if not reports are received in a while
|
637
|
+
incorrect_spec = nil
|
638
|
+
|
639
|
+
specs = begin
|
640
|
+
resolve.materialize(dependencies)
|
641
|
+
rescue IncorrectLockfileDependencies => e
|
642
|
+
spec = e.spec
|
643
|
+
raise "Infinite loop while fixing lockfile dependencies" if incorrect_spec == spec
|
644
|
+
|
645
|
+
incorrect_spec = spec
|
646
|
+
reresolve_without([spec])
|
647
|
+
retry
|
648
|
+
end
|
649
|
+
|
650
|
+
missing_specs = resolve.missing_specs
|
590
651
|
|
591
652
|
if missing_specs.any?
|
592
653
|
missing_specs.each do |s|
|
593
654
|
locked_gem = @locked_specs[s.name].last
|
594
655
|
next if locked_gem.nil? || locked_gem.version != s.version || sources.local_mode?
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
656
|
+
|
657
|
+
message = if sources.implicit_global_source?
|
658
|
+
"Because your Gemfile specifies no global remote source, your bundle is locked to " \
|
659
|
+
"#{locked_gem} from #{locked_gem.source}. However, #{locked_gem} is not installed. You'll " \
|
660
|
+
"need to either add a global remote source to your Gemfile or make sure #{locked_gem} is " \
|
661
|
+
"available locally before rerunning Bundler."
|
662
|
+
else
|
663
|
+
"Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
|
664
|
+
"no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
|
665
|
+
"You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
|
666
|
+
"removed in order to install."
|
667
|
+
end
|
668
|
+
|
669
|
+
raise GemNotFound, message
|
599
670
|
end
|
600
671
|
|
601
672
|
missing_specs_list = missing_specs.group_by(&:source).map do |source, missing_specs_for_source|
|
@@ -605,17 +676,24 @@ module Bundler
|
|
605
676
|
raise GemNotFound, "Could not find #{missing_specs_list.join(" nor ")}"
|
606
677
|
end
|
607
678
|
|
608
|
-
|
679
|
+
partially_missing_specs = resolve.partially_missing_specs
|
680
|
+
|
681
|
+
if partially_missing_specs.any? && !sources.local_mode?
|
682
|
+
Bundler.ui.warn "Some locked specs have possibly been yanked (#{partially_missing_specs.map(&:full_name).join(", ")}). Ignoring them..."
|
683
|
+
|
684
|
+
resolve.delete(partially_missing_specs)
|
685
|
+
end
|
686
|
+
|
687
|
+
incomplete_specs = resolve.incomplete_specs
|
609
688
|
loop do
|
610
689
|
break if incomplete_specs.empty?
|
611
690
|
|
612
691
|
Bundler.ui.debug("The lockfile does not have all gems needed for the current platform though, Bundler will still re-resolve dependencies")
|
613
692
|
sources.remote!
|
614
|
-
|
615
|
-
@resolve = start_resolution
|
693
|
+
reresolve_without(incomplete_specs)
|
616
694
|
specs = resolve.materialize(dependencies)
|
617
695
|
|
618
|
-
still_incomplete_specs =
|
696
|
+
still_incomplete_specs = resolve.incomplete_specs
|
619
697
|
|
620
698
|
if still_incomplete_specs == incomplete_specs
|
621
699
|
package = resolution_packages.get_package(incomplete_specs.first.name)
|
@@ -625,12 +703,26 @@ module Bundler
|
|
625
703
|
incomplete_specs = still_incomplete_specs
|
626
704
|
end
|
627
705
|
|
706
|
+
insecurely_materialized_specs = resolve.insecurely_materialized_specs
|
707
|
+
|
708
|
+
if insecurely_materialized_specs.any?
|
709
|
+
Bundler.ui.warn "The following platform specific gems are getting installed, yet the lockfile includes only their generic ruby version:\n" \
|
710
|
+
" * #{insecurely_materialized_specs.map(&:full_name).join("\n * ")}\n" \
|
711
|
+
"Please run `bundle lock --normalize-platforms` and commit the resulting lockfile.\n" \
|
712
|
+
"Alternatively, you may run `bundle lock --add-platform <list-of-platforms-that-you-want-to-support>`"
|
713
|
+
end
|
714
|
+
|
628
715
|
bundler = sources.metadata_source.specs.search(["bundler", Bundler.gem_version]).last
|
629
716
|
specs["bundler"] = bundler
|
630
717
|
|
631
718
|
specs
|
632
719
|
end
|
633
720
|
|
721
|
+
def reresolve_without(incomplete_specs)
|
722
|
+
resolution_packages.delete(incomplete_specs)
|
723
|
+
@resolve = start_resolution
|
724
|
+
end
|
725
|
+
|
634
726
|
def start_resolution
|
635
727
|
local_platform_needed_for_resolvability = @most_specific_non_local_locked_ruby_platform && !@platforms.include?(local_platform)
|
636
728
|
@platforms << local_platform if local_platform_needed_for_resolvability
|
@@ -650,7 +742,7 @@ module Bundler
|
|
650
742
|
|
651
743
|
@platforms = result.add_extra_platforms!(platforms) if should_add_extra_platforms?
|
652
744
|
|
653
|
-
SpecSet.new(result.for(dependencies,
|
745
|
+
SpecSet.new(result.for(dependencies, @platforms))
|
654
746
|
end
|
655
747
|
|
656
748
|
def precompute_source_requirements_for_indirect_dependencies?
|
@@ -676,7 +768,7 @@ module Bundler
|
|
676
768
|
def find_most_specific_locked_ruby_platform
|
677
769
|
return unless generic_local_platform_is_ruby? && current_platform_locked?
|
678
770
|
|
679
|
-
most_specific_locked_platform
|
771
|
+
@most_specific_locked_platform
|
680
772
|
end
|
681
773
|
|
682
774
|
def change_reason
|
@@ -877,7 +969,7 @@ module Bundler
|
|
877
969
|
def converge_locked_specs
|
878
970
|
converged = converge_specs(@locked_specs)
|
879
971
|
|
880
|
-
resolve = SpecSet.new(converged
|
972
|
+
resolve = SpecSet.new(converged)
|
881
973
|
|
882
974
|
diff = nil
|
883
975
|
|
@@ -906,8 +998,7 @@ module Bundler
|
|
906
998
|
if dep
|
907
999
|
gemfile_source = dep.source || default_source
|
908
1000
|
|
909
|
-
deps << dep if !dep.source || lockfile_source.include?(dep.source)
|
910
|
-
@gems_to_unlock << name if lockfile_source.include?(dep.source) && lockfile_source != gemfile_source
|
1001
|
+
deps << dep if !dep.source || lockfile_source.include?(dep.source) || new_deps.include?(dep)
|
911
1002
|
|
912
1003
|
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
913
1004
|
s.source = gemfile_source
|
@@ -916,25 +1007,14 @@ module Bundler
|
|
916
1007
|
s.source = default_source unless sources.get(lockfile_source)
|
917
1008
|
end
|
918
1009
|
|
919
|
-
|
1010
|
+
source = s.source
|
1011
|
+
next if @sources_to_unlock.include?(source.name)
|
920
1012
|
|
921
1013
|
# Path sources have special logic
|
922
|
-
if
|
923
|
-
|
924
|
-
s.source.specs
|
925
|
-
rescue PathError
|
926
|
-
# if we won't need the source (according to the lockfile),
|
927
|
-
# don't error if the path source isn't available
|
928
|
-
next if specs.
|
929
|
-
for(requested_dependencies, false).
|
930
|
-
none? {|locked_spec| locked_spec.source == s.source }
|
931
|
-
|
932
|
-
raise
|
933
|
-
end
|
934
|
-
|
935
|
-
new_spec = new_specs[s].first
|
1014
|
+
if source.instance_of?(Source::Path) || source.instance_of?(Source::Gemspec) || (source.instance_of?(Source::Git) && !@gems_to_unlock.include?(name) && deps.include?(dep))
|
1015
|
+
new_spec = source.specs[s].first
|
936
1016
|
if new_spec
|
937
|
-
s.
|
1017
|
+
s.runtime_dependencies.replace(new_spec.runtime_dependencies)
|
938
1018
|
else
|
939
1019
|
# If the spec is no longer in the path source, unlock it. This
|
940
1020
|
# commonly happens if the version changed in the gemspec
|
@@ -942,14 +1022,15 @@ module Bundler
|
|
942
1022
|
end
|
943
1023
|
end
|
944
1024
|
|
945
|
-
if dep.nil? && requested_dependencies.find {|d| name == d.name }
|
946
|
-
@gems_to_unlock <<
|
947
|
-
|
948
|
-
converged << s
|
1025
|
+
if dep.nil? && requested_dep = requested_dependencies.find {|d| name == d.name }
|
1026
|
+
@gems_to_unlock << name
|
1027
|
+
deps << requested_dep
|
949
1028
|
end
|
1029
|
+
|
1030
|
+
converged << s
|
950
1031
|
end
|
951
1032
|
|
952
|
-
filter_specs(converged, deps)
|
1033
|
+
filter_specs(converged, deps, skips: @gems_to_unlock)
|
953
1034
|
end
|
954
1035
|
|
955
1036
|
def metadata_dependencies
|
data/bundler/lib/bundler/dsl.rb
CHANGED
@@ -66,7 +66,7 @@ module Bundler
|
|
66
66
|
development_group = opts[:development_group] || :development
|
67
67
|
expanded_path = gemfile_root.join(path)
|
68
68
|
|
69
|
-
gemspecs = Gem::Util.glob_files_in_dir("{,*}.gemspec", expanded_path).
|
69
|
+
gemspecs = Gem::Util.glob_files_in_dir("{,*}.gemspec", expanded_path).filter_map {|g| Bundler.load_gemspec(g) }
|
70
70
|
gemspecs.reject! {|s| s.name != name } if name
|
71
71
|
specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] }
|
72
72
|
|
@@ -503,18 +503,7 @@ module Bundler
|
|
503
503
|
end
|
504
504
|
|
505
505
|
def check_rubygems_source_safety
|
506
|
-
if @sources.
|
507
|
-
implicit_global_source_warning
|
508
|
-
elsif @sources.aggregate_global_source?
|
509
|
-
multiple_global_source_warning
|
510
|
-
end
|
511
|
-
end
|
512
|
-
|
513
|
-
def implicit_global_source_warning
|
514
|
-
Bundler::SharedHelpers.major_deprecation 2, "This Gemfile does not include an explicit global source. " \
|
515
|
-
"Not using an explicit global source may result in a different lockfile being generated depending on " \
|
516
|
-
"the gems you have installed locally before bundler is run. " \
|
517
|
-
"Instead, define a global source in your Gemfile like this: source \"https://rubygems.org\"."
|
506
|
+
multiple_global_source_warning if @sources.aggregate_global_source?
|
518
507
|
end
|
519
508
|
|
520
509
|
def multiple_global_source_warning
|