bundler 2.2.0.rc.1 → 2.2.0.rc.2

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.

Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +725 -687
  3. data/lib/bundler.rb +6 -3
  4. data/lib/bundler/build_metadata.rb +3 -11
  5. data/lib/bundler/cli.rb +27 -14
  6. data/lib/bundler/cli/add.rb +1 -1
  7. data/lib/bundler/cli/cache.rb +1 -7
  8. data/lib/bundler/cli/clean.rb +1 -1
  9. data/lib/bundler/cli/common.rb +14 -0
  10. data/lib/bundler/cli/doctor.rb +1 -1
  11. data/lib/bundler/cli/exec.rb +1 -1
  12. data/lib/bundler/cli/fund.rb +36 -0
  13. data/lib/bundler/cli/gem.rb +1 -1
  14. data/lib/bundler/cli/info.rb +2 -1
  15. data/lib/bundler/cli/init.rb +1 -1
  16. data/lib/bundler/cli/inject.rb +1 -1
  17. data/lib/bundler/cli/install.rb +4 -2
  18. data/lib/bundler/cli/list.rb +1 -1
  19. data/lib/bundler/cli/outdated.rb +1 -1
  20. data/lib/bundler/cli/pristine.rb +1 -1
  21. data/lib/bundler/cli/show.rb +1 -1
  22. data/lib/bundler/cli/update.rb +2 -0
  23. data/lib/bundler/compact_index_client.rb +1 -1
  24. data/lib/bundler/compact_index_client/cache.rb +1 -1
  25. data/lib/bundler/definition.rb +28 -37
  26. data/lib/bundler/dep_proxy.rb +1 -1
  27. data/lib/bundler/dsl.rb +4 -4
  28. data/lib/bundler/endpoint_specification.rb +1 -1
  29. data/lib/bundler/fetcher.rb +3 -3
  30. data/lib/bundler/fetcher/base.rb +1 -1
  31. data/lib/bundler/fetcher/compact_index.rb +1 -1
  32. data/lib/bundler/fetcher/downloader.rb +1 -1
  33. data/lib/bundler/fetcher/index.rb +1 -1
  34. data/lib/bundler/friendly_errors.rb +3 -3
  35. data/lib/bundler/gem_helper.rb +17 -9
  36. data/lib/bundler/gem_helpers.rb +6 -1
  37. data/lib/bundler/gem_version_promoter.rb +1 -1
  38. data/lib/bundler/graph.rb +1 -1
  39. data/lib/bundler/index.rb +1 -1
  40. data/lib/bundler/injector.rb +1 -1
  41. data/lib/bundler/installer.rb +1 -1
  42. data/lib/bundler/installer/gem_installer.rb +1 -1
  43. data/lib/bundler/installer/parallel_installer.rb +1 -1
  44. data/lib/bundler/installer/standalone.rb +2 -2
  45. data/lib/bundler/lazy_specification.rb +3 -3
  46. data/lib/bundler/lockfile_generator.rb +1 -1
  47. data/lib/bundler/lockfile_parser.rb +1 -1
  48. data/lib/bundler/mirror.rb +2 -2
  49. data/lib/bundler/plugin.rb +5 -6
  50. data/lib/bundler/plugin/index.rb +1 -1
  51. data/lib/bundler/plugin/installer.rb +1 -1
  52. data/lib/bundler/plugin/installer/rubygems.rb +1 -1
  53. data/lib/bundler/plugin/source_list.rb +1 -1
  54. data/lib/bundler/remote_specification.rb +1 -1
  55. data/lib/bundler/resolver.rb +4 -4
  56. data/lib/bundler/resolver/spec_group.rb +2 -2
  57. data/lib/bundler/retry.rb +1 -1
  58. data/lib/bundler/ruby_version.rb +1 -1
  59. data/lib/bundler/rubygems_ext.rb +46 -1
  60. data/lib/bundler/rubygems_gem_installer.rb +2 -2
  61. data/lib/bundler/rubygems_integration.rb +18 -6
  62. data/lib/bundler/runtime.rb +2 -2
  63. data/lib/bundler/settings.rb +49 -42
  64. data/lib/bundler/shared_helpers.rb +1 -1
  65. data/lib/bundler/similarity_detector.rb +1 -1
  66. data/lib/bundler/source.rb +1 -1
  67. data/lib/bundler/source/git.rb +1 -1
  68. data/lib/bundler/source/git/git_proxy.rb +4 -2
  69. data/lib/bundler/source/path.rb +2 -2
  70. data/lib/bundler/source/path/installer.rb +1 -1
  71. data/lib/bundler/source/rubygems.rb +2 -2
  72. data/lib/bundler/source/rubygems/remote.rb +1 -1
  73. data/lib/bundler/source_list.rb +2 -2
  74. data/lib/bundler/spec_set.rb +1 -1
  75. data/lib/bundler/stub_specification.rb +1 -1
  76. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  77. data/lib/bundler/templates/newgem/bin/console.tt +1 -2
  78. data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
  79. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +0 -1
  80. data/lib/bundler/ui/shell.rb +5 -5
  81. data/lib/bundler/uri_credentials_filter.rb +1 -1
  82. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +7 -4
  83. data/lib/bundler/vendored_persistent.rb +0 -7
  84. data/lib/bundler/version.rb +1 -1
  85. data/lib/bundler/worker.rb +1 -1
  86. data/lib/bundler/yaml_serializer.rb +1 -1
  87. data/man/bundle-add.1 +1 -1
  88. data/man/{bundle-add.ronn → bundle-add.1.ronn} +0 -0
  89. data/man/bundle-binstubs.1 +5 -3
  90. data/man/{bundle-binstubs.ronn → bundle-binstubs.1.ronn} +2 -4
  91. data/man/bundle-cache.1 +1 -1
  92. data/man/{bundle-cache.ronn → bundle-cache.1.ronn} +0 -0
  93. data/man/bundle-check.1 +1 -1
  94. data/man/{bundle-check.ronn → bundle-check.1.ronn} +0 -0
  95. data/man/bundle-clean.1 +1 -1
  96. data/man/{bundle-clean.ronn → bundle-clean.1.ronn} +0 -0
  97. data/man/bundle-config.1 +14 -14
  98. data/man/{bundle-config.ronn → bundle-config.1.ronn} +14 -13
  99. data/man/bundle-doctor.1 +1 -1
  100. data/man/{bundle-doctor.ronn → bundle-doctor.1.ronn} +0 -0
  101. data/man/bundle-exec.1 +1 -1
  102. data/man/{bundle-exec.ronn → bundle-exec.1.ronn} +0 -0
  103. data/man/bundle-gem.1 +1 -1
  104. data/man/{bundle-gem.ronn → bundle-gem.1.ronn} +0 -0
  105. data/man/bundle-info.1 +1 -1
  106. data/man/{bundle-info.ronn → bundle-info.1.ronn} +0 -0
  107. data/man/bundle-init.1 +1 -1
  108. data/man/{bundle-init.ronn → bundle-init.1.ronn} +0 -0
  109. data/man/bundle-inject.1 +1 -1
  110. data/man/{bundle-inject.ronn → bundle-inject.1.ronn} +0 -0
  111. data/man/bundle-install.1 +29 -2
  112. data/man/{bundle-install.ronn → bundle-install.1.ronn} +24 -2
  113. data/man/bundle-list.1 +1 -1
  114. data/man/{bundle-list.ronn → bundle-list.1.ronn} +0 -0
  115. data/man/bundle-lock.1 +1 -1
  116. data/man/{bundle-lock.ronn → bundle-lock.1.ronn} +0 -0
  117. data/man/bundle-open.1 +1 -1
  118. data/man/{bundle-open.ronn → bundle-open.1.ronn} +0 -0
  119. data/man/bundle-outdated.1 +1 -1
  120. data/man/{bundle-outdated.ronn → bundle-outdated.1.ronn} +0 -0
  121. data/man/bundle-platform.1 +1 -1
  122. data/man/{bundle-platform.ronn → bundle-platform.1.ronn} +0 -0
  123. data/man/bundle-pristine.1 +1 -1
  124. data/man/{bundle-pristine.ronn → bundle-pristine.1.ronn} +0 -0
  125. data/man/bundle-remove.1 +1 -1
  126. data/man/{bundle-remove.ronn → bundle-remove.1.ronn} +0 -0
  127. data/man/bundle-show.1 +1 -1
  128. data/man/{bundle-show.ronn → bundle-show.1.ronn} +0 -0
  129. data/man/bundle-update.1 +1 -1
  130. data/man/{bundle-update.ronn → bundle-update.1.ronn} +0 -0
  131. data/man/bundle-viz.1 +1 -1
  132. data/man/{bundle-viz.ronn → bundle-viz.1.ronn} +0 -0
  133. data/man/bundle.1 +1 -1
  134. data/man/{bundle.ronn → bundle.1.ronn} +0 -0
  135. data/man/gemfile.5 +4 -4
  136. data/man/gemfile.5.ronn +4 -4
  137. metadata +28 -53
  138. data/man/bundle-add.1.txt +0 -58
  139. data/man/bundle-binstubs.1.txt +0 -48
  140. data/man/bundle-cache.1.txt +0 -78
  141. data/man/bundle-check.1.txt +0 -33
  142. data/man/bundle-clean.1.txt +0 -26
  143. data/man/bundle-config.1.txt +0 -527
  144. data/man/bundle-doctor.1.txt +0 -44
  145. data/man/bundle-exec.1.txt +0 -181
  146. data/man/bundle-gem.1.txt +0 -117
  147. data/man/bundle-info.1.txt +0 -21
  148. data/man/bundle-init.1.txt +0 -34
  149. data/man/bundle-inject.1.txt +0 -32
  150. data/man/bundle-install.1.txt +0 -401
  151. data/man/bundle-list.1.txt +0 -44
  152. data/man/bundle-lock.1.txt +0 -93
  153. data/man/bundle-open.1.txt +0 -29
  154. data/man/bundle-outdated.1.txt +0 -131
  155. data/man/bundle-platform.1.txt +0 -57
  156. data/man/bundle-pristine.1.txt +0 -44
  157. data/man/bundle-remove.1.txt +0 -34
  158. data/man/bundle-show.1.txt +0 -27
  159. data/man/bundle-update.1.txt +0 -391
  160. data/man/bundle-viz.1.txt +0 -39
  161. data/man/bundle.1.txt +0 -116
  162. data/man/gemfile.5.txt +0 -651
  163. data/man/index.txt +0 -25
@@ -353,7 +353,10 @@ EOF
353
353
  env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
354
354
 
355
355
  if env.key?("RUBYOPT")
356
- env["RUBYOPT"] = env["RUBYOPT"].sub "-rbundler/setup", ""
356
+ rubyopt = env["RUBYOPT"].split(" ")
357
+ rubyopt.delete("-r#{File.expand_path("bundler/setup", __dir__)}")
358
+ rubyopt.delete("-rbundler/setup")
359
+ env["RUBYOPT"] = rubyopt.join(" ")
357
360
  end
358
361
 
359
362
  if env.key?("RUBYLIB")
@@ -453,7 +456,7 @@ EOF
453
456
  # system binaries. If you put '-n foo' in your .gemrc, RubyGems will
454
457
  # install binstubs there instead. Unfortunately, RubyGems doesn't expose
455
458
  # 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`.
459
+ # the directory to be set as well, via `bundle config set --local bindir foo`.
457
460
  Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
458
461
  end
459
462
 
@@ -621,7 +624,7 @@ EOF
621
624
  @rubygems = nil
622
625
  end
623
626
 
624
- private
627
+ private
625
628
 
626
629
  def eval_yaml_gemspec(path, contents)
627
630
  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-07-02".freeze
8
- @git_commit_sha = "d15da3db73".freeze
7
+ @built_at = "2020-10-07".freeze
8
+ @git_commit_sha = "d7c0467653".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("../../..", __FILE__), ".git")
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
 
@@ -134,7 +134,7 @@ 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
- puts File.read("#{File.dirname(man_page)}/#{File.basename(man_page)}.txt")
137
+ puts File.read("#{File.dirname(man_page)}/#{File.basename(man_page)}.ronn")
138
138
  end
139
139
  elsif command_path = Bundler.which("bundler-#{cli}")
140
140
  Kernel.exec(command_path, "--help")
@@ -439,11 +439,18 @@ module Bundler
439
439
  Outdated.new(options, gems).run
440
440
  end
441
441
 
442
- desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
443
- unless Bundler.feature_flag.cache_all?
444
- method_option "all", :type => :boolean,
445
- :banner => "Include all sources (including path and git)."
442
+ desc "fund [OPTIONS]", "Lists information about gems seeking funding assistance"
443
+ method_option "group", :aliases => "-g", :type => :array, :banner =>
444
+ "Fetch funding information for a specific group"
445
+ def fund
446
+ require_relative "cli/fund"
447
+ Fund.new(options).run
446
448
  end
449
+
450
+ desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
451
+ method_option "all", :type => :boolean,
452
+ :default => Bundler.feature_flag.cache_all?,
453
+ :banner => "Include all sources (including path and git)."
447
454
  method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
448
455
  method_option "cache-path", :type => :string, :banner =>
449
456
  "Specify a different cache path than the default (vendor/cache)."
@@ -462,6 +469,12 @@ module Bundler
462
469
  bundle without having to download any additional gems.
463
470
  D
464
471
  def cache
472
+ SharedHelpers.major_deprecation 2,
473
+ "The `--all` flag is deprecated because it relies on being " \
474
+ "remembered across bundler invocations, which bundler will no longer " \
475
+ "do in future versions. Instead please use `bundle config set cache_all true`, " \
476
+ "and stop using this flag" if ARGV.include?("--all")
477
+
465
478
  require_relative "cli/cache"
466
479
  Cache.new(options).run
467
480
  end
@@ -565,18 +578,18 @@ module Bundler
565
578
 
566
579
  desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
567
580
  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`."
581
+ method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
569
582
  method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
570
583
  :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
571
584
  :desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
572
585
  method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
573
586
  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`."
587
+ method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
588
+ 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
589
  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)`."
590
+ :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
591
  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)`"
592
+ :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
593
 
581
594
  def gem(name)
582
595
  end
@@ -740,11 +753,11 @@ module Bundler
740
753
  end
741
754
  end
742
755
 
743
- private
756
+ private
744
757
 
745
758
  # Automatically invoke `bundle install` and resume if
746
759
  # Bundler.settings[:auto_install] exists. This is set through config cmd
747
- # `bundle config set auto_install 1`.
760
+ # `bundle config set --global auto_install 1`.
748
761
  #
749
762
  # Note that this method `nil`s out the global Definition object, so it
750
763
  # should be called first, before you instantiate anything like an
@@ -839,10 +852,10 @@ module Bundler
839
852
  value = options[name]
840
853
  value = value.join(" ").to_s if option.type == :array
841
854
 
842
- Bundler::SharedHelpers.major_deprecation 2,\
855
+ Bundler::SharedHelpers.major_deprecation 2,
843
856
  "The `#{flag_name}` flag is deprecated because it relies on being " \
844
857
  "remembered across bundler invocations, which bundler will no longer " \
845
- "do in future versions. Instead please use `bundle config set #{name.tr("-", "_")} " \
858
+ "do in future versions. Instead please use `bundle config set --local #{name.tr("-", "_")} " \
846
859
  "'#{value}'`, and stop using this flag"
847
860
  end
848
861
  end
@@ -17,7 +17,7 @@ module Bundler
17
17
  perform_bundle_install unless options["skip-install"]
18
18
  end
19
19
 
20
- private
20
+ private
21
21
 
22
22
  def perform_bundle_install
23
23
  Installer.install(Bundler.root, Bundler.definition)
@@ -24,7 +24,7 @@ module Bundler
24
24
  end
25
25
  end
26
26
 
27
- private
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
@@ -13,7 +13,7 @@ module Bundler
13
13
  Bundler.load.clean(options[:"dry-run"])
14
14
  end
15
15
 
16
- protected
16
+ protected
17
17
 
18
18
  def require_path_or_force
19
19
  return unless Bundler.use_system_gems? && !options[:force]
@@ -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)
@@ -93,7 +93,7 @@ module Bundler
93
93
  end
94
94
  end
95
95
 
96
- private
96
+ private
97
97
 
98
98
  def check_home_permissions
99
99
  require "find"
@@ -34,7 +34,7 @@ module Bundler
34
34
  end
35
35
  end
36
36
 
37
- private
37
+ private
38
38
 
39
39
  def validate_cmd!
40
40
  return unless cmd.nil?
@@ -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
@@ -192,7 +192,7 @@ module Bundler
192
192
  raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.")
193
193
  end
194
194
 
195
- private
195
+ private
196
196
 
197
197
  def resolve_name(name)
198
198
  SharedHelpers.pwd.join(name).basename.to_s
@@ -22,7 +22,7 @@ module Bundler
22
22
  end
23
23
  end
24
24
 
25
- private
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")
@@ -38,7 +38,7 @@ module Bundler
38
38
  puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
39
39
  end
40
40
 
41
- private
41
+ private
42
42
 
43
43
  def gemfile
44
44
  @gemfile ||= Bundler.preferred_gemfile_name
@@ -44,7 +44,7 @@ module Bundler
44
44
  end
45
45
  end
46
46
 
47
- private
47
+ private
48
48
 
49
49
  def last_version_number
50
50
  definition = Bundler.definition(true)
@@ -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
- private
105
+ private
104
106
 
105
107
  def warn_if_root
106
108
  return if Bundler.settings[:silence_root_warning] || Bundler::WINDOWS || !Process.uid.zero?
@@ -31,7 +31,7 @@ module Bundler
31
31
  Bundler.ui.info "Use `bundle info` to print more detailed information about a gem"
32
32
  end
33
33
 
34
- private
34
+ private
35
35
 
36
36
  def verify_group_exists(groups)
37
37
  (@without_group + @only_group).each do |group|
@@ -127,7 +127,7 @@ module Bundler
127
127
  end
128
128
  end
129
129
 
130
- private
130
+ private
131
131
 
132
132
  def groups_text(group_text, groups)
133
133
  "#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
@@ -30,7 +30,7 @@ module Bundler
30
30
  FileUtils.rm_rf spec.full_gem_path
31
31
  when Source::Git
32
32
  if source.local?
33
- Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overriden.")
33
+ Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overridden.")
34
34
  next
35
35
  end
36
36
 
@@ -53,7 +53,7 @@ module Bundler
53
53
  end
54
54
  end
55
55
 
56
- private
56
+ private
57
57
 
58
58
  def fetch_latest_specs
59
59
  definition = Bundler.definition(true)
@@ -106,6 +106,8 @@ module Bundler
106
106
  Bundler.ui.confirm "Bundle updated!"
107
107
  Bundler::CLI::Common.output_without_groups_message(:update)
108
108
  Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
109
+
110
+ Bundler::CLI::Common.output_fund_metadata_summary
109
111
  end
110
112
  end
111
113
  end
@@ -87,7 +87,7 @@ module Bundler
87
87
  @parsed_checksums = true
88
88
  end
89
89
 
90
- private
90
+ private
91
91
 
92
92
  def update(local_path, remote_path)
93
93
  Bundler::CompactIndexClient.debug { "update(#{local_path}, #{remote_path})" }
@@ -83,7 +83,7 @@ module Bundler
83
83
  gem_line ? parse_gem(gem_line) : nil
84
84
  end
85
85
 
86
- private
86
+ private
87
87
 
88
88
  def lines(path)
89
89
  return [] unless path.file?
@@ -199,10 +199,6 @@ module Bundler
199
199
  @locked_specs - specs
200
200
  end
201
201
 
202
- def new_platform?
203
- @new_platform
204
- end
205
-
206
202
  def missing_specs
207
203
  missing = []
208
204
  resolve.materialize(requested_dependencies, missing)
@@ -232,6 +228,12 @@ module Bundler
232
228
  end
233
229
  end
234
230
 
231
+ def requested_dependencies
232
+ groups = requested_groups
233
+ groups.map!(&:to_sym)
234
+ dependencies_for(groups)
235
+ end
236
+
235
237
  def current_dependencies
236
238
  dependencies.select do |d|
237
239
  d.should_include? && !d.gem_platforms(@platforms).empty?
@@ -243,6 +245,12 @@ module Bundler
243
245
  specs.for(expand_dependencies(deps))
244
246
  end
245
247
 
248
+ def dependencies_for(groups)
249
+ current_dependencies.reject do |d|
250
+ (d.groups & groups).empty?
251
+ end
252
+ end
253
+
246
254
  # Resolve all the dependencies specified in Gemfile. It ensures that
247
255
  # dependencies that have been already resolved via locked file and are fresh
248
256
  # are reused when resolving dependencies
@@ -318,10 +326,6 @@ module Bundler
318
326
  sources.rubygems_sources.any? {|s| s.remotes.any? }
319
327
  end
320
328
 
321
- def has_local_dependencies?
322
- !sources.path_sources.empty? || !sources.git_sources.empty?
323
- end
324
-
325
329
  def spec_git_paths
326
330
  sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
327
331
  end
@@ -541,7 +545,7 @@ module Bundler
541
545
  @unlocking
542
546
  end
543
547
 
544
- private
548
+ private
545
549
 
546
550
  def add_platforms
547
551
  (@dependencies.flat_map(&:expanded_platforms) + current_platforms).uniq.each do |platform|
@@ -550,10 +554,9 @@ module Bundler
550
554
  end
551
555
 
552
556
  def current_platforms
553
- current_platform = Bundler.local_platform
554
557
  [].tap do |platforms|
555
- platforms << current_platform if Bundler.feature_flag.specific_platform?
556
- platforms << generic(current_platform)
558
+ platforms << local_platform if Bundler.feature_flag.specific_platform?
559
+ platforms << generic_local_platform
557
560
  end
558
561
  end
559
562
 
@@ -821,7 +824,7 @@ module Bundler
821
824
  end
822
825
 
823
826
  resolve = SpecSet.new(converged)
824
- @locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(deps), @unlock[:gems], true, true)
827
+ @locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(requested_dependencies & deps), @unlock[:gems], true, true)
825
828
  resolve = resolve.for(expand_dependencies(deps, true), @unlock[:gems], false, false, false)
826
829
  diff = nil
827
830
 
@@ -859,11 +862,7 @@ module Bundler
859
862
 
860
863
  def metadata_dependencies
861
864
  @metadata_dependencies ||= begin
862
- ruby_versions = concat_ruby_version_requirements(@ruby_version)
863
- if ruby_versions.empty? || !@ruby_version.exact?
864
- concat_ruby_version_requirements(RubyVersion.system, ruby_versions)
865
- concat_ruby_version_requirements(locked_ruby_version_object, ruby_versions) unless @unlock[:ruby]
866
- end
865
+ ruby_versions = ruby_version_requirements(@ruby_version)
867
866
  [
868
867
  Dependency.new("Ruby\0", ruby_versions),
869
868
  Dependency.new("RubyGems\0", Gem::VERSION),
@@ -871,47 +870,39 @@ module Bundler
871
870
  end
872
871
  end
873
872
 
874
- def concat_ruby_version_requirements(ruby_version, ruby_versions = [])
875
- return ruby_versions unless ruby_version
873
+ def ruby_version_requirements(ruby_version)
874
+ return [] unless ruby_version
876
875
  if ruby_version.patchlevel
877
- ruby_versions << ruby_version.to_gem_version_with_patchlevel
876
+ [ruby_version.to_gem_version_with_patchlevel]
878
877
  else
879
- ruby_versions.concat(ruby_version.versions.map do |version|
878
+ ruby_version.versions.map do |version|
880
879
  requirement = Gem::Requirement.new(version)
881
880
  if requirement.exact?
882
881
  "~> #{version}.0"
883
882
  else
884
883
  requirement
885
884
  end
886
- end)
885
+ end
887
886
  end
888
887
  end
889
888
 
890
889
  def expand_dependencies(dependencies, remote = false)
891
- sorted_platforms = Resolver.sort_platforms(@platforms)
892
890
  deps = []
893
891
  dependencies.each do |dep|
894
892
  dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
895
- next if !remote && !dep.current_platform?
896
- dep.gem_platforms(sorted_platforms).each do |p|
897
- deps << DepProxy.new(dep, p) if remote || p == generic_local_platform
898
- end
893
+ next unless remote || dep.current_platform?
894
+ target_platforms = dep.gem_platforms(remote ? Resolver.sort_platforms(@platforms) : [generic_local_platform])
895
+ deps += expand_dependency_with_platforms(dep, target_platforms)
899
896
  end
900
897
  deps
901
898
  end
902
899
 
903
- def dependencies_for(groups)
904
- current_dependencies.reject do |d|
905
- (d.groups & groups).empty?
900
+ def expand_dependency_with_platforms(dep, platforms)
901
+ platforms.map do |p|
902
+ DepProxy.new(dep, p)
906
903
  end
907
904
  end
908
905
 
909
- def requested_dependencies
910
- groups = requested_groups
911
- groups.map!(&:to_sym)
912
- dependencies_for(groups)
913
- end
914
-
915
906
  def source_requirements
916
907
  # Load all specs from remote sources
917
908
  index