bundler 2.2.11 → 2.3.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +721 -5
  3. data/README.md +1 -1
  4. data/bundler.gemspec +8 -11
  5. data/exe/bundle +7 -8
  6. data/exe/bundler +1 -1
  7. data/lib/bundler/.document +1 -0
  8. data/lib/bundler/build_metadata.rb +3 -3
  9. data/lib/bundler/cli/cache.rb +1 -1
  10. data/lib/bundler/cli/check.rb +4 -2
  11. data/lib/bundler/cli/common.rb +17 -3
  12. data/lib/bundler/cli/config.rb +10 -1
  13. data/lib/bundler/cli/doctor.rb +24 -5
  14. data/lib/bundler/cli/exec.rb +1 -6
  15. data/lib/bundler/cli/gem.rb +130 -26
  16. data/lib/bundler/cli/info.rb +27 -6
  17. data/lib/bundler/cli/init.rb +5 -1
  18. data/lib/bundler/cli/install.rb +23 -54
  19. data/lib/bundler/cli/issue.rb +4 -3
  20. data/lib/bundler/cli/list.rb +7 -1
  21. data/lib/bundler/cli/lock.rb +5 -1
  22. data/lib/bundler/cli/open.rb +1 -2
  23. data/lib/bundler/cli/outdated.rb +22 -14
  24. data/lib/bundler/cli/platform.rb +2 -2
  25. data/lib/bundler/cli/remove.rb +1 -2
  26. data/lib/bundler/cli/show.rb +1 -1
  27. data/lib/bundler/cli/update.rb +17 -8
  28. data/lib/bundler/cli.rb +51 -63
  29. data/lib/bundler/compact_index_client/cache.rb +0 -9
  30. data/lib/bundler/compact_index_client/updater.rb +26 -14
  31. data/lib/bundler/compact_index_client.rb +2 -8
  32. data/lib/bundler/current_ruby.rb +17 -6
  33. data/lib/bundler/definition.rb +260 -362
  34. data/lib/bundler/dependency.rb +23 -71
  35. data/lib/bundler/digest.rb +71 -0
  36. data/lib/bundler/dsl.rb +72 -76
  37. data/lib/bundler/endpoint_specification.rb +19 -13
  38. data/lib/bundler/env.rb +1 -1
  39. data/lib/bundler/environment_preserver.rb +4 -1
  40. data/lib/bundler/errors.rb +29 -3
  41. data/lib/bundler/feature_flag.rb +0 -5
  42. data/lib/bundler/fetcher/base.rb +6 -8
  43. data/lib/bundler/fetcher/compact_index.rb +10 -15
  44. data/lib/bundler/fetcher/downloader.rb +9 -6
  45. data/lib/bundler/fetcher/index.rb +0 -27
  46. data/lib/bundler/fetcher.rb +22 -23
  47. data/lib/bundler/friendly_errors.rb +26 -36
  48. data/lib/bundler/gem_helper.rb +21 -16
  49. data/lib/bundler/gem_helpers.rb +9 -2
  50. data/lib/bundler/gem_version_promoter.rb +14 -25
  51. data/lib/bundler/index.rb +11 -46
  52. data/lib/bundler/injector.rb +18 -4
  53. data/lib/bundler/inline.rb +4 -13
  54. data/lib/bundler/installer/gem_installer.rb +16 -21
  55. data/lib/bundler/installer/parallel_installer.rb +36 -15
  56. data/lib/bundler/installer/standalone.rb +42 -10
  57. data/lib/bundler/installer.rb +25 -41
  58. data/lib/bundler/lazy_specification.rb +52 -30
  59. data/lib/bundler/lockfile_generator.rb +2 -2
  60. data/lib/bundler/lockfile_parser.rb +18 -43
  61. data/lib/bundler/man/bundle-add.1 +21 -5
  62. data/lib/bundler/man/bundle-add.1.ronn +16 -4
  63. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  64. data/lib/bundler/man/bundle-cache.1 +7 -1
  65. data/lib/bundler/man/bundle-cache.1.ronn +7 -0
  66. data/lib/bundler/man/bundle-check.1 +1 -1
  67. data/lib/bundler/man/bundle-clean.1 +2 -2
  68. data/lib/bundler/man/bundle-clean.1.ronn +1 -1
  69. data/lib/bundler/man/bundle-config.1 +49 -22
  70. data/lib/bundler/man/bundle-config.1.ronn +49 -30
  71. data/lib/bundler/man/bundle-console.1 +53 -0
  72. data/lib/bundler/man/bundle-console.1.ronn +44 -0
  73. data/lib/bundler/man/bundle-doctor.1 +1 -1
  74. data/lib/bundler/man/bundle-exec.1 +2 -2
  75. data/lib/bundler/man/bundle-exec.1.ronn +1 -1
  76. data/lib/bundler/man/bundle-gem.1 +14 -1
  77. data/lib/bundler/man/bundle-gem.1.ronn +16 -0
  78. data/lib/bundler/man/bundle-help.1 +13 -0
  79. data/lib/bundler/man/bundle-help.1.ronn +12 -0
  80. data/lib/bundler/man/bundle-info.1 +1 -1
  81. data/lib/bundler/man/bundle-init.1 +1 -1
  82. data/lib/bundler/man/bundle-inject.1 +5 -2
  83. data/lib/bundler/man/bundle-inject.1.ronn +3 -1
  84. data/lib/bundler/man/bundle-install.1 +6 -2
  85. data/lib/bundler/man/bundle-install.1.ronn +8 -2
  86. data/lib/bundler/man/bundle-list.1 +1 -1
  87. data/lib/bundler/man/bundle-lock.1 +1 -1
  88. data/lib/bundler/man/bundle-open.1 +1 -1
  89. data/lib/bundler/man/bundle-outdated.1 +3 -10
  90. data/lib/bundler/man/bundle-outdated.1.ronn +1 -10
  91. data/lib/bundler/man/bundle-platform.1 +16 -6
  92. data/lib/bundler/man/bundle-platform.1.ronn +14 -7
  93. data/lib/bundler/man/bundle-plugin.1 +81 -0
  94. data/lib/bundler/man/bundle-plugin.1.ronn +59 -0
  95. data/lib/bundler/man/bundle-pristine.1 +1 -1
  96. data/lib/bundler/man/bundle-remove.1 +1 -1
  97. data/lib/bundler/man/bundle-show.1 +1 -1
  98. data/lib/bundler/man/bundle-update.1 +5 -5
  99. data/lib/bundler/man/bundle-update.1.ronn +5 -4
  100. data/lib/bundler/man/bundle-version.1 +35 -0
  101. data/lib/bundler/man/bundle-version.1.ronn +24 -0
  102. data/lib/bundler/man/bundle-viz.1 +4 -1
  103. data/lib/bundler/man/bundle-viz.1.ronn +2 -0
  104. data/lib/bundler/man/bundle.1 +15 -10
  105. data/lib/bundler/man/bundle.1.ronn +12 -7
  106. data/lib/bundler/man/gemfile.5 +117 -80
  107. data/lib/bundler/man/gemfile.5.ronn +105 -84
  108. data/lib/bundler/man/index.txt +4 -0
  109. data/lib/bundler/match_metadata.rb +13 -0
  110. data/lib/bundler/match_platform.rb +0 -1
  111. data/lib/bundler/match_remote_metadata.rb +29 -0
  112. data/lib/bundler/plugin/api/source.rb +24 -8
  113. data/lib/bundler/plugin/index.rb +4 -1
  114. data/lib/bundler/plugin/installer/git.rb +0 -4
  115. data/lib/bundler/plugin/installer/rubygems.rb +0 -4
  116. data/lib/bundler/plugin/installer.rb +10 -10
  117. data/lib/bundler/plugin/source_list.rb +4 -0
  118. data/lib/bundler/plugin.rb +30 -8
  119. data/lib/bundler/process_lock.rb +1 -1
  120. data/lib/bundler/remote_specification.rb +10 -4
  121. data/lib/bundler/resolver/base.rb +50 -0
  122. data/lib/bundler/resolver/spec_group.rb +31 -73
  123. data/lib/bundler/resolver.rb +193 -292
  124. data/lib/bundler/retry.rb +1 -1
  125. data/lib/bundler/ruby_dsl.rb +1 -1
  126. data/lib/bundler/ruby_version.rb +5 -18
  127. data/lib/bundler/rubygems_ext.rb +160 -26
  128. data/lib/bundler/rubygems_gem_installer.rb +86 -9
  129. data/lib/bundler/rubygems_integration.rb +46 -93
  130. data/lib/bundler/runtime.rb +18 -12
  131. data/lib/bundler/self_manager.rb +168 -0
  132. data/lib/bundler/settings.rb +98 -22
  133. data/lib/bundler/setup.rb +2 -2
  134. data/lib/bundler/shared_helpers.rb +15 -31
  135. data/lib/bundler/source/git/git_proxy.rb +8 -6
  136. data/lib/bundler/source/git.rb +29 -13
  137. data/lib/bundler/source/metadata.rb +3 -7
  138. data/lib/bundler/source/path/installer.rb +1 -1
  139. data/lib/bundler/source/path.rb +3 -1
  140. data/lib/bundler/source/rubygems.rb +199 -182
  141. data/lib/bundler/source/rubygems_aggregate.rb +68 -0
  142. data/lib/bundler/source.rb +24 -4
  143. data/lib/bundler/source_list.rb +104 -60
  144. data/lib/bundler/source_map.rb +71 -0
  145. data/lib/bundler/spec_set.rb +58 -52
  146. data/lib/bundler/stub_specification.rb +13 -3
  147. data/lib/bundler/templates/Executable +2 -4
  148. data/lib/bundler/templates/Executable.bundler +8 -8
  149. data/lib/bundler/templates/Executable.standalone +2 -4
  150. data/lib/bundler/templates/Gemfile +0 -2
  151. data/lib/bundler/templates/gems.rb +0 -3
  152. data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
  153. data/lib/bundler/templates/newgem/README.md.tt +8 -12
  154. data/lib/bundler/templates/newgem/Rakefile.tt +15 -2
  155. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +16 -7
  156. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +5 -4
  157. data/lib/bundler/templates/newgem/newgem.gemspec.tt +19 -17
  158. data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  159. data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
  160. data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
  161. data/lib/bundler/ui/shell.rb +1 -1
  162. data/lib/bundler/vendor/.document +1 -0
  163. data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  164. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
  165. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  166. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
  167. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
  168. data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
  169. data/lib/bundler/vendor/molinillo/LICENSE +9 -0
  170. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +3 -3
  171. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +32 -26
  172. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  173. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -1
  174. data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  175. data/lib/bundler/vendor/thor/LICENSE.md +20 -0
  176. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +5 -5
  177. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
  178. data/lib/bundler/vendor/thor/lib/thor/actions.rb +6 -2
  179. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
  180. data/lib/bundler/vendor/thor/lib/thor/error.rb +9 -4
  181. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +19 -1
  182. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +22 -4
  183. data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
  184. data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  185. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  186. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +1 -1
  187. data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  188. data/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
  189. data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
  190. data/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
  191. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
  192. data/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
  193. data/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
  194. data/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
  195. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
  196. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
  197. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
  198. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
  199. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  200. data/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
  201. data/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
  202. data/lib/bundler/vendor/uri/lib/uri.rb +0 -1
  203. data/lib/bundler/vendored_tsort.rb +4 -0
  204. data/lib/bundler/version.rb +1 -1
  205. data/lib/bundler/worker.rb +19 -4
  206. data/lib/bundler.rb +46 -39
  207. metadata +39 -12
  208. data/lib/bundler/dep_proxy.rb +0 -55
  209. data/lib/bundler/gemdeps.rb +0 -29
  210. data/lib/bundler/psyched_yaml.rb +0 -22
  211. data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
@@ -1,13 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "match_platform"
4
-
5
3
  module Bundler
6
4
  class LazySpecification
7
5
  include MatchPlatform
8
6
 
9
7
  attr_reader :name, :version, :dependencies, :platform
10
- attr_accessor :source, :remote
8
+ attr_accessor :source, :remote, :force_ruby_platform
11
9
 
12
10
  def initialize(name, version, platform, source = nil)
13
11
  @name = name
@@ -19,7 +17,7 @@ module Bundler
19
17
  end
20
18
 
21
19
  def full_name
22
- if platform == Gem::Platform::RUBY || platform.nil?
20
+ if platform == Gem::Platform::RUBY
23
21
  "#{@name}-#{@version}"
24
22
  else
25
23
  "#{@name}-#{@version}-#{platform}"
@@ -38,14 +36,30 @@ module Bundler
38
36
  identifier.hash
39
37
  end
40
38
 
39
+ ##
40
+ # Does this locked specification satisfy +dependency+?
41
+ #
42
+ # NOTE: Rubygems default requirement is ">= 0", which doesn't match
43
+ # prereleases of 0 versions, like "0.0.0.dev" or "0.0.0.SNAPSHOT". However,
44
+ # bundler users expect those to work. We need to make sure that Gemfile
45
+ # dependencies without explicit requirements (which use ">= 0" under the
46
+ # hood by default) are still valid for locked specs using this kind of
47
+ # versions. The method implements an ad-hoc fix for that. A better solution
48
+ # might be to change default rubygems requirement of dependencies to be ">=
49
+ # 0.A" but that's a major refactoring likely to break things. Hopefully we
50
+ # can attempt it in the future.
51
+ #
52
+
41
53
  def satisfies?(dependency)
42
- @name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version))
54
+ effective_requirement = dependency.requirement == Gem::Requirement.default ? Gem::Requirement.new(">= 0.A") : dependency.requirement
55
+
56
+ @name == dependency.name && effective_requirement.satisfied_by?(Gem::Version.new(@version))
43
57
  end
44
58
 
45
59
  def to_lock
46
60
  out = String.new
47
61
 
48
- if platform == Gem::Platform::RUBY || platform.nil?
62
+ if platform == Gem::Platform::RUBY
49
63
  out << " #{name} (#{version})\n"
50
64
  else
51
65
  out << " #{name} (#{version}-#{platform})\n"
@@ -59,22 +73,34 @@ module Bundler
59
73
  out
60
74
  end
61
75
 
62
- def __materialize__
63
- @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
64
- source.gemspec.tap {|s| s.source = source }
76
+ def materialize_for_installation
77
+ source.local!
78
+
79
+ candidates = if source.is_a?(Source::Path) || !ruby_platform_materializes_to_ruby_platform?
80
+ target_platform = ruby_platform_materializes_to_ruby_platform? ? platform : local_platform
81
+
82
+ GemHelpers.select_best_platform_match(source.specs.search(Dependency.new(name, version)), target_platform)
65
83
  else
66
- search_object = if source.is_a?(Source::Path)
67
- Dependency.new(name, version)
68
- else
69
- ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
84
+ source.specs.search(self)
85
+ end
86
+
87
+ return self if candidates.empty?
88
+
89
+ __materialize__(candidates)
90
+ end
91
+
92
+ def __materialize__(candidates)
93
+ @specification = begin
94
+ search = candidates.reverse.find do |spec|
95
+ spec.is_a?(StubSpecification) ||
96
+ (spec.matches_current_ruby? &&
97
+ spec.matches_current_rubygems?)
70
98
  end
71
- platform_object = Gem::Platform.new(platform)
72
- candidates = source.specs.search(search_object)
73
- same_platform_candidates = candidates.select do |spec|
74
- MatchPlatform.platforms_match?(spec.platform, platform_object)
99
+ if search.nil? && Bundler.frozen_bundle?
100
+ search = candidates.last
101
+ else
102
+ search.dependencies = dependencies if search && search.full_name == full_name && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
75
103
  end
76
- search = same_platform_candidates.last || candidates.last
77
- search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
78
104
  search
79
105
  end
80
106
  end
@@ -84,7 +110,7 @@ module Bundler
84
110
  end
85
111
 
86
112
  def to_s
87
- @__to_s ||= if platform == Gem::Platform::RUBY || platform.nil?
113
+ @__to_s ||= if platform == Gem::Platform::RUBY
88
114
  "#{name} (#{version})"
89
115
  else
90
116
  "#{name} (#{version}-#{platform})"
@@ -92,7 +118,7 @@ module Bundler
92
118
  end
93
119
 
94
120
  def identifier
95
- @__identifier ||= [name, version, platform_string]
121
+ @__identifier ||= [name, version, platform.to_s]
96
122
  end
97
123
 
98
124
  def git_version
@@ -100,13 +126,6 @@ module Bundler
100
126
  " #{source.revision[0..6]}"
101
127
  end
102
128
 
103
- protected
104
-
105
- def platform_string
106
- platform_string = platform.to_s
107
- platform_string == Index::RUBY ? Index::NULL : platform_string
108
- end
109
-
110
129
  private
111
130
 
112
131
  def to_ary
@@ -123,7 +142,8 @@ module Bundler
123
142
 
124
143
  #
125
144
  # For backwards compatibility with existing lockfiles, if the most specific
126
- # locked platform is RUBY, we keep the previous behaviour of resolving the
145
+ # locked platform is not a specific platform like x86_64-linux or
146
+ # universal-java-11, then we keep the previous behaviour of resolving the
127
147
  # best platform variant at materiliazation time. For previous bundler
128
148
  # versions (before 2.2.0) this was always the case (except when the lockfile
129
149
  # only included non-ruby platforms), but we're also keeping this behaviour
@@ -131,7 +151,9 @@ module Bundler
131
151
  # explicitly add a more specific platform.
132
152
  #
133
153
  def ruby_platform_materializes_to_ruby_platform?
134
- !Bundler.most_specific_locked_platform?(Gem::Platform::RUBY) || Bundler.settings[:force_ruby_platform]
154
+ generic_platform = generic_local_platform == Gem::Platform::JAVA ? Gem::Platform::JAVA : Gem::Platform::RUBY
155
+
156
+ !Bundler.most_specific_locked_platform?(generic_platform) || force_ruby_platform || Bundler.settings[:force_ruby_platform]
135
157
  end
136
158
  end
137
159
  end
@@ -60,7 +60,7 @@ module Bundler
60
60
  handled = []
61
61
  definition.dependencies.sort_by(&:to_s).each do |dep|
62
62
  next if handled.include?(dep.name)
63
- out << dep.to_lock
63
+ out << dep.to_lock << "\n"
64
64
  handled << dep.name
65
65
  end
66
66
  end
@@ -71,7 +71,7 @@ module Bundler
71
71
  end
72
72
 
73
73
  def add_bundled_with
74
- add_section("BUNDLED WITH", definition.locked_bundler_version.to_s)
74
+ add_section("BUNDLED WITH", Bundler::VERSION)
75
75
  end
76
76
 
77
77
  def add_section(name, value)
@@ -1,16 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- #--
4
- # Some versions of the Bundler 1.1 RC series introduced corrupted
5
- # lockfiles. There were two major problems:
6
- #
7
- # * multiple copies of the same GIT section appeared in the lockfile
8
- # * when this happened, those sections got multiple copies of gems
9
- # in those sections.
10
- #
11
- # As a result, Bundler 1.1 contains code that fixes the earlier
12
- # corruption. We will remove this fix-up code in Bundler 1.2.
13
-
14
3
  module Bundler
15
4
  class LockfileParser
16
5
  attr_reader :sources, :dependencies, :specs, :platforms, :bundler_version, :ruby_version
@@ -57,6 +46,16 @@ module Bundler
57
46
  attributes
58
47
  end
59
48
 
49
+ def self.bundled_with
50
+ lockfile = Bundler.default_lockfile
51
+ return unless lockfile.file?
52
+
53
+ lockfile_contents = Bundler.read_file(lockfile)
54
+ return unless lockfile_contents.include?(BUNDLED)
55
+
56
+ lockfile_contents.split(BUNDLED).last.strip
57
+ end
58
+
60
59
  def initialize(lockfile)
61
60
  @platforms = []
62
61
  @sources = []
@@ -64,8 +63,6 @@ module Bundler
64
63
  @state = nil
65
64
  @specs = {}
66
65
 
67
- @rubygems_aggregate = Source::Rubygems.new
68
-
69
66
  if lockfile.match(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/)
70
67
  raise LockfileError, "Your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} contains merge conflicts.\n" \
71
68
  "Run `git checkout HEAD -- #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` first to get a clean lock."
@@ -89,24 +86,15 @@ module Bundler
89
86
  send("parse_#{@state}", line)
90
87
  end
91
88
  end
92
- @sources << @rubygems_aggregate unless Bundler.feature_flag.disable_multisource?
93
89
  @specs = @specs.values.sort_by(&:identifier)
94
- warn_for_outdated_bundler_version
95
90
  rescue ArgumentError => e
96
91
  Bundler.ui.debug(e)
97
92
  raise LockfileError, "Your lockfile is unreadable. Run `rm #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` " \
98
93
  "and then `bundle install` to generate a new lockfile."
99
94
  end
100
95
 
101
- def warn_for_outdated_bundler_version
102
- return unless bundler_version
103
- prerelease_text = bundler_version.prerelease? ? " --pre" : ""
104
- current_version = Gem::Version.create(Bundler::VERSION)
105
- return unless current_version < bundler_version
106
- Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \
107
- "than the version that created the lockfile (#{bundler_version}). We suggest you to " \
108
- "upgrade to the version that created the lockfile by running `gem install " \
109
- "bundler:#{bundler_version}#{prerelease_text}`.\n"
96
+ def may_include_redundant_platform_specific_gems?
97
+ bundler_version.nil? || bundler_version < Gem::Version.new("1.16.2")
110
98
  end
111
99
 
112
100
  private
@@ -127,23 +115,11 @@ module Bundler
127
115
  @sources << @current_source
128
116
  when GIT
129
117
  @current_source = TYPES[@type].from_lock(@opts)
130
- # Strip out duplicate GIT sections
131
- if @sources.include?(@current_source)
132
- @current_source = @sources.find {|s| s == @current_source }
133
- else
134
- @sources << @current_source
135
- end
118
+ @sources << @current_source
136
119
  when GEM
137
- if Bundler.feature_flag.disable_multisource?
138
- @opts["remotes"] = @opts.delete("remote")
139
- @current_source = TYPES[@type].from_lock(@opts)
140
- @sources << @current_source
141
- else
142
- Array(@opts["remote"]).each do |url|
143
- @rubygems_aggregate.add_remote(url)
144
- end
145
- @current_source = @rubygems_aggregate
146
- end
120
+ @opts["remotes"] = Array(@opts.delete("remote")).reverse
121
+ @current_source = TYPES[@type].from_lock(@opts)
122
+ @sources << @current_source
147
123
  when PLUGIN
148
124
  @current_source = Plugin.source_from_lock(@opts)
149
125
  @sources << @current_source
@@ -221,10 +197,9 @@ module Bundler
221
197
  platform = platform ? Gem::Platform.new(platform) : Gem::Platform::RUBY
222
198
  @current_spec = LazySpecification.new(name, version, platform)
223
199
  @current_spec.source = @current_source
200
+ @current_source.add_dependency_names(name)
224
201
 
225
- # Avoid introducing multiple copies of the same spec (caused by
226
- # duplicate GIT sections)
227
- @specs[@current_spec.identifier] ||= @current_spec
202
+ @specs[@current_spec.identifier] = @current_spec
228
203
  elsif spaces.size == 6
229
204
  version = version.split(",").map(&:strip) if version
230
205
  dep = Gem::Dependency.new(name, version)
@@ -1,13 +1,13 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-ADD" "1" "January 2021" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "October 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBbundle add\fR \fIGEM_NAME\fR [\-\-group=GROUP] [\-\-version=VERSION] [\-\-source=SOURCE] [\-\-git=GIT] [\-\-branch=BRANCH] [\-\-skip\-install] [\-\-strict] [\-\-optimistic]
10
+ \fBbundle add\fR \fIGEM_NAME\fR [\-\-group=GROUP] [\-\-version=VERSION] [\-\-source=SOURCE] [\-\-path=PATH] [\-\-git=GIT] [\-\-github=GITHUB] [\-\-branch=BRANCH] [\-\-ref=REF] [\-\-skip\-install] [\-\-strict] [\-\-optimistic]
11
11
  .
12
12
  .SH "DESCRIPTION"
13
13
  Adds the named gem to the Gemfile and run \fBbundle install\fR\. \fBbundle install\fR can be avoided by using the flag \fB\-\-skip\-install\fR\.
@@ -41,26 +41,42 @@ Specify version requirements(s) for the added gem\.
41
41
  Specify the group(s) for the added gem\. Multiple groups should be separated by commas\.
42
42
  .
43
43
  .TP
44
- \fB\-\-source\fR, , \fB\-s\fR
44
+ \fB\-\-source\fR, \fB\-s\fR
45
45
  Specify the source for the added gem\.
46
46
  .
47
47
  .TP
48
+ \fB\-\-require\fR, \fB\-r\fR
49
+ Adds require path to gem\. Provide false, or a path as a string\.
50
+ .
51
+ .TP
52
+ \fB\-\-path\fR
53
+ Specify the file system path for the added gem\.
54
+ .
55
+ .TP
48
56
  \fB\-\-git\fR
49
57
  Specify the git source for the added gem\.
50
58
  .
51
59
  .TP
60
+ \fB\-\-github\fR
61
+ Specify the github source for the added gem\.
62
+ .
63
+ .TP
52
64
  \fB\-\-branch\fR
53
65
  Specify the git branch for the added gem\.
54
66
  .
55
67
  .TP
68
+ \fB\-\-ref\fR
69
+ Specify the git ref for the added gem\.
70
+ .
71
+ .TP
56
72
  \fB\-\-skip\-install\fR
57
73
  Adds the gem to the Gemfile but does not install it\.
58
74
  .
59
75
  .TP
60
76
  \fB\-\-optimistic\fR
61
- Adds optimistic declaration of version
77
+ Adds optimistic declaration of version\.
62
78
  .
63
79
  .TP
64
80
  \fB\-\-strict\fR
65
- Adds strict declaration of version
81
+ Adds strict declaration of version\.
66
82
 
@@ -3,7 +3,7 @@ bundle-add(1) -- Add gem to the Gemfile and run bundle install
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE] [--git=GIT] [--branch=BRANCH] [--skip-install] [--strict] [--optimistic]
6
+ `bundle add` <GEM_NAME> [--group=GROUP] [--version=VERSION] [--source=SOURCE] [--path=PATH] [--git=GIT] [--github=GITHUB] [--branch=BRANCH] [--ref=REF] [--skip-install] [--strict] [--optimistic]
7
7
 
8
8
  ## DESCRIPTION
9
9
  Adds the named gem to the Gemfile and run `bundle install`. `bundle install` can be avoided by using the flag `--skip-install`.
@@ -27,20 +27,32 @@ bundle add rails --group "development, test"
27
27
  * `--group`, `-g`:
28
28
  Specify the group(s) for the added gem. Multiple groups should be separated by commas.
29
29
 
30
- * `--source`, , `-s`:
30
+ * `--source`, `-s`:
31
31
  Specify the source for the added gem.
32
32
 
33
+ * `--require`, `-r`:
34
+ Adds require path to gem. Provide false, or a path as a string.
35
+
36
+ * `--path`:
37
+ Specify the file system path for the added gem.
38
+
33
39
  * `--git`:
34
40
  Specify the git source for the added gem.
35
41
 
42
+ * `--github`:
43
+ Specify the github source for the added gem.
44
+
36
45
  * `--branch`:
37
46
  Specify the git branch for the added gem.
38
47
 
48
+ * `--ref`:
49
+ Specify the git ref for the added gem.
50
+
39
51
  * `--skip-install`:
40
52
  Adds the gem to the Gemfile but does not install it.
41
53
 
42
54
  * `--optimistic`:
43
- Adds optimistic declaration of version
55
+ Adds optimistic declaration of version.
44
56
 
45
57
  * `--strict`:
46
- Adds strict declaration of version
58
+ Adds strict declaration of version.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-BINSTUBS" "1" "January 2021" "" ""
4
+ .TH "BUNDLE\-BINSTUBS" "1" "October 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CACHE" "1" "January 2021" "" ""
4
+ .TH "BUNDLE\-CACHE" "1" "October 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
@@ -9,6 +9,9 @@
9
9
  .SH "SYNOPSIS"
10
10
  \fBbundle cache\fR
11
11
  .
12
+ .P
13
+ alias: \fBpackage\fR, \fBpack\fR
14
+ .
12
15
  .SH "DESCRIPTION"
13
16
  Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running [bundle install(1)][bundle\-install], use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
14
17
  .
@@ -53,3 +56,6 @@ One way to be sure that you have the right platformed versions of all your gems
53
56
  .
54
57
  .P
55
58
  By default, bundle cache(1) \fIbundle\-cache\.1\.html\fR fetches and also installs the gems to the default location\. To package the dependencies to \fBvendor/cache\fR without installing them to the local install location, you can run \fBbundle cache \-\-no\-install\fR\.
59
+ .
60
+ .SH "HISTORY"
61
+ In Bundler 2\.1, \fBcache\fR took in the functionalities of \fBpackage\fR and now \fBpackage\fR and \fBpack\fR are aliases of \fBcache\fR\.
@@ -5,6 +5,8 @@ bundle-cache(1) -- Package your needed `.gem` files into your application
5
5
 
6
6
  `bundle cache`
7
7
 
8
+ alias: `package`, `pack`
9
+
8
10
  ## DESCRIPTION
9
11
 
10
12
  Copy all of the `.gem` files needed to run the application into the
@@ -70,3 +72,8 @@ By default, [bundle cache(1)](bundle-cache.1.html) fetches and also
70
72
  installs the gems to the default location. To package the
71
73
  dependencies to `vendor/cache` without installing them to the
72
74
  local install location, you can run `bundle cache --no-install`.
75
+
76
+ ## HISTORY
77
+
78
+ In Bundler 2.1, `cache` took in the functionalities of `package` and now
79
+ `package` and `pack` are aliases of `cache`.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CHECK" "1" "January 2021" "" ""
4
+ .TH "BUNDLE\-CHECK" "1" "October 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CLEAN" "1" "January 2021" "" ""
4
+ .TH "BUNDLE\-CLEAN" "1" "October 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
@@ -20,5 +20,5 @@ Print the changes, but do not clean the unused gems\.
20
20
  .
21
21
  .TP
22
22
  \fB\-\-force\fR
23
- Force a clean even if \fB\-\-path\fR is not set\.
23
+ Forces cleaning up unused gems even if Bundler is configured to use globally installed gems\. As a consequence, removes all system gems except for the ones in the current application\.
24
24
 
@@ -15,4 +15,4 @@ useful when you have made many changes to your gem dependencies.
15
15
  * `--dry-run`:
16
16
  Print the changes, but do not clean the unused gems.
17
17
  * `--force`:
18
- Force a clean even if `--path` is not set.
18
+ Forces cleaning up unused gems even if Bundler is configured to use globally installed gems. As a consequence, removes all system gems except for the ones in the current application.