bundler 2.2.0.rc.1 → 2.2.3
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 +786 -690
- data/lib/bundler.rb +17 -3
- data/lib/bundler/build_metadata.rb +3 -11
- data/lib/bundler/cli.rb +31 -15
- data/lib/bundler/cli/add.rb +1 -1
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +1 -7
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +14 -0
- data/lib/bundler/cli/doctor.rb +1 -1
- data/lib/bundler/cli/exec.rb +4 -4
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +1 -1
- data/lib/bundler/cli/info.rb +2 -1
- data/lib/bundler/cli/init.rb +1 -1
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +18 -7
- data/lib/bundler/cli/list.rb +1 -1
- data/lib/bundler/cli/outdated.rb +1 -3
- data/lib/bundler/cli/pristine.rb +1 -1
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +3 -1
- data/lib/bundler/compact_index_client.rb +1 -1
- data/lib/bundler/compact_index_client/cache.rb +6 -14
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +5 -5
- data/lib/bundler/definition.rb +49 -60
- data/lib/bundler/dep_proxy.rb +1 -1
- data/lib/bundler/dependency.rb +3 -1
- data/lib/bundler/dsl.rb +4 -4
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/feature_flag.rb +0 -1
- data/lib/bundler/fetcher.rb +3 -3
- data/lib/bundler/fetcher/base.rb +1 -1
- data/lib/bundler/fetcher/compact_index.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +1 -1
- data/lib/bundler/fetcher/index.rb +3 -4
- data/lib/bundler/friendly_errors.rb +18 -3
- data/lib/bundler/gem_helper.rb +17 -9
- data/lib/bundler/gem_helpers.rb +36 -25
- data/lib/bundler/gem_version_promoter.rb +1 -1
- data/lib/bundler/graph.rb +1 -1
- data/lib/bundler/index.rb +6 -2
- data/lib/bundler/injector.rb +10 -3
- data/lib/bundler/installer.rb +8 -6
- data/lib/bundler/installer/gem_installer.rb +1 -1
- data/lib/bundler/installer/parallel_installer.rb +1 -1
- data/lib/bundler/installer/standalone.rb +2 -2
- data/lib/bundler/lazy_specification.rb +22 -11
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +1 -1
- data/lib/bundler/man/.document +1 -0
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +0 -0
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
- data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +0 -0
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +14 -21
- data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +0 -0
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +0 -0
- data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +25 -3
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +0 -0
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
- data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +0 -0
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +0 -0
- data/{man → lib/bundler/man}/gemfile.5.ronn +4 -4
- data/lib/bundler/mirror.rb +2 -2
- data/lib/bundler/plugin.rb +5 -6
- data/lib/bundler/plugin/api/source.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +1 -1
- data/lib/bundler/plugin/installer.rb +1 -1
- data/lib/bundler/plugin/installer/rubygems.rb +1 -1
- data/lib/bundler/plugin/source_list.rb +1 -1
- data/lib/bundler/remote_specification.rb +1 -1
- data/lib/bundler/resolver.rb +26 -30
- data/lib/bundler/resolver/spec_group.rb +21 -27
- data/lib/bundler/retry.rb +1 -1
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +46 -1
- data/lib/bundler/rubygems_gem_installer.rb +2 -2
- data/lib/bundler/rubygems_integration.rb +22 -12
- data/lib/bundler/runtime.rb +2 -2
- data/lib/bundler/settings.rb +49 -43
- data/lib/bundler/shared_helpers.rb +1 -1
- data/lib/bundler/similarity_detector.rb +1 -1
- data/lib/bundler/source.rb +1 -1
- data/lib/bundler/source/git.rb +1 -1
- data/lib/bundler/source/git/git_proxy.rb +5 -3
- data/lib/bundler/source/path.rb +2 -2
- data/lib/bundler/source/path/installer.rb +1 -1
- data/lib/bundler/source/rubygems.rb +2 -2
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source_list.rb +2 -2
- data/lib/bundler/spec_set.rb +7 -9
- data/lib/bundler/stub_specification.rb +1 -3
- data/lib/bundler/templates/newgem/README.md.tt +1 -2
- data/lib/bundler/templates/newgem/bin/console.tt +1 -2
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +0 -1
- data/lib/bundler/ui/shell.rb +5 -5
- data/lib/bundler/uri_credentials_filter.rb +3 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +38 -40
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +8 -1
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendored_persistent.rb +0 -7
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +1 -1
- data/lib/bundler/yaml_serializer.rb +1 -1
- data/man/bundle-add.1 +1 -1
- data/man/bundle-binstubs.1 +5 -3
- data/man/bundle-cache.1 +1 -1
- data/man/bundle-check.1 +1 -1
- data/man/bundle-clean.1 +1 -1
- data/man/bundle-config.1 +14 -17
- data/man/bundle-doctor.1 +1 -1
- data/man/bundle-exec.1 +1 -1
- data/man/bundle-gem.1 +1 -1
- data/man/bundle-info.1 +1 -1
- data/man/bundle-init.1 +1 -1
- data/man/bundle-inject.1 +1 -1
- data/man/bundle-install.1 +30 -3
- data/man/bundle-list.1 +1 -1
- data/man/bundle-lock.1 +1 -1
- data/man/bundle-open.1 +1 -1
- data/man/bundle-outdated.1 +1 -1
- data/man/bundle-platform.1 +1 -1
- data/man/bundle-pristine.1 +1 -1
- data/man/bundle-remove.1 +1 -1
- data/man/bundle-show.1 +1 -1
- data/man/bundle-update.1 +1 -1
- data/man/bundle-viz.1 +1 -1
- data/man/bundle.1 +1 -1
- data/man/gemfile.5 +4 -4
- metadata +33 -54
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/man/bundle-add.1.txt +0 -58
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-cache.1.txt +0 -78
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -527
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -181
- data/man/bundle-gem.1.txt +0 -117
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -401
- data/man/bundle-list.1.txt +0 -44
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -391
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -651
data/lib/bundler.rb
CHANGED
@@ -212,6 +212,12 @@ module Bundler
|
|
212
212
|
end
|
213
213
|
end
|
214
214
|
|
215
|
+
def most_specific_locked_platform?(platform)
|
216
|
+
return false unless defined?(@definition) && @definition
|
217
|
+
|
218
|
+
definition.most_specific_locked_platform == platform
|
219
|
+
end
|
220
|
+
|
215
221
|
def ruby_scope
|
216
222
|
"#{Bundler.rubygems.ruby_engine}/#{RbConfig::CONFIG["ruby_version"]}"
|
217
223
|
end
|
@@ -353,7 +359,10 @@ EOF
|
|
353
359
|
env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
|
354
360
|
|
355
361
|
if env.key?("RUBYOPT")
|
356
|
-
|
362
|
+
rubyopt = env["RUBYOPT"].split(" ")
|
363
|
+
rubyopt.delete("-r#{File.expand_path("bundler/setup", __dir__)}")
|
364
|
+
rubyopt.delete("-rbundler/setup")
|
365
|
+
env["RUBYOPT"] = rubyopt.join(" ")
|
357
366
|
end
|
358
367
|
|
359
368
|
if env.key?("RUBYLIB")
|
@@ -453,7 +462,7 @@ EOF
|
|
453
462
|
# system binaries. If you put '-n foo' in your .gemrc, RubyGems will
|
454
463
|
# install binstubs there instead. Unfortunately, RubyGems doesn't expose
|
455
464
|
# that directory at all, so rather than parse .gemrc ourselves, we allow
|
456
|
-
# the directory to be set as well, via `bundle config set bindir foo`.
|
465
|
+
# the directory to be set as well, via `bundle config set --local bindir foo`.
|
457
466
|
Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
|
458
467
|
end
|
459
468
|
|
@@ -599,6 +608,11 @@ EOF
|
|
599
608
|
reset_rubygems!
|
600
609
|
end
|
601
610
|
|
611
|
+
def reset_settings_and_root!
|
612
|
+
@settings = nil
|
613
|
+
@root = nil
|
614
|
+
end
|
615
|
+
|
602
616
|
def reset_paths!
|
603
617
|
@bin_path = nil
|
604
618
|
@bundler_major_version = nil
|
@@ -621,7 +635,7 @@ EOF
|
|
621
635
|
@rubygems = nil
|
622
636
|
end
|
623
637
|
|
624
|
-
|
638
|
+
private
|
625
639
|
|
626
640
|
def eval_yaml_gemspec(path, contents)
|
627
641
|
require_relative "bundler/psyched_yaml"
|
@@ -4,8 +4,8 @@ module Bundler
|
|
4
4
|
# Represents metadata from when the Bundler gem was built.
|
5
5
|
module BuildMetadata
|
6
6
|
# begin ivars
|
7
|
-
@built_at = "2020-
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2020-12-22".freeze
|
8
|
+
@git_commit_sha = "29dc3c8398".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
@@ -29,19 +29,11 @@ module Bundler
|
|
29
29
|
|
30
30
|
# If Bundler has been installed without its .git directory and without a
|
31
31
|
# commit instance variable then we can't determine its commits SHA.
|
32
|
-
git_dir = File.join(File.expand_path("
|
32
|
+
git_dir = File.join(File.expand_path("../../../..", __FILE__), ".git")
|
33
33
|
if File.directory?(git_dir)
|
34
34
|
return @git_commit_sha = Dir.chdir(git_dir) { `git rev-parse --short HEAD`.strip.freeze }
|
35
35
|
end
|
36
36
|
|
37
|
-
# If Bundler is a submodule in RubyGems, get the submodule commit
|
38
|
-
git_sub_dir = File.join(File.expand_path("../../../..", __FILE__), ".git")
|
39
|
-
if File.directory?(git_sub_dir)
|
40
|
-
return @git_commit_sha = Dir.chdir(git_sub_dir) do
|
41
|
-
`git ls-tree --abbrev=8 HEAD bundler`.split(/\s/).fetch(2, "").strip.freeze
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
37
|
@git_commit_sha ||= "unknown"
|
46
38
|
end
|
47
39
|
|
data/lib/bundler/cli.rb
CHANGED
@@ -57,7 +57,7 @@ module Bundler
|
|
57
57
|
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
|
58
58
|
if custom_gemfile && !custom_gemfile.empty?
|
59
59
|
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
|
60
|
-
Bundler.
|
60
|
+
Bundler.reset_settings_and_root!
|
61
61
|
end
|
62
62
|
|
63
63
|
Bundler.settings.set_command_option_if_given :retry, options[:retry]
|
@@ -134,7 +134,8 @@ module Bundler
|
|
134
134
|
if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
|
135
135
|
Kernel.exec "man #{man_page}"
|
136
136
|
else
|
137
|
-
|
137
|
+
fallback_man_path = File.expand_path("../man", __FILE__)
|
138
|
+
puts File.read("#{fallback_man_path}/#{File.basename(man_page)}.ronn")
|
138
139
|
end
|
139
140
|
elsif command_path = Bundler.which("bundler-#{cli}")
|
140
141
|
Kernel.exec(command_path, "--help")
|
@@ -380,6 +381,8 @@ module Bundler
|
|
380
381
|
"Make binstubs that can work without the Bundler runtime"
|
381
382
|
method_option "all", :type => :boolean, :banner =>
|
382
383
|
"Install binstubs for all gems"
|
384
|
+
method_option "all-platforms", :type => :boolean, :default => false, :banner =>
|
385
|
+
"Install binstubs for all platforms"
|
383
386
|
def binstubs(*gems)
|
384
387
|
require_relative "cli/binstubs"
|
385
388
|
Binstubs.new(options, gems).run
|
@@ -439,11 +442,18 @@ module Bundler
|
|
439
442
|
Outdated.new(options, gems).run
|
440
443
|
end
|
441
444
|
|
442
|
-
desc "
|
443
|
-
|
444
|
-
|
445
|
-
|
445
|
+
desc "fund [OPTIONS]", "Lists information about gems seeking funding assistance"
|
446
|
+
method_option "group", :aliases => "-g", :type => :array, :banner =>
|
447
|
+
"Fetch funding information for a specific group"
|
448
|
+
def fund
|
449
|
+
require_relative "cli/fund"
|
450
|
+
Fund.new(options).run
|
446
451
|
end
|
452
|
+
|
453
|
+
desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
|
454
|
+
method_option "all", :type => :boolean,
|
455
|
+
:default => Bundler.feature_flag.cache_all?,
|
456
|
+
:banner => "Include all sources (including path and git)."
|
447
457
|
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
|
448
458
|
method_option "cache-path", :type => :string, :banner =>
|
449
459
|
"Specify a different cache path than the default (vendor/cache)."
|
@@ -462,6 +472,12 @@ module Bundler
|
|
462
472
|
bundle without having to download any additional gems.
|
463
473
|
D
|
464
474
|
def cache
|
475
|
+
SharedHelpers.major_deprecation 2,
|
476
|
+
"The `--all` flag is deprecated because it relies on being " \
|
477
|
+
"remembered across bundler invocations, which bundler will no longer " \
|
478
|
+
"do in future versions. Instead please use `bundle config set cache_all true`, " \
|
479
|
+
"and stop using this flag" if ARGV.include?("--all")
|
480
|
+
|
465
481
|
require_relative "cli/cache"
|
466
482
|
Cache.new(options).run
|
467
483
|
end
|
@@ -565,18 +581,18 @@ module Bundler
|
|
565
581
|
|
566
582
|
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
|
567
583
|
method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
|
568
|
-
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set gem.coc true`."
|
584
|
+
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
|
569
585
|
method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
|
570
586
|
:lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
|
571
587
|
:desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
|
572
588
|
method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
|
573
589
|
method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
|
574
|
-
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set gem.mit true`."
|
575
|
-
method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set gem.rubocop true`."
|
590
|
+
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
|
591
|
+
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`."
|
576
592
|
method_option :test, :type => :string, :lazy_default => Bundler.settings["gem.test"] || "", :aliases => "-t", :banner => "Use the specified test framework for your library",
|
577
|
-
:desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set gem.test (rspec|minitest|test-unit)`."
|
593
|
+
: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)`."
|
578
594
|
method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
|
579
|
-
:desc => "Generate CI configuration, either GitHub Actions, Travis CI, GitLab CI or CircleCI. Set a default with `bundle config set gem.ci (github|travis|gitlab|circle)`"
|
595
|
+
:desc => "Generate CI configuration, either GitHub Actions, Travis CI, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|travis|gitlab|circle)`"
|
580
596
|
|
581
597
|
def gem(name)
|
582
598
|
end
|
@@ -740,11 +756,11 @@ module Bundler
|
|
740
756
|
end
|
741
757
|
end
|
742
758
|
|
743
|
-
|
759
|
+
private
|
744
760
|
|
745
761
|
# Automatically invoke `bundle install` and resume if
|
746
762
|
# Bundler.settings[:auto_install] exists. This is set through config cmd
|
747
|
-
# `bundle config set auto_install 1`.
|
763
|
+
# `bundle config set --global auto_install 1`.
|
748
764
|
#
|
749
765
|
# Note that this method `nil`s out the global Definition object, so it
|
750
766
|
# should be called first, before you instantiate anything like an
|
@@ -839,10 +855,10 @@ module Bundler
|
|
839
855
|
value = options[name]
|
840
856
|
value = value.join(" ").to_s if option.type == :array
|
841
857
|
|
842
|
-
Bundler::SharedHelpers.major_deprecation 2
|
858
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
843
859
|
"The `#{flag_name}` flag is deprecated because it relies on being " \
|
844
860
|
"remembered across bundler invocations, which bundler will no longer " \
|
845
|
-
"do in future versions. Instead please use `bundle config set #{name.tr("-", "_")} " \
|
861
|
+
"do in future versions. Instead please use `bundle config set --local #{name.tr("-", "_")} " \
|
846
862
|
"'#{value}'`, and stop using this flag"
|
847
863
|
end
|
848
864
|
end
|
data/lib/bundler/cli/add.rb
CHANGED
data/lib/bundler/cli/binstubs.rb
CHANGED
@@ -16,7 +16,11 @@ module Bundler
|
|
16
16
|
Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
|
17
17
|
installer = Installer.new(Bundler.root, Bundler.definition)
|
18
18
|
|
19
|
-
installer_opts = {
|
19
|
+
installer_opts = {
|
20
|
+
:force => options[:force],
|
21
|
+
:binstubs_cmd => true,
|
22
|
+
:all_platforms => options["all-platforms"],
|
23
|
+
}
|
20
24
|
|
21
25
|
if options[:all]
|
22
26
|
raise InvalidOption, "Cannot specify --all with specific gems" unless gems.empty?
|
@@ -38,7 +42,7 @@ module Bundler
|
|
38
42
|
if options[:standalone]
|
39
43
|
next Bundler.ui.warn("Sorry, Bundler can only be run via RubyGems.") if gem_name == "bundler"
|
40
44
|
Bundler.settings.temporary(:path => (Bundler.settings[:path] || Bundler.root)) do
|
41
|
-
installer.generate_standalone_bundler_executable_stubs(spec)
|
45
|
+
installer.generate_standalone_bundler_executable_stubs(spec, installer_opts)
|
42
46
|
end
|
43
47
|
else
|
44
48
|
installer.generate_bundler_executable_stubs(spec, installer_opts)
|
data/lib/bundler/cli/cache.rb
CHANGED
@@ -24,7 +24,7 @@ module Bundler
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
|
27
|
+
private
|
28
28
|
|
29
29
|
def install
|
30
30
|
require_relative "install"
|
@@ -37,12 +37,6 @@ module Bundler
|
|
37
37
|
all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil)
|
38
38
|
|
39
39
|
Bundler.settings.set_command_option_if_given :cache_all, all
|
40
|
-
|
41
|
-
if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.cache_all?
|
42
|
-
Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
|
43
|
-
"to cache them as well, please pass the --all flag. This will be the default " \
|
44
|
-
"on Bundler 3.0."
|
45
|
-
end
|
46
40
|
end
|
47
41
|
end
|
48
42
|
end
|
data/lib/bundler/cli/clean.rb
CHANGED
data/lib/bundler/cli/common.rb
CHANGED
@@ -14,6 +14,20 @@ module Bundler
|
|
14
14
|
Bundler.ui.info msg
|
15
15
|
end
|
16
16
|
|
17
|
+
def self.output_fund_metadata_summary
|
18
|
+
definition = Bundler.definition
|
19
|
+
current_dependencies = definition.requested_dependencies
|
20
|
+
current_specs = definition.specs
|
21
|
+
|
22
|
+
count = current_dependencies.count {|dep| current_specs[dep.name].first.metadata.key?("funding_uri") }
|
23
|
+
|
24
|
+
return if count.zero?
|
25
|
+
|
26
|
+
intro = count > 1 ? "#{count} installed gems you directly depend on are" : "#{count} installed gem you directly depend on is"
|
27
|
+
message = "#{intro} looking for funding.\n Run `bundle fund` for details"
|
28
|
+
Bundler.ui.info message
|
29
|
+
end
|
30
|
+
|
17
31
|
def self.output_without_groups_message(command)
|
18
32
|
return if Bundler.settings[:without].empty?
|
19
33
|
Bundler.ui.confirm without_groups_message(command)
|
data/lib/bundler/cli/doctor.rb
CHANGED
data/lib/bundler/cli/exec.rb
CHANGED
@@ -34,7 +34,7 @@ module Bundler
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
|
37
|
+
private
|
38
38
|
|
39
39
|
def validate_cmd!
|
40
40
|
return unless cmd.nil?
|
@@ -63,10 +63,10 @@ module Bundler
|
|
63
63
|
Kernel.load(file)
|
64
64
|
rescue SystemExit, SignalException
|
65
65
|
raise
|
66
|
-
rescue Exception
|
66
|
+
rescue Exception # rubocop:disable Lint/RescueException
|
67
67
|
Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})"
|
68
|
-
|
69
|
-
|
68
|
+
Bundler::FriendlyErrors.disable!
|
69
|
+
raise
|
70
70
|
end
|
71
71
|
|
72
72
|
def process_title(file, args)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Fund
|
5
|
+
attr_reader :options
|
6
|
+
|
7
|
+
def initialize(options)
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
Bundler.definition.validate_runtime!
|
13
|
+
|
14
|
+
groups = Array(options[:group]).map(&:to_sym)
|
15
|
+
|
16
|
+
deps = if groups.any?
|
17
|
+
Bundler.definition.dependencies_for(groups)
|
18
|
+
else
|
19
|
+
Bundler.definition.current_dependencies
|
20
|
+
end
|
21
|
+
|
22
|
+
fund_info = deps.each_with_object([]) do |dep, arr|
|
23
|
+
spec = Bundler.definition.specs[dep.name].first
|
24
|
+
if spec.metadata.key?("funding_uri")
|
25
|
+
arr << "* #{spec.name} (#{spec.version})\n Funding: #{spec.metadata["funding_uri"]}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if fund_info.empty?
|
30
|
+
Bundler.ui.info "None of the installed gems you directly depend on are looking for funding."
|
31
|
+
else
|
32
|
+
Bundler.ui.info fund_info.join("\n")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/bundler/cli/gem.rb
CHANGED
data/lib/bundler/cli/info.rb
CHANGED
@@ -22,7 +22,7 @@ module Bundler
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
private
|
26
26
|
|
27
27
|
def spec_for_gem(gem_name)
|
28
28
|
spec = Bundler.definition.specs.find {|s| s.name == gem_name }
|
@@ -60,6 +60,7 @@ module Bundler
|
|
60
60
|
gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
|
61
61
|
gem_info << "\tDocumentation: #{metadata["documentation_uri"]}\n" if metadata.key?("documentation_uri")
|
62
62
|
gem_info << "\tSource Code: #{metadata["source_code_uri"]}\n" if metadata.key?("source_code_uri")
|
63
|
+
gem_info << "\tFunding: #{metadata["funding_uri"]}\n" if metadata.key?("funding_uri")
|
63
64
|
gem_info << "\tWiki: #{metadata["wiki_uri"]}\n" if metadata.key?("wiki_uri")
|
64
65
|
gem_info << "\tChangelog: #{metadata["changelog_uri"]}\n" if metadata.key?("changelog_uri")
|
65
66
|
gem_info << "\tBug Tracker: #{metadata["bug_tracker_uri"]}\n" if metadata.key?("bug_tracker_uri")
|
data/lib/bundler/cli/init.rb
CHANGED
data/lib/bundler/cli/inject.rb
CHANGED
data/lib/bundler/cli/install.rb
CHANGED
@@ -53,7 +53,7 @@ module Bundler
|
|
53
53
|
|
54
54
|
if options["binstubs"]
|
55
55
|
Bundler::SharedHelpers.major_deprecation 2,
|
56
|
-
"The --binstubs option will be removed in favor of `bundle binstubs`"
|
56
|
+
"The --binstubs option will be removed in favor of `bundle binstubs --all`"
|
57
57
|
end
|
58
58
|
|
59
59
|
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
|
@@ -82,6 +82,8 @@ module Bundler
|
|
82
82
|
require_relative "clean"
|
83
83
|
Bundler::CLI::Clean.new(options).run
|
84
84
|
end
|
85
|
+
|
86
|
+
Bundler::CLI::Common.output_fund_metadata_summary
|
85
87
|
rescue GemNotFound, VersionConflict => e
|
86
88
|
if options[:local] && Bundler.app_cache.exist?
|
87
89
|
Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
|
@@ -100,7 +102,7 @@ module Bundler
|
|
100
102
|
raise e
|
101
103
|
end
|
102
104
|
|
103
|
-
|
105
|
+
private
|
104
106
|
|
105
107
|
def warn_if_root
|
106
108
|
return if Bundler.settings[:silence_root_warning] || Bundler::WINDOWS || !Process.uid.zero?
|
@@ -150,18 +152,27 @@ module Bundler
|
|
150
152
|
|
151
153
|
check_for_group_conflicts_in_cli_options
|
152
154
|
|
155
|
+
Bundler.settings.set_command_option :with, nil if options[:with] == []
|
156
|
+
Bundler.settings.set_command_option :without, nil if options[:without] == []
|
157
|
+
|
153
158
|
with = options.fetch(:with, [])
|
154
159
|
with |= Bundler.settings[:with].map(&:to_s)
|
155
160
|
with -= options[:without] if options[:without]
|
156
|
-
with = nil if options[:with] == []
|
157
161
|
|
158
162
|
without = options.fetch(:without, [])
|
159
163
|
without |= Bundler.settings[:without].map(&:to_s)
|
160
164
|
without -= options[:with] if options[:with]
|
161
|
-
without = nil if options[:without] == []
|
162
165
|
|
163
|
-
|
164
|
-
|
166
|
+
options[:with] = with
|
167
|
+
options[:without] = without
|
168
|
+
|
169
|
+
unless Bundler.settings[:without] == options[:without] && Bundler.settings[:with] == options[:with]
|
170
|
+
# need to nil them out first to get around validation for backwards compatibility
|
171
|
+
Bundler.settings.set_command_option :without, nil
|
172
|
+
Bundler.settings.set_command_option :with, nil
|
173
|
+
Bundler.settings.set_command_option :without, options[:without] - options[:with]
|
174
|
+
Bundler.settings.set_command_option :with, options[:with]
|
175
|
+
end
|
165
176
|
end
|
166
177
|
|
167
178
|
def normalize_settings
|
@@ -188,7 +199,7 @@ module Bundler
|
|
188
199
|
|
189
200
|
Bundler.settings.set_command_option_if_given :clean, options["clean"]
|
190
201
|
|
191
|
-
normalize_groups
|
202
|
+
normalize_groups
|
192
203
|
|
193
204
|
options[:force] = options[:redownload]
|
194
205
|
end
|